-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mock API by pointing to Open API spec #531
Comments
Great idea! We could go about it in two ways:
Thoughts? |
I'm all for having it done automatically. So you point it to an OpenAPI spec and it should start getting those requests. And if you say "here is my open AI key, please generate mocks for all endpoints". It should do that once. maybe even hash the spec of a single action? That would allow caching the mock on a per request base, which is probably cheaper than regenerating mocks for all requests if only a single request in the openapi spec has changed. Maybe even do the generating of the mocks on the fly (with a 429 to delay the client 😉) so only request that are tested get (expensive) mocks, and not every request in the spec. |
It would be very cool if you could point the dev proxy to some openapi spec url and have it mock that api.
And as an extra feature it should use AI (bring your own key) that checks the object type and tries to mock reasonable data.
So if you mock a
/users/{id}
endpoint it would generate a reasonable response for agivenName
or amail
property.The generated response should be saved for economic reasons off course.
The text was updated successfully, but these errors were encountered: