Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validatePayloads not working #286

Open
markartur opened this issue Oct 10, 2018 · 0 comments
Open

validatePayloads not working #286

markartur opened this issue Oct 10, 2018 · 0 comments

Comments

@markartur
Copy link

markartur commented Oct 10, 2018

Validate Payloads is true in my inflector.yaml file.
I am generating a response payload that is missing a required field, but no error is being throw , neither in logs or on the API.

My inflector.yaml file:

swaggerUrl: swagger.yaml
validatePayloads: true
environment: production
controllerPackage: com.adp.datacloud.accessmanagement.api
modelPackage: com.adp.datacloud.accessmanagement.model
modelMappings:
User: com.adp.datacloud.accessmanagement.model.UserResource
Role: com.adp.datacloud.accessmanagement.model.RoleResource
Group: com.adp.datacloud.accessmanagement.model.GroupResource
entityProcessors:

  • json

My API definition on swagger.yaml:

/groups:
get:
tags:
- groups
x-swagger-router-controller: GroupApi
operationId: getGroups
summary: Get groups list
parameters:
- in: header
name: clientoid
type: string
description: 'Unique key identifier for client'
required: true

  responses:
    200:
      description: Success response
      schema:
        items:
          $ref: '#/definitions/Group'

definitions:

Group:
required:
- groupoid
- name
properties:
groupoid:
type: string
name:
type: string
terminated:
type: string

The object that my code is generating:

[ { "name": "Standard Practitioners" }, { "name": "Custom Group 1" } ]

Missing the required groupoid field, but no error happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant