Skip to content

0.12.0 regression regarding usability of validation messages #160

Closed
@zupo

Description

@zupo

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:

======================================================================
FAIL: test_name_too_short (app.FunctionalTests)
A name that is too short is picked up by openapi-core validation.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/circleci/repo/examples/singlefile/app.py", line 142, in test_name_too_short
    res.text,
AssertionError: 'Invalid parameter value for `name`: Value is shorter (2) than the minimum length of 3' not found in '400 Bad Request\n\nRequest validation failed.\n\n\nInvalid parameter value for `name`: Value not valid for schema\n\n'

----------------------------------------------------------------------

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:

  • 0.11.0: "Invalid parameter value for `name`: Value is shorter (2) than the minimum length of 3"
  • 0.12.0: "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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions