Skip to content

Commit

Permalink
docs: Add docs to GET Search API Endpoint #281
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Feb 25, 2022
1 parent 60a599e commit d407f0a
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion datagateway_api/src/resources/search_api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,30 @@ def get(self):
log.debug("Filters: %s", filters)
return get_search(entity_name, filters), 200

# TODO - Add `get.__doc__`
get.__doc__ = f"""
---
summary: Get {entity_name}s
description: Retrieves a list of {entity_name} objects
tags:
- {entity_name}
parameters:
- FILTER
responses:
200:
description: Success - returns {entity_name}s that satisfy the
filter
content:
application/json:
schema:
type: array
items:
$ref:
'#/components/schemas/{entity_name}'
400:
description: Bad request - Something was wrong with the request
404:
description: No such record - Unable to find a record in ICAT
"""

Endpoint.__name__ = entity_name
return Endpoint
Expand Down

0 comments on commit d407f0a

Please sign in to comment.