You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build a plugin that takes an OpenAPI spec as input and generates the necessary mock responses when requested. Like you suggested, it caches the generated mocks for subsequent use. Here, we'd also need to consider invalidating the cache when the spec changed.
Build a command that converts an OpenAPI spec into mocks. The benefit here is that you only process the spec once and get a set of mocks which you can reuse without the spec. You can also fine tune the generated mocks to your needs.
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: