Skip to content

Adding examples to auto created parameters #414

@elvirTatarevic

Description

@elvirTatarevic

Hello,

Is there any way to add an examples list to parameters that have already been auto-generated?

Basically, at this point, the only way I can see adding an example to a parameter is by extending the schema using extend_schema or by modifying it in the Post Processing Hooks. I would like to avoid creating my own parameters since the auto-generated ones are pretty good as is and doing it in the post-processing hook would then move the examples to different parts of the code causing confusion.

I would prefer to do it in the extend_schema function but I'm not quite sure how that would look. My only thought currently is to add a parameters_extension field which is a list that has fields just like parameters that will overwrite or add to the auto-generated parameters once they have been created.

Any other thoughts or ideas for some sort of workaround?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfix confirmation pendingissue has been fixed and confirmation from issue reporter is pending

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions