Skip to content
\n

Note the exclusiveMinimum: 3 value. In OAS3.0, this would have been a pair of minimum: 3 and exclusiveMinimum: true, but in OAS3.1 I should be able to express it only with one key.

\n

Here's a repro that should error, but doesn't:

\n
import requests\nfrom openapi_core import OpenAPI\nfrom openapi_core.contrib.requests import RequestsOpenAPIRequest\n\nopenapi = OpenAPI.from_file_path('sample.yaml')\n\nrequest = requests.Request('GET', 'https://foo.local/hello?name=yo')\nopenapi_request = RequestsOpenAPIRequest(request)\n\n# Should raise a validation error for the parameter being too short, doesn't\nvalidated = openapi.unmarshal_request(openapi_request)\n\n# Some debug handling\nassert not validated.errors\nprint(validated.parameters.query[\"name\"]) #=> yo\nprint(len(validated.parameters.query[\"name\"])) #=> 2
\n

Some versions:

\n\n

Full version tree, in case that's interesting:

\n
Details\n
$ poetry show -t openapi-core\nopenapi-core 0.19.0 client-side and server-side support for the OpenAPI Specification v3\n├── isodate *\n│   └── six *\n├── jsonschema >=4.18.0,<5.0.0\n│   ├── attrs >=22.2.0\n│   ├── jsonschema-specifications >=2023.03.6\n│   │   └── referencing >=0.31.0\n│   │       ├── attrs >=22.2.0 (circular dependency aborted here)\n│   │       └── rpds-py >=0.7.0\n│   ├── referencing >=0.28.4 (circular dependency aborted here)\n│   └── rpds-py >=0.7.1 (circular dependency aborted here)\n├── jsonschema-path >=0.3.1,<0.4.0\n│   ├── pathable >=0.4.1,<0.5.0\n│   ├── pyyaml >=5.1\n│   ├── referencing >=0.28.0,<0.32.0\n│   │   ├── attrs >=22.2.0\n│   │   └── rpds-py >=0.7.0\n│   └── requests >=2.31.0,<3.0.0\n│       ├── certifi >=2017.4.17\n│       ├── charset-normalizer >=2,<4\n│       ├── idna >=2.5,<4\n│       └── urllib3 >=1.21.1,<3\n├── more-itertools *\n├── openapi-schema-validator >=0.6.0,<0.7.0\n│   ├── jsonschema >=4.19.1,<5.0.0\n│   │   ├── attrs >=22.2.0\n│   │   ├── jsonschema-specifications >=2023.03.6\n│   │   │   └── referencing >=0.31.0\n│   │   │       ├── attrs >=22.2.0 (circular dependency aborted here)\n│   │   │       └── rpds-py >=0.7.0\n│   │   ├── referencing >=0.28.4 (circular dependency aborted here)\n│   │   └── rpds-py >=0.7.1 (circular dependency aborted here)\n│   ├── jsonschema-specifications >=2023.5.2,<2024.0.0 (circular dependency aborted here)\n│   └── rfc3339-validator *\n│       └── six *\n├── openapi-spec-validator >=0.7.1,<0.8.0\n│   ├── jsonschema >=4.18.0,<5.0.0\n│   │   ├── attrs >=22.2.0\n│   │   ├── jsonschema-specifications >=2023.03.6\n│   │   │   └── referencing >=0.31.0\n│   │   │       ├── attrs >=22.2.0 (circular dependency aborted here)\n│   │   │       └── rpds-py >=0.7.0\n│   │   ├── referencing >=0.28.4 (circular dependency aborted here)\n│   │   └── rpds-py >=0.7.1 (circular dependency aborted here)\n│   ├── jsonschema-path >=0.3.1,<0.4.0\n│   │   ├── pathable >=0.4.1,<0.5.0\n│   │   ├── pyyaml >=5.1\n│   │   ├── referencing >=0.28.0,<0.32.0 (circular dependency aborted here)\n│   │   └── requests >=2.31.0,<3.0.0\n│   │       ├── certifi >=2017.4.17\n│   │       ├── charset-normalizer >=2,<4\n│   │       ├── idna >=2.5,<4\n│   │       └── urllib3 >=1.21.1,<3\n│   ├── lazy-object-proxy >=1.7.1,<2.0.0\n│   └── openapi-schema-validator >=0.6.0,<0.7.0\n│       ├── jsonschema >=4.19.1,<5.0.0 (circular dependency aborted here)\n│       ├── jsonschema-specifications >=2023.5.2,<2024.0.0 (circular dependency aborted here)\n│       └── rfc3339-validator *\n│           └── six *\n├── parse *\n└── werkzeug *\n    └── markupsafe >=2.1.1
\n
\n

I hope this makes the issue clear, please let me know if there's something I'm overlooking!

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Hi @miketheman

\n

exclusiveMinimum works for numeric types only

\n

https://json-schema.org/understanding-json-schema/reference/numeric#range

","upvoteCount":1,"url":"https://github.com/python-openapi/openapi-core/discussions/810#discussioncomment-8813175"}}}
Discussion options

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@miketheman
Comment options

Answer selected by miketheman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants