You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Is your feature request related to a problem? Please describe it
When defining a parameter with a "type" property, the "type" is correctly nested within the "schema" field. However, there are several fields that you can reference (in particular, I'm using zod-nestjs to automatically generate the types) which will not be properly moved into the "schema" field. Some examples include "oneOf", "anyOf", or "examples".
Describe the solution you'd like
I believe the fix should be a simple change to include more fields (like "oneOf") in this list of schema keys, but I don't have the full context of if the change makes sense here (locally patching this fixed all of my issues):
What is the motivation / use case for changing the behavior?
The current spec generated will not be valid if a parameter uses a feature like "oneOf" or "examples" (I believe "examples" is specific to 3.1.0, but "oneOf" is valid in 3.0.0)
The text was updated successfully, but these errors were encountered:
Yes, I've put up #3129 which adds support for oneOf and anyOf.
I saw "example" got added already recently. I think "examples" should also be added, but it seems slightly more complicated due to the OAS 3.0 support for "examples" outside of the "schema" field (in 3.1 its only allowed inside the schema, and follows the json-schema format of examples). This makes it hard to tell which type of "examples" is in use. I might try and follow up with this still, but am less confident on it
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
When defining a parameter with a "type" property, the "type" is correctly nested within the "schema" field. However, there are several fields that you can reference (in particular, I'm using zod-nestjs to automatically generate the types) which will not be properly moved into the "schema" field. Some examples include "oneOf", "anyOf", or "examples".
Describe the solution you'd like
I believe the fix should be a simple change to include more fields (like "oneOf") in this list of schema keys, but I don't have the full context of if the change makes sense here (locally patching this fixed all of my issues):
swagger/lib/services/swagger-types-mapper.ts
Lines 142 to 160 in 276b4fa
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
The current spec generated will not be valid if a parameter uses a feature like "oneOf" or "examples" (I believe "examples" is specific to 3.1.0, but "oneOf" is valid in 3.0.0)
The text was updated successfully, but these errors were encountered: