This commit is contained in:
Joren de Graaf
2026-10-09 14:43:46 +02:00
parent c825cd474e
commit 559c51e9bb
20 changed files with 322 additions and 27 deletions
+6 -1
View File
@@ -49,7 +49,7 @@ def schema(request):
'servers': [{'url': '/api/v1'}],
'components': {'securitySchemes': {'bearerToken': {'type': 'http', 'scheme': 'bearer'}}},
'paths': {
'/food/today/': {'get': operation('Current local day food log, meal groups, totals, and goals', 'food:read')},
'/food/today/': {'get': operation('Food log for an optional local calendar date, defaulting to today', 'food:read')},
'/food/products/': {'get': operation('Search own food products', 'food:read')},
'/food/log/': {'post': operation('Create food log entry', 'food:write', ENTRY)},
'/food/log/{id}/': {
@@ -77,6 +77,11 @@ def schema(request):
'schema': {'type': 'string', 'format': 'uuid'}}]
if 'post' in methods:
methods['post']['responses']['201'] = methods['post']['responses'].pop('200')
document['paths']['/food/today/']['get']['parameters'] = [{
'name': 'date', 'in': 'query', 'required': False,
'description': 'Local calendar date; defaults to today in the user time zone.',
'schema': {'type': 'string', 'format': 'date'},
}]
document['paths']['/food/attachments/{id}/file/']['get']['responses']['200'] = {
'description': 'Owned image bytes',
'content': {mime: {'schema': {'type': 'string', 'format': 'binary'}}