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

How to retrieve data which fields validation failed #5

Closed
venkatesulua1990 opened this issue Mar 25, 2022 · 2 comments
Closed

How to retrieve data which fields validation failed #5

venkatesulua1990 opened this issue Mar 25, 2022 · 2 comments

Comments

@venkatesulua1990
Copy link

Hi
when validation fails it prints in logs like below and the same i wan to return back to Consumer in response, please let me know how to fetch that details , is that stored in any msg variable?

OpenAPIValidator: Object instance has properties which are not allowed by the schema: ["data"]

ERROR | 3/25/22, 11:30:11.570 | OpenAPIValidator: Object has missing required properties (["created","drugInfo","id","patient"])

@cwiechmann
Copy link

Hi @venkatesulua1990, I have created version 1.4.0 of the OpenAPI Validator, that makes it easier to return the validation details to the client.

See the updated README which now includes that requirement.

When using for instance the JSON Error policy filter to handle this error the client will get the following HTTP 400 Response information:

{
  "reasons": [
    {
      "language": "en",
      "message": "[ERROR - [Path '/id'] Instance type (string) does not match any allowed primitive type (allowed: [\"integer\"]): []]"
    }
  ],
  "details": {
    "msgId": "Id-297f41623d05114647150f11"
  }
}

@venkatesulua1990
Copy link
Author

Thanks for making it , it really help our project

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