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
If an OpenAPI spec has examples, then sensible reponses are returned. Including building up nested objects and arrays (as of #1148).
However, if no example field exists, then a default (and invalid) response is returned. This is causing a problem when trying to mock out a third-party schema (that I do not want to modify).
This issue is being resolved in #1718. An earlier attempt to solve the same problem never got merged #513.
Expected behaviour
Server returns some dummy data that matches the schema requirements.
Actual behaviour
Server returns a body of 'No example response was defined.'.
The text was updated successfully, but these errors were encountered:
While I agree that generating example responses based on the schema would be useful, I don't want to take on the effort to maintain this in Connexion. This PR implements this logic only for the most simple schema's, which means that we'll get issues for every case where this is not working.
If there is a third-party library that can provide this behavior, I'm happy to integrate it.
Fixes#1719 .
Builds on work of #1718,
pulling in external library to provide the fake data from JSON schema.
Changes proposed in this pull request:
* Use JSF library to generate sample data for mocking APIs without
examples.
* Add this as a new extra dependency "mock"
See discussion on #1870
---------
Co-authored-by: Robbe Sneyders <[email protected]>
Description
If an OpenAPI spec has examples, then sensible reponses are returned. Including building up nested objects and arrays (as of #1148).
However, if no example field exists, then a default (and invalid) response is returned. This is causing a problem when trying to mock out a third-party schema (that I do not want to modify).
This issue is being resolved in #1718. An earlier attempt to solve the same problem never got merged #513.
Expected behaviour
Server returns some dummy data that matches the schema requirements.
Actual behaviour
Server returns a body of
'No example response was defined.'
.The text was updated successfully, but these errors were encountered: