OpenAPI to TypeScript generator and mock server
This project is maintained by pmcelhaney
Copy the following command into your terminal. The only prerequisite is Node 16+.
npm i -g ts-node
npx counterfact@latest https://petstore3.swagger.io/api/v3/openapi.json api --open
@latest
version of counterfact
https://petstore3.swagger.io/api/v3/openapi.json
)api
directory--open
)You can use Swagger to try out the auto-generated API. Out of the box, it returns random responses using metadata from the OpenAPI document. Edit the files under ./api/paths
to add more realistic behavior. There's no need to restart the server.
To learn more, see the Usage Guide.