-
Notifications
You must be signed in to change notification settings - Fork 192
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
Casting schema with allOf
and properties
does not work with strings
#641
Comments
@xxdavid I wouldn't expect those examples to work. Based on the spec, %Schema{
allOf: [
%Schema{
type: :object,
properties: %{a: %Schema{type: :integer}}
},
%Schema{
type: :object,
required: [:b],
properties: %{b: %Schema{type: :integer}}
}
],
} References:
The behavior you're showing at the end there with an atom for |
Hi @msutkowski, can you please quote anything in the spec or docs that explicitly says that Nevertheless, I've found an example in the docs for JSON schema (which AFAIK Open API's schema is based on) which uses both |
Just what I linked already. From a general usability perspective, IMO it doesn't really make sense to merge a base object into a potential union type. But, even though its not explicitly stated that "you can't use base properties +
It's also not a part of the passing test scenarios, so I wouldn't bother trying to bend things - https://github.com/OAI/OpenAPI-Specification/blob/main/tests/v3.0/pass/petstore-expanded.yaml#L128 |
The title may be a bit cryptic but here are a few examples
and
but
However, if I use an atom for
b
, everything works.The text was updated successfully, but these errors were encountered: