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
phases=[Phase.explicit] does not consistently use examples request body #424
Comments
In other words, It'd be nice to have a way to always use explicit examples in the openApi spec file for every single request that is made |
Hi @charliehohenstein30 ! |
Hi @Stranger6667
Thank you! |
I think it might be caused by https://github.com/kiwicom/schemathesis/blob/b4c6659542f8a6fce76597609290c5d4dea8a05b/src/schemathesis/_hypothesis.py#L77 If there are multiple places with examples (e.g body and query) then when using example for query, data for body will be generated as usual, probably it would be better to merge examples from body, query, etc into a single example |
I'll make a new release with that change today. |
Hi @charliehohenstein30 ! Cheers |
Yes, this fixes the issue! Thank you so much I appreciate it! 👍 @Stranger6667 |
I'm currently trying to use only explicit examples in my openApi spec file. However, phases=[Phase.explicit] does not always use all of the example values that are declared in the RequestBody. This should be related to #381
Here is how I am running my test:
Here is an example of the request object Im using:
An example of what happens is that it will run one time correctly and has a request body:
REQUEST BODY: {'_settings': [{'type': 'org_unit_settings', 'name': 'therapeutic_alternatives_org_unit_id', 'category': 'data_filtering', 'value': 1, 'org_unit_id': 1}], '_org_unit_id': 477}
And then will run another time and the request body will be incorrect as this
REQUEST BODY: {'_org_unit_id': 0}
The text was updated successfully, but these errors were encountered: