Skip to content

Commit

Permalink
docs: minor copy editing
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Oct 16, 2024
1 parent 0c013ca commit 8b14784
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions aim/digifeeds/database/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_items(
response_model_by_alias=False,
responses={
404: {
"description": "Bad request</br></br>The item doesn't exist",
"description": "Bad request: The item doesn't exist",
"model": schemas.Response404,
}
},
Expand All @@ -84,7 +84,7 @@ def get_item(
response_model_by_alias=False,
responses={
400: {
"description": "Bad request</br></br>The item already exists",
"description": "Bad request: The item already exists",
"model": schemas.Response400,
}
},
Expand All @@ -107,13 +107,21 @@ def create_item(
db_item = crud.add_item(item=item, db=db)
return db_item

desc_put_404 = """
Bad request: The item or status doesn't exist<br><br>
Possible reponses:
<ul>
<li>Item not found</li>
<li>Status not found</li>
</ul>
"""

@app.put(
"/items/{barcode}/status/{status_name}",
response_model_by_alias=False,
responses={
404: {
"description": "Bad request</br></br>The item or status doesn't exist",
"description": desc_put_404,
"model": schemas.Response404,
}
},
Expand All @@ -125,7 +133,7 @@ def update_item(
"""
Update a digifeeds item.
The item can be updated with the barcode of the item and the status.
This is how to add a status to an existing item.
"""

db_status = crud.get_status(name=status_name, db=db)
Expand Down
4 changes: 2 additions & 2 deletions aim/digifeeds/database/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Response400(Response):
json_schema_extra={
"examples": [
{
"detail": "Item already exists.",
"detail": "Item already exists",
}
]
}
Expand All @@ -70,7 +70,7 @@ class Response404(Response):
json_schema_extra={
"examples": [
{
"detail": "Item not found.",
"detail": "Item not found",
}
]
}
Expand Down

0 comments on commit 8b14784

Please sign in to comment.