Skip to content
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

Parameter example support #95

Open
greyli opened this issue Jul 5, 2021 · 4 comments
Open

Parameter example support #95

greyli opened this issue Jul 5, 2021 · 4 comments

Comments

@greyli
Copy link
Member

greyli commented Jul 5, 2021

Support to set a custom example for request parameters.

@input(PetQuerySchema, location='query', example=..., examples=[...])

Ref: https://swagger.io/docs/specification/adding-examples/

@greyli greyli added the feature label Jul 5, 2021
@greyli greyli self-assigned this Jul 5, 2021
@greyli greyli added this to the 0.9.0 milestone Jul 5, 2021
@greyli greyli modified the milestones: 0.9.0, 0.10.0 Aug 9, 2021
@greyli greyli modified the milestones: 0.10.0, 0.11.0 Sep 19, 2021
@greyli greyli removed their assignment Nov 23, 2021
@greyli greyli modified the milestones: 0.11.0, 0.12.0 Dec 6, 2021
@greyli greyli modified the milestones: 0.12.0, 1.0.0 Mar 2, 2022
@greyli greyli added this to Inbox in 1.0 Apr 3, 2022
@greyli
Copy link
Member Author

greyli commented Apr 9, 2022

This should be handled in apispec. I will work on it (or create an issue in apispec) later after 1.0 is released.

https://github.com/marshmallow-code/apispec/blob/dev/src/apispec/ext/marshmallow/openapi.py#L104

@greyli greyli modified the milestones: 1.0.0, 1.1.0 Apr 9, 2022
@greyli greyli modified the milestones: 1.1.0, 1.2.0 Jul 3, 2022
@greyli greyli added the apispec label Jul 25, 2023
@CJ-Lab7
Copy link

CJ-Lab7 commented Jan 23, 2024

This would be a great feature. I hope you're able to add it

@uncle-lv
Copy link
Contributor

This would be a great feature. I hope you're able to add it

It seems this issue has been done.
Request examples
Response examples

@greyli
Copy link
Member Author

greyli commented Jan 25, 2024

This would be a great feature. I hope you're able to add it

It seems this issue has been done. Request examples Response examples

The example for the query parameter is not supported yet. I guess this feature should be added in apispec (upstream library).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants