mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 04:19:26 +00:00
Generate examples with jsf (#1891)
Fixes https://github.com/spec-first/connexion/issues/1719 . Builds on work of https://github.com/spec-first/connexion/pull/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 https://github.com/spec-first/connexion/pull/1870 --------- Co-authored-by: Robbe Sneyders <robbe.sneyders@gmail.com>
This commit is contained in:
@@ -47,7 +47,10 @@ Running a mock server
|
||||
---------------------
|
||||
|
||||
You can run a simple server which returns example responses on every request.
|
||||
The example responses must be defined in the ``examples`` response property of the OpenAPI specification.
|
||||
|
||||
The example responses can be defined in the ``examples`` response property of
|
||||
the OpenAPI specification. If no examples are specified, and you have installed connexion with the `mock` extra (`pip install connexion[mock]`), an example is generated based on the provided schema.
|
||||
|
||||
Your API specification file is not required to have any ``operationId``.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
Reference in New Issue
Block a user