Skip to content

Commit 151f480

Browse files
committed
tidier docstrings
1 parent d329278 commit 151f480

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

app/ro_crates/routes/post_routes.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ class validate_data(Schema):
2222
@post_routes_bp.input(validate_data(partial=True), location='json')
2323
def validate_ro_crate_from_id(json_data) -> tuple[Response, int]:
2424
"""
25-
Endpoint to validate an RO-Crate using its ID from MinIO. Requires webhook_url.
25+
Endpoint to validate an RO-Crate using its ID from MinIO.
2626
27-
:param crate_id: The ID of the RO-Crate to validate. Required.
28-
:param profile_name: The profile name for validation. Optional.
29-
:param webhook_url: The webhook URL where validation results will be sent. Required.
30-
:return: A tuple containing the validation task's response and an HTTP status code.
31-
:raises: KeyError: If required parameters (`crate_id` or `webhook_url`) are missing.
27+
Parameters:
28+
- **crate_id**: The ID of the RO-Crate to validate. _Required_.
29+
- **profile_name**: The profile name for validation. _Optional_.
30+
- **webhook_url**: The webhook URL where validation results will be sent. _Required_.
31+
32+
Returns:
33+
- A tuple containing the validation task's response and an HTTP status code.
34+
35+
Raises:
36+
- KeyError: If required parameters (`crate_id` or `webhook_url`) are missing.
3237
"""
3338

3439
try:
@@ -38,7 +43,7 @@ def validate_ro_crate_from_id(json_data) -> tuple[Response, int]:
3843
try:
3944
webhook_url = json_data["webhook_url"]
4045
except:
41-
raise KeyError("Missing required parameter: 'webhook_url'")
46+
raise KeyError("Missing required parameter: 'webhook_url'")
4247

4348
try:
4449
profile_name = json_data["profile_name"]
@@ -51,12 +56,17 @@ def validate_ro_crate_from_id(json_data) -> tuple[Response, int]:
5156
@post_routes_bp.input(validate_data(partial=True), location='json') # -> json_data
5257
def validate_ro_crate_from_id_no_webhook(json_data) -> tuple[Response, int]:
5358
"""
54-
Endpoint to validate an RO-Crate using its ID from MinIO. Does not require webhook_url.
59+
Endpoint to validate an RO-Crate using its ID from MinIO.
60+
61+
Parameters:
62+
- **crate_id**: The ID of the RO-Crate to validate. _Required_.
63+
- **profile_name**: The profile name for validation. _Optional_.
64+
65+
Returns:
66+
- A tuple containing the validation task's response and an HTTP status code.
5567
56-
:param crate_id: The ID of the RO-Crate to validate. Required.
57-
:param profile_name: The profile name for validation. Optional.
58-
:return: A tuple containing the validation task's response and an HTTP status code.
59-
:raises: KeyError: If required parameters (`crate_id`) are missing.
68+
Raises:
69+
- KeyError: If required parameters (`crate_id`) are missing.
6070
"""
6171

6272
try:

0 commit comments

Comments
 (0)