Skip to content

Commit

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

# TODO - Add `get.__doc__`
get.__doc__ = f"""
---
summary: Get {entity_name}s for the given Dataset
description: Retrieves a list of {entity_name} objects for a given Dataset
object
tags:
- Dataset
parameters:
- in: path
required: true
name: pid
description: The pid of the entity to retrieve
schema:
oneOf:
- type: string
- FILTER
responses:
200:
description: Success - returns {entity_name}s for the given Dataset
object 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
"""

FilesEndpoint.__name__ = entity_name
return FilesEndpoint
Expand Down

0 comments on commit 53c2f8c

Please sign in to comment.