-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce Schemas to handle missing body, empty transaction list, missing fields, additional date formats #48
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
…p-py into discord-reported-issues
for more information, see https://pre-commit.ci
…get_api_key checks, use default uuid package
for more information, see https://pre-commit.ci
@@ -20,9 +16,3 @@ async def get_api_key(api_key_header: str = Security(api_key_header)): | |||
status_code=403, | |||
detail="Could not validate credentials", | |||
) | |||
|
|||
|
|||
def generate_custom_id(): |
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.
Removed as its only used in 1 function, and we can use the default python uuid
library
from services.actual_service import actual_service | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.post("/transactions", dependencies=[Depends(get_api_key)]) |
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.
Removed as /transaction
and /transactions/
will work regardless, no need to add both.
Additionally we do not need the dependency on get_api_key
here as it's already added in main.py
when we add the route
@bobokun happy to discuss anything here :) |
Added Schema functionality to allow easier validating of requests and responses.
No body, missing transactions, or missing fields will now return appropriate error messages (see screenshots attached).