-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: prices GET endpoint #26
Conversation
7e749bc
to
f6ae9aa
Compare
118a132
to
f62ee3e
Compare
8e28b98
to
162f6aa
Compare
app/api.py
Outdated
@@ -124,6 +126,12 @@ async def authentication(form_data: Annotated[OAuth2PasswordRequestForm, Depends | |||
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Server error") | |||
|
|||
|
|||
@app.get("/prices", response_model=List[schemas.PriceBase]) |
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.
@raphael0202 this is a simple v1, but I feel we'll need to have improvements like
- using fastapi-filters to have more complex filtering
- pagination & limit parameters
- should the endpoint answer a list, or a dict with keys like "data" ?
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.
pagination would be good to have indeed!
Better have a dict as a response, so we can add other fields if needed.
like {"prices": [...]}
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.
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 found fastapi-pagination, I'll add it in a follow-up PR
162f6aa
to
47c31bd
Compare
What
GET
endpoint/prices
Todo (futur PRs)
fastapi-filter
for additional/complex filteringfastapi-pagination