Skip to content

Commit

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

# TODO - Add `get.__doc__`
get.__doc__ = f"""
---
summary: Find the {entity_name} matching the given pid
description: Retrieves a {entity_name} object with the matching pid
tags:
- {entity_name}
parameters:
- in: path
required: true
name: pid
description: The pid of the entity to retrieve
schema:
oneOf:
- type: string
- FILTER
responses:
200:
description: Success - the matching {entity_name}
content:
application/json:
schema:
$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
"""

EndpointWithID.__name__ = entity_name
return EndpointWithID
Expand Down

0 comments on commit f211c57

Please sign in to comment.