DEPRECATION NOTICE Following the main Express Gateway's deprecation, this project is no longer maintained.
Please follow the instructions on Express Gateway's Getting started page.
Also please take a look at how plugins are installed and enabled.
eg plugin install express-gateway-plugin-openapi3-mock-server
You can use samples/base-paths.yml
for testing purposes. If so, please create a definitions
folder
in the project root and copy the sample YAML there.
system.config.yml
# some config in front of the plugins section
plugins:
express-gateway-plugin-openapi3-mock-server:
definitionFile: 'definitions/yourdefinition.yml' # The file containing your API's specification
# some config after the plugins section
gateway.config.yml (A barebone example, if nothing else is used.)
http:
port: 80
apiEndpoints:
api:
host: '*'
policies:
- mock
pipelines:
api:
apiEndpoints:
- api
policies:
- mock:
- action
The above configuration disables the Admin CLI and will do nothing but provide a dummy responder based on your OpenAPI specification.
- Endpoints with appropriate request types are parsed and the first response example is used as a response body.
- HTTP and apiKey auth header check support
- Accept header checks to return appropriate response example
- X-* headers for testing error responses
- X-* headers for response example selection
- Input parameter validation
- Generators for random response data based on provided schema