-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add pydantic request models and documentation to API #102
Conversation
feff523
to
41305db
Compare
41305db
to
035bb91
Compare
035bb91
to
68374f0
Compare
addca3f
to
1e4404f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only had a brief look over your changes right now. At first glance it looks like a good change. The only general question that comes up is why they are called request models and not response models 🤔
c68e759
to
53c16c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that was a lot of work. Thank you!
Some questions:
- If I see this correctly, the parameters and field names in GET and POST requests will be different? Why do we have to stick with the camelCase parameter names in GET requests?
- Where are the classmethods from
request_models.py
used?
Co-authored-by: Johannes Visintini <johannes.visintini@heigit.org>
I am glad to hear to work is appreciated. Thanks for your throughout review of this big PR. I will give my best to keep PRs small in the future. To speak to your first question: The parameter and field names will stay the same as it was before (regardless of the request type POST or GET). The trick here is the Second question: The class methods will be called on each initialization of the class. |
Use it in definitions.py to get dataset values for dict.
... "if they don't collide with the properties set by OQT"
Add flake ignore comments for Fast-API parameters which are definied as mixedCase. Run Black.
... "if they do not collide with the properties set by OQT."
previous merge commit c736f10
a4052bf
to
6d1c450
Compare
Use metadata defined in __init__ for Fast API metadata.
Co-authored-by: Johannes Visintini <johannes.visintini@heigit.org>
Description
Add pydantic request models and documentation to API.
Now through swagger it is possible to see which values are allowed for following parameters:
dataset
,fidField
,indicator_name
,report_name
.Also some documentation is added, which will be available through the swagger interface.
Corresponding issue
Adresses in part #2 and #120
Checklist
main
(e.g. throughgit rebase main
)