Skip to content

Commit

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

# TODO - Add `get.__doc__`
get.__doc__ = f"""
---
summary: Count {entity_name}s
description: Return the count of the {entity_name} objects that would be
retrieved given the filters provided
tags:
- {entity_name}
parameters:
- WHERE_FILTER
responses:
200:
description: Success - The count of the {entity_name} objects
content:
application/json:
schema:
type: integer
400:
description: Bad request - Something was wrong with the request
404:
description: No such record - Unable to find a record in ICAT
"""

CountEndpoint.__name__ = entity_name
return CountEndpoint
Expand Down

0 comments on commit 2e34d7a

Please sign in to comment.