Don't downconvert openapi3.1 but instead generate 3.0 directly #57
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.
Summary
This PR fixes/implements the following bugs/features
There is an issue that the synthesis time of a WSO2 api takes excessively long (Doesn't complete within 15minutes on an m1 mac) when using large Zod schemas(~300lines in my case). Some investigation with the debugger led to the discovery that the synth gets stuck somewhere in openapi-down-convert . We could fix the problem there, but there is also no need to downconvert the openapi spec, as zod-to-openapi supports generating 3.0.3 schemas directly. With this change it becomes near instant again for large schemas.
Breaking changes
In the above case, we're directly specifying 'null' as a possible type, but this is only supported in openapi 3.1. It should be noted that this is an anti pattern as the schema definition should be inferred from the Zod object directly and using the type property allows you to (unintentionally) lie about the specification.
There might be other cases like this, but I am unaware of those.