Search code examples
swagger

How can I used Swagger to generate a mocked server?


I want to generate a mocked server using Swagger YML files, for other services to connect to (eg, the front-end app connecting to a mocked API).

Is there an easy way to achieve this? Ideally, I'd use NodeJS but open to using any language if something already exists.

I want this to be entirely using the Swagger YML and any example data inside the objects rather than having to write code for the API.

Thanks


Solution

  • You can use swagger code-gen to generate server mocks and scafolding projects using a swagger file.

    This project it is in git hub: https://github.com/swagger-api/swagger-codegen