Title: Understand Validation Error Messages · python-openapi/openapi-core · Discussion #768 · GitHub
Open Graph Title: Understand Validation Error Messages · python-openapi/openapi-core · Discussion #768
X Title: Understand Validation Error Messages · python-openapi/openapi-core · Discussion #768
Description: Understand Validation Error Messages
Open Graph Description: Hello! I'm using the validate_response function to validate my JSON response against OpenAI spec. It does raise errors, but the message is pretty confusing, below is the validation error raised, I'...
X Description: Hello! I'm using the validate_response function to validate my JSON response against OpenAI spec. It does raise errors, but the message is pretty confusing, below is the validation error raised...
Opengraph URL: https://github.com/python-openapi/openapi-core/discussions/768
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Understand Validation Error Messages","text":"Hello!
\nI'm using the validate_response function to validate my JSON response against OpenAI spec.
\nIt does raise errors, but the message is pretty confusing, below is the validation error raised, I'm wondering if there's any way I could know which field in my spec or JSON response is raising the error? This kind of massive \"None for not of type xx\" really doesn't help much.
\nThey way I printed this was like this:
\n try:\n validate_response_swagger(response)\n except ValidationError as e:\n print(e)\n
\n... not valid for schema of type object: (<ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'array'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'array'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'array'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'array'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'string'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>, <ValidationError: \"None is not of type 'number'\">, <ValidationError: 'None for not nullable'>)\n
\nThank you!
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Please read more about Handling Validation Errors
","upvoteCount":1,"url":"https://github.com/python-openapi/openapi-core/discussions/768#discussioncomment-8432690"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:b4e08d5f-ec2c-c500-3d87-87f7dde00410 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | C0DE:1BC95F:2020AE:2BEE4B:6977D23C |
| html-safe-nonce | 1509434c35534bc4982c2d16e871f198dc826733d06a5afaa4eb0e7a90c0b8c4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMERFOjFCQzk1RjoyMDIwQUU6MkJFRTRCOjY5NzdEMjNDIiwidmlzaXRvcl9pZCI6IjU5MjA2OTc2MTQyNzY3NDM3NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c341d3e1aa72e46e1769498740491d0f6ccc873e633865d3ed3e0dff4b89b8d0 |
| hovercard-subject-tag | discussion:6136647 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/python-openapi/openapi-core/768/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/b6ac731c6a8a941c7c055210a78046a8b4457b315bc5ed969576318ce08efa43/python-openapi/openapi-core/discussions/768 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b6ac731c6a8a941c7c055210a78046a8b4457b315bc5ed969576318ce08efa43/python-openapi/openapi-core/discussions/768 |
| og:image:alt | Hello! I'm using the validate_response function to validate my JSON response against OpenAI spec. It does raise errors, but the message is pretty confusing, below is the validation error raised, I'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b39e6c26c0326ac7510f4f58f7248053edc1a743c844376b8155c71ef8138521 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openapi/openapi-core git https://github.com/python-openapi/openapi-core.git |
| octolytics-dimension-user_id | 126442889 |
| octolytics-dimension-user_login | python-openapi |
| octolytics-dimension-repository_id | 104200746 |
| octolytics-dimension-repository_nwo | python-openapi/openapi-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 104200746 |
| octolytics-dimension-repository_network_root_nwo | python-openapi/openapi-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9db2400e2405e5e571d97a25e1e140cfec8da1a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width