orval-labs / orval

orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
https://orval.dev
MIT License
3.21k stars 337 forks source link

Generate Cypress mocks #836

Open mahammedzkhan opened 1 year ago

mahammedzkhan commented 1 year ago

Feature Request

Cypress also has API mocking built in and it works a bit different than msw, it would be great if we could generate stubs with fake data for that: https://docs.cypress.io/guides/guides/network-requests#Stubbing

spaceo commented 1 year ago

And where should the fake data come from? From a library that can generate the data based on the property types? Or from the spec schema, eg.: post.requestBody.content.application/json.example: https://swagger.io/docs/specification/adding-examples/

mahammedzkhan commented 1 year ago

@spaceo we use faker-js to generate fake data but we should do the same what we do for msw.