-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature request: Select from multiple examples by name #30
Comments
Sorry for the late reply. For now I can't come up with a fast solution for this use case. It's because the config for |
Thanks for the reply. Looking forward to the not-so-fast solution then, maybe… :-) Or does it make more sense to open a json-schema-faker feature request? |
It doesn't have anything to do with Anyway, the ability to select a response for a particular request could definitely be useful. I'm gonna think how to implement it. |
The feature has been implemented partially. Now it's possible to add custom logic for the generation of responses from the Yet the |
As per README.md,
I would like to select the example by name, on a per request basis. For example, I might have examples named "myResourceFlat" and "myResourceWithSubresources" in the OpenAPI spec, and want to return "myResourceWithSubresources" if query parameter "expand=subresources" is present, else "myResourceFlat".
Could you please add support for this? Maybe something like
(Maybe I'm missing something which can already be done with a
jsfCallback
, as I'm new to openapi-mock-express-middleware and know even less about json-schema-faker.)Thanks!
The text was updated successfully, but these errors were encountered: