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

Create and use a MethodDescription Pydantic model #15

Open
anatoly-scherbakov opened this issue Aug 3, 2021 · 1 comment
Open

Create and use a MethodDescription Pydantic model #15

anatoly-scherbakov opened this issue Aug 3, 2021 · 1 comment

Comments

@anatoly-scherbakov
Copy link
Owner

anatoly-scherbakov commented Aug 3, 2021

https://dqrura49d0.execute-api.us-east-1.amazonaws.com/docs auto-docs does not describe the format of /methods API endpoint.

To remedy that, create a MethodDescription Pydantic model with two fields: name: str and label: Method.

Use List[MethodDescription] as response_model argument for @app.get() and return list of MethodDescription instances instead of list of dicts.

Relevant docs: https://fastapi.tiangolo.com/tutorial/response-model/

@RomanZorkin
Copy link
Contributor

RomanZorkin commented Aug 14, 2021

resolves #17 accidentally sent few issues in one pull request

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

No branches or pull requests

2 participants