{"repo":"aleksandryackovlev/openapi-mock-express-middleware","free":true,"listed":false,"github":"https://github.com/aleksandryackovlev/openapi-mock-express-middleware","clone":"git clone https://github.com/aleksandryackovlev/openapi-mock-express-middleware.git","description":"Generates express mock-servers from OpenAPI specs","language":"TypeScript","stars":28,"topics":["openapi","swagger","express","mock-server","codegen","middleware","typescript","mock"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"[![npm][npm]][npm-url] openapi-mock-express-middleware Generates express mock-servers from Open API 3.0 specs. Installation To begin, you'll need to install openapi-mock-express-middleware : Usage Simple Config Advanced Config The middleware uses json-schmea-faker under the hood. To configure it, you can pass the options object to the factory function. (The full list of available options can be seen here) Mock data Basic behavior By default midleware generates random responses depending on the types specified in the openapi docs. doc.yml GET /company response Faker or Chance generated responses In addition faker.js or chance.js methods can be specified for data generation. In order to use these generators you have to configure middleware through the configure option of the factory function. After that you can use 'x-faker' and/or 'x-chance' attributes in your openapi specs. spec.yml GET /user response Responses generated from examples If an example for the response object is specified, it will be used as a resulting sever response. doc.yml GET /user response If multiple examples for the response object are specified, the first one will be used as a resulting sever response. doc.yml GET /user response If you want to use some other logic for generating responses from the examples attributes you can easily implement it by overwriting this behavior in the configure option of the middleware's factory function: Contributing Please take a moment to read our contributing guidelines i","default_branch":null,"files":null,"tree":[],"storefront":"/r/aleksandryackovlev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/aleksandryackovlev/openapi-mock-express-middleware/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}