-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
[Bug]: Can’t validate numerical string as type
: integer
/number
/boolean
wrapped in allOf
/anyOf
/oneOf
#698
Comments
Hi @andersk thanks for the report. This one will require type finding in |
Unfortunately it's not so straightforward to make it work soon. |
Hmm, I can see why this would be difficult. There are some questions here that the specification doesn’t seem to address; for example, if a path or query value Do you happen to know what part of the specification allows a path or query value |
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com>
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com>
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com>
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com>
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com>
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com>
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com> (cherry picked from commit 0514f92)
Real requests would not validate against the previous version. There seems to be no consistent way to determine whether a string parameter should be coerced to an integer for validation against an allOf schema (which works at the level of JSON objects, not strings). See also python-openapi/openapi-core#698. Signed-off-by: Anders Kaseorg <anders@zulip.com> (cherry picked from commit 0514f92)
Hello, what is the state of this issue? |
Actual Behavior
The string
123
from a path or query parameter validates as{"type": "integer"}
, but unexpectedly fails to validate as{"allOf": [{"type": "integer"}]}
. The same problem occurs withnumber
orboolean
in place ofinteger
, oranyOf
oroneOf
in place ofallOf
.(My actual use case involves
{"oneOf": [{"type": "string", "enum": ["newest", "oldest", "first_unread"]}, {"type": "integer"}]}
.)Expected Behavior
No error. A string that validates as
{"type": "integer"}
should also validate as{"allOf": [{"type": "integer"}]}
.Steps to Reproduce
OpenAPI Core Version
0.18.1 or current Git (0838a84)
OpenAPI Core Integration
none
Affected Area(s)
No response
References
No response
Anything else we need to know?
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: