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
Note that if inside the OA\JsonContent I enclose the schema inside a oneOf = {} and add a second dummy schema, I then see the correct schema output in the json.
Also note that the behaviour is the same if the schema is included as a reference, rather than inline.
The text was updated successfully, but these errors were encountered:
Almost got it. JsonContent is a shorthand version of a Schema nested inside a MediaType. It extends Schema, so there is no need to nest another Schema.
Removing the inner Schema should be all you need to change.
I guess it would still be very useful if the generator could detect and warn about this instead of just generating an empty schema without explanation - I wasted a few hours today and never did solve it myself - so I'll leave this open as a feature request, but yes, removing the inner Schema did result in the expected output.
(Edit: This is now a feature request, not a failure - see comment chain)
Schema generation fails, when inside a JsonContent element.
Steps to reproduce:
With composer.json containing
"zircote/swagger-php": "^4.10",
(4.10.6 in composer.lock)With code
Calling:
Results in output:
Notice that schema value is empty "{}"
Expected ouput::
Note that if inside the OA\JsonContent I enclose the schema inside a oneOf = {} and add a second dummy schema, I then see the correct schema output in the json.
Also note that the behaviour is the same if the schema is included as a reference, rather than inline.
The text was updated successfully, but these errors were encountered: