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

On outputvalidation true, the invalid date-time value results in 500 Internal Server Error #161

Open
openmohan opened this issue Jul 20, 2019 · 2 comments

Comments

@openmohan
Copy link

With outputvalidation sets to true, if the response has data time field in it and has wrong type value, the entire result fails with 500 response code.

eg:

DataResponse - 
{
  name: "test", audit:{"created_at": "test"}
}

If the response schema is 
  DataResponse:
    type: object
    description: "stock model"
    properties:
      name:
        type: string
        description: "stock model"
        example: "XYZ"
      audit:
        $ref: '#/definitions/Audit'
    required:
    - name
    - audit
  Audit:
    type: object
    description: "audit on the stock view"
    properties:
      created_at: 
        title: Created At
        description: "when the object is created"
        type: string
        readOnly: true
        format: date-time

yo --version - 3.1.0

@tlivings tlivings added bug and removed bug labels Oct 18, 2019
@tlivings
Copy link
Contributor

What is the expected result? If server is validating response, and response is wrong, it is a server error.

@openmohan
Copy link
Author

Actually the date is passed from request. And in that case it should throw 400 with proper error message, right?

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

2 participants