-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
openapi2,3: support array of types in type
field
#912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is the way forward to me too. Thanks for tackling this!
Just a comment, really yack shaving on a test...
More importantly, please push the diff generated by that command:
./docs.sh
@@ -40,5 +40,5 @@ func Example() { | |||
Properties["bar"].Value. | |||
Type, | |||
) | |||
// Output: string | |||
// Output: &[string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update this test so its output is serialized json (or yaml), so as to show that serialization turns single valued arrays of types into a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's precisely what this comment change is doing, right? Not sure I follow the concern.
Note that OpenAPI |
d22dc07
to
4b90e5f
Compare
4b90e5f
to
8018ae1
Compare
I've run Regarding the legality of types being an array, it's actually valid again in 3.1. See discussion here: mattpolzin/OpenAPIKit#356 If you plan on merging this change, I'd appreciate it you did it sooner rather than later and then we followed up with any smaller remaining improvements. Due to the pervasive nature of this change, conflicts are very likely with other changes, as evidenced by the conflicts I had to resolve before I could update this branch. Thanks! |
(accidentally closed, reopening now) |
type
field
Thanks! |
Resolves #563
The discussion in issue #563 mentions that this is only supported by openapi2, but the JSON Schema validation spec seems to imply that this should still be supported: https://json-schema.org/draft/2020-12/json-schema-validation#name-type
This PR is a big and breaking change and only really adds two tests. Putting it up for discussion sake. Totally understood if an alternative approach is preferred.