We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If a component contains allOf, then there is no validation against it. It seems there is a regression introduced in version 0.13.6.
Sample
import json from openapi_core.testing import MockRequest from openapi_core.validation.request.validators import RequestValidator from openapi_spec_validator.schemas import read_yaml_file from openapi_core.shortcuts import create_spec def test_openapi_core(): data = json.dumps({ 'a': 15, 'b': 30 }) request = MockRequest("http://localhost:8090", "post", "/validate", data=data) spec = create_spec(read_yaml_file("./open_api_0136_bug.yml")) validator = RequestValidator(spec) result = validator.validate(request) assert result.errors, f"{result.errors}"
Contents of open_api_0136_bug .yml
openapi: 3.0.1 info: title: all-of bug 0.1.36 version: 2.0.0 description: Sample to demonstrate all of bug in version 0.1.36 paths: /validate: post: summary: "test" description: just for the validation requestBody: content: application/json: schema: $ref: '#/components/schemas/FooBar' required: true responses: 200: description: schema is valid 400: description: schema is invalid components: schemas: ### REQUESTS ### FooBar: allOf: - $ref: '#/components/schemas/Foo' - $ref: '#/components/schemas/Bar' description: all of foo and bar Foo: required: - a type: object properties: a: $ref: '#/components/schemas/age' b: $ref: '#/components/schemas/age' Bar: required: - x type: object properties: x: $ref: '#/components/schemas/age' age: minimum: 18 exclusiveMinimum: false type: integer description: age. Must be an adult
The text was updated successfully, but these errors were encountered:
@sjiekak thanks for the report. Indeed I forgot to make one change for any type unmarshaller. That should be easy to fix.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
If a component contains allOf, then there is no validation against it. It seems there is a regression introduced in version 0.13.6.
Sample
Contents of open_api_0136_bug .yml
The text was updated successfully, but these errors were encountered: