-
Notifications
You must be signed in to change notification settings - Fork 21
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 response didn't return the expected example data #84
Comments
So this is likely to be a feature request I imagine. It would be great to have a feature flag that determines whether fully mocked or partially mocked data is returned. So in fully mocked mode it returns random generated data and in partial mode it returns any examples defined in the openapi documentation, just filling in the missing examples with generated data. Another configuration might also be to determine how the defined examples are returned, do you round robin return the examples if there are multiple of them provided, or deterministically return only the first examples in the list (with an exception for arrays etc) |
This is actually a bug, it should always flow from object examples, to schema examples and then to inline example values within schemas and then generated values. The last hope is generated values, the first choice should always be provided examples, then drop down to |
reported in pb33f/wiretap#84 Signed-off-by: quobix <dave@quobix.com>
reported in pb33f/wiretap#84 Signed-off-by: quobix <dave@quobix.com>
This should be resolved in The default behavior is: Look for If there are no If there is no |
This may be a bad assumption on my part but I would expect (or want) the responses returned by wiretap in mock mode to use the provided examples if in the spec and only provide truly mocked responses (ie generating responses based on the schema) if there were no provided examples.
If this isn't the intended behavior or my assumption was wrong would be good if it could be configured to react this way?
The text was updated successfully, but these errors were encountered: