Skip to content

Commit

Permalink
Merge pull request #44 from joaherrerama/DocsAPIresponses
Browse files Browse the repository at this point in the history
Documentation for 400 HTTP responses
  • Loading branch information
joaherrerama authored Nov 24, 2021
2 parents 9e35905 + ec8c4a2 commit 8e3aeb2
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 6 deletions.
15 changes: 14 additions & 1 deletion actinia_stac_plugin/apidocs/stac_collections_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@
"responses": {
"200": {
"description": "This response returns a message with the STAC collection successfully added"
}
},
"400": {
"description": "This response returns a detail error message",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "detailed message",
"example": "Please check the URL provided (Should be a STAC Collection)",
}
},
},
},
},
}
33 changes: 31 additions & 2 deletions actinia_stac_plugin/apidocs/stac_collections_id_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@
"required": True,
}
],
"responses": {"200": {"description": "This response returns a STAC collection"}},
"responses": {
"200": {"description": "This response returns a STAC collection"},
"400": {
"description": "This response returns a detail error message",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "detailed message",
"example": "Please check the collection id provide",
}
},
},
},
},
}

staccollection_id_delete_docs = {
Expand All @@ -56,6 +71,20 @@
"responses": {
"200": {
"description": "This response returns a message with the STAC collection successfully deleted"
}
},
"400": {
"description": "This response returns a detail error message",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "detailed message",
"example": "stac_collection_id does not match the pattern "
+ "stac.<stac_instance_id>.rastercube.<stac_collection_id",
}
},
},
},
},
}
15 changes: 14 additions & 1 deletion actinia_stac_plugin/apidocs/stac_instances_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@
"responses": {
"200": {
"description": "This response returns a message with the instance successfully added"
}
},
"400": {
"description": "This response returns a detail error message",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "detailed message",
"example": "Please check the ID given (no spaces or undercore characters)",
}
},
},
},
},
}
30 changes: 28 additions & 2 deletions actinia_stac_plugin/apidocs/stac_instances_id_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,20 @@
}
],
"responses": {
"200": {"description": "This response returns a instance with its collections"}
"200": {"description": "This response returns a instance with its collections"},
"400": {
"description": "This response returns a detail error message",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "detailed message",
"example": "stac instance ID does not match with the instences stored",
}
},
},
},
},
}

Expand All @@ -59,6 +72,19 @@
"200": {
"description": "This response returns a message with the "
+ "instance and the STAC collections deleted"
}
},
"400": {
"description": "This response returns a detail error message",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "detailed message",
"example": "Something went wrong please check that the element is well typed",
}
},
},
},
},
}

0 comments on commit 8e3aeb2

Please sign in to comment.