-
-
Notifications
You must be signed in to change notification settings - Fork 135
0.12.0 regression regarding usability of validation messages #160
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
Comments
Hi @zupo . That's correct. 0.12 comes with new OAS Validator which will allow to return more detailed errors and even json schema validation. |
Fantastic! If you want/need help testing it before release, I'm happy to run pyramid_openapi3 tests against a branch of openapi-core! |
More details on the regression at: python-openapi/openapi-core#160 When 0.12.1 is released I'll update the tests to bring back support for latest openapi-core.
More details on the regression at: python-openapi/openapi-core#160 When 0.12.1 is released I'll update the tests to bring back support for latest openapi-core.
More details on the regression at: python-openapi/openapi-core#160 When 0.12.1 is released I'll update the tests to bring back support for latest openapi-core.
Hey! Massive thanks for the fix! I created a new PR that uses openapi-core master, here are my findings:
- "Invalid parameter value for `name`: Value is shorter (2) "
- "than the minimum length of 3",
+ "Invalid parameter value for `name`: "
+ "Value yo not valid for schema of type SchemaType.STRING: "
+ "[<ValidationError: \"'yo' is too short\">]\n\n", https://github.com/Pylons/pyramid_openapi3/pull/43/files#r337661719
- 'message': "Value {'title': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'} not "
- 'valid for schema of type SchemaType.OBJECT: []'}]
+ 'field': 'title',
+ 'message': 'Invalid schema property title: Value is longer (41) than the '
+ 'maximum length of 40'}] https://app.circleci.com/jobs/github/Pylons/pyramid_openapi3/178 Any idea why self.schema_errors would be empty? |
Hi @zupo .
Thanks for help testing it. |
Yup, fixed indeed, works great with the latest master! Any ETA on a new release yet? Can I help in any way? |
Hey again @p1c2u! I love the recent changes in master and I can't wait to be able to update Can I in any way help with getting changes in master released? I can offer time and/or money. |
@zupo hey, I had to refactor couple of parts. I plan to release it shortly. |
The `openapi-core` library we build on top of is upgraded to `0.13.2` which brings a complete rewrite of the validation mechanism that is now based on `jsonschema` library. This manifests as different validation error messages. Additionally, I moved `openapi_validation_error` from `examples/todoapp` into the main package so it becomes a first-class citizen and people can use it without copy/pasting. You need to explicitly enable it by running `config.pyramid_openapi3_JSONify_errors()`. It's quite opinionated but easy to override and provide your own, based on your OpenAPI schema. Closes #59 Closes #33 Closes #43 Closes #40 Closes #34 Refs python-openapi/openapi-core#160
The `openapi-core` library we build on top of is upgraded to `0.13.2` which brings a complete rewrite of the validation mechanism that is now based on `jsonschema` library. This manifests as different validation error messages. Additionally, I moved `openapi_validation_error` from `examples/todoapp` into the main package so it becomes a first-class citizen and people can use it without copy/pasting. You need to explicitly enable it by running `config.pyramid_openapi3_JSONify_errors()`. It's quite opinionated but easy to override and provide your own, based on your OpenAPI schema. Closes #59 Closes #33 Closes #43 Closes #40 Closes #34 Refs python-openapi/openapi-core#160
The `openapi-core` library we build on top of is upgraded to `0.13.2` which brings a complete rewrite of the validation mechanism that is now based on `jsonschema` library. This manifests as different validation error messages. Additionally, I moved `openapi_validation_error` from `examples/todoapp` into the main package so it becomes a first-class citizen and people can use it without copy/pasting. You need to explicitly enable it by running `config.pyramid_openapi3_JSONify_errors()`. It's quite opinionated but easy to override and provide your own, based on your OpenAPI schema. Closes #59 Closes #33 Closes #43 Closes #40 Closes #34 Refs python-openapi/openapi-core#160
The `openapi-core` library we build on top of is upgraded to `0.13.2` which brings a complete rewrite of the validation mechanism that is now based on `jsonschema` library. This manifests as different validation error messages. Additionally, I moved `openapi_validation_error` from `examples/todoapp` into the main package so it becomes a first-class citizen and people can use it without copy/pasting. You need to explicitly enable it by running `config.pyramid_openapi3_JSONify_errors()`. It's quite opinionated but easy to override and provide your own, based on your OpenAPI schema. Closes #59 Closes #33 Closes #43 Closes #40 Closes #34 Refs python-openapi/openapi-core#160
Hey!
I'm the author of https://github.com/Pylons/pyramid_openapi3, and today I realized a new release of openapi-core is out, yay!
I immediately prepared a PR to bump pyramid_openapi3 to openapi-core 0.12.0, but tests on CI failed:
The test above fails in a single-file example that I ship with pyramid_openapi3. It fails because in 0.11.0, the validation error is more descriptive than in 0.12.0:
"Invalid parameter value for `name`: Value is shorter (2) than the minimum length of 3"
"Invalid parameter value for `name`: Value not valid for schema"
Is this an expected regression due to the move to a different validation engine that happened in 0.12.0 (or at least that is how I understood the commit messages)? Is it possible to configure the new validation to have more descriptive errors? Or am I completely missing the point here?
The text was updated successfully, but these errors were encountered: