Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I've implemented basic OpenAPI v3.0 spec output with the additional support for
anyOf
andnullable
in JSON schemas.I started without knowing Swagger 2.0, OpenAPI 3.0, or this module at all, so there may be mistakes, but it seems to pass validators. I'm pretty sure I didn't implement the full spec, but it seems to work on all the test servers and on our own real-world server, so I think it's already a good starting point.
I tried to reuse most of the existing code whenever possible, but working with the code base seemed a bit tedious at the end. I feel like this may need a deeper rewrite, but I didn't have the resources nor did I feel entitled to do that in a feature PR, so I hope the way I did it won't bother you too much. Tests are sometimes adapted, sometimes full copies of existing ones with the 3.0 twist when it would introduce too many conditionals, it feels more maintainable that way, but one has to implement new tests in both files in the future, unfortunately. This may be possible with a lot of abstracted test helpers.