I created mock api server myself that can server swagger.json
file. It is very easy to setup locally if you have python installed.
Have a look at this: https://github.com/bikcrum/Mock-API-server
Just use this command to serve your swagger.json
file which will create API endpoints based on specification on the swagger file.
Quick and straightforward
python app.py -s /path/to/swagger.json
Extended options
usage: app.py [-h] -s SOURCE [-p PORT] [-t {swagger}] [-sc STATUS_CODE] [-r RANDOM_SEED] [-d DEFAULT_VALUE [DEFAULT_VALUE ...]]
[-l LIST_SIZE [LIST_SIZE ...]]
Options for mock responses
Required and optional arguments:
-h, --help show this help message and exit
-s SOURCE, --source SOURCE
(Required) API reference source file path.
-p PORT, --port PORT (Optional,default=5000) Port number the app runs on.
-t {swagger}, --type {swagger}
(Optional,default='swagger') Type of API reference. Currently only supports Swagger.
-sc STATUS_CODE, --status_code STATUS_CODE
(Optional,default=200) Generates responses with status code provided.
-r RANDOM_SEED, --random_seed RANDOM_SEED
(Optional) Generates random responses based on seed value.
-d DEFAULT_VALUE [DEFAULT_VALUE ...], --default_value DEFAULT_VALUE [DEFAULT_VALUE ...]
(Optional) Sets default values in response body. Format key=value.
-l LIST_SIZE [LIST_SIZE ...], --list_size LIST_SIZE [LIST_SIZE ...]
(Optional,default=[2]) Sets default size of list in response body.