Mocking
Last updated
Was this helpful?
Last updated
Was this helpful?
OpenAPI allows to include examples in the API definition. FLAT uses to implement an easy to use mock server.
Mocking can be activated by the client with the HTTP header
If given, FLAT will look for the examples
of the API path's 200
responses
section for an example with a content-type that matches the inbound Accept
header.
work just the same way.
The has a recipe for the .
To avoid accidentally running on mocks in production, mocking has to be explicitly activated with the FLAT_ALLOW_MOCKING
environment variable (default false
):