Skip to content

Commit

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

# TODO - Add `get.__doc__`
get.__doc__ = f"""
---
summary: Count {entity_name}s for the given Dataset
description: Return the count of {entity_name} objects for the given Dataset
object that would be retrieved given the filters provided
tags:
- Dataset
parameters:
- in: path
required: true
name: pid
description: The pid of the entity to retrieve
schema:
oneOf:
- type: string
- WHERE_FILTER
responses:
200:
description: Success - The count of {entity_name} objects for the
given Dataset object
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
"""

CountFilesEndpoint.__name__ = entity_name
return CountFilesEndpoint

0 comments on commit ba367a0

Please sign in to comment.