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
I'm evaluating this gem for a project I'm working on and it looks much nicer than rswag. Well done! 👏🏻
Sorry for the long message that follows.
Now, my Rails app has a model that itself has a property that can be an instance of several different sub-models. The JSON for this can look something like:
Which is fine but not quite what I want. I'd like to use the oneOf keyword to differentiate the response types. So I edit my OpenAPI spec to look like this:
Notice that it keeps my oneOf: but adds back the sub-model with all properties being nullable. Is this a known limitation or something I'm doing wrong?
The text was updated successfully, but these errors were encountered:
Same issue here. Reading through the source code it seems that this case isn't handled.
A possible implementation is to find the most similar schema, merge it, and if no schema is sufficiently similar, a new option is added to oneOf.
I'm evaluating this gem for a project I'm working on and it looks much nicer than rswag. Well done! 👏🏻
Sorry for the long message that follows.
Now, my Rails app has a model that itself has a property that can be an instance of several different sub-models. The JSON for this can look something like:
or:
I have request specs that return both variants of this model. By default rspec-openapi generates an OpenAPI spec that looks something like this:
Which is fine but not quite what I want. I'd like to use the
oneOf
keyword to differentiate the response types. So I edit my OpenAPI spec to look like this:But when I rerun the spec generation, rspec-openapi alters the spec to this:
Notice that it keeps my
oneOf:
but adds back the sub-model with all properties beingnullable
. Is this a known limitation or something I'm doing wrong?The text was updated successfully, but these errors were encountered: