-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
Support for array in type keyword #563
Comments
Indeed you're right. From https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#schema-object I arrive at a similar passage of https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00#section-5.5.2.1 Same for OpenAPIv3.1 https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-7.6.1 In OpenAPIv3.0
When converting 'Legal in v2':
type: [boolean, string]
'Legal in v3.0':
oneOf:
- {type: boolean}
- {type: string} Please send PRs my way! :) |
@fenollp Working on a PR. Not too sure at the moment what should be the behaviour of the code at https://github.com/getkin/kin-openapi/blob/master/openapi3/schema.go#L655 where we must validate the format associated with the type and we have multiple types. Do we have any reference to this case in the specs? I guess the format should not be specified if multiple types are provided... |
@rodcloutier have you made any more progress on this? @fenollp any advice for rod? Depending on the status of this, it might be something I will need to pick up soon if we aren't close to a solution? |
@TristanSpeakEasy If you wish you can take over the work. I haven't had time to make any progress. |
According to the json schema upon which OpenAPI spec relies,
type
keyword can be either a string or an array.Using this feature in an OpenAPI spec v2 prevents parsing
The following snipped
produces
The text was updated successfully, but these errors were encountered: