Describe HTTP 401 responses explicitly

This commit is contained in:
D. Berge
2021-10-03 21:01:05 +02:00
parent 6bc3aff587
commit 18ee28d72e

View File

@@ -103,7 +103,7 @@ components:
This authentication is used by users having the `user` role, giving read and write access to the Dougal system, except for administrative endpoints. See the description of `CookieAuthGuest` for more information on how to obtain a token.
responses:
401Error:
"401":
description: Unauthorised. Either no credentials were provided or the user does not have sufficient privileges to perform this operation.
content:
application/json:
@@ -730,7 +730,7 @@ paths:
meta:
type: object
"401":
$ref: "#/components/responses/401Error"
$ref: "#/components/responses/401"
/project/{project}:
# Synonym: /project/{project}/summary:
@@ -747,7 +747,7 @@ paths:
schema:
$ref: "#/components/schemas/ProjectSummary"
"401":
$ref: "#/components/responses/401Error"
$ref: "#/components/responses/401"
/project/{project}/line/:
@@ -766,7 +766,7 @@ paths:
items:
$ref: "#/components/schemas/PreplotLine"
"401":
$ref: "#/components/responses/401Error"
$ref: "#/components/responses/401"
/project/{project}/line/{line}:
@@ -821,7 +821,7 @@ paths:
items:
$ref: "#/components/schemas/Sequence"
"401":
$ref: "#/components/responses/401Error"
$ref: "#/components/responses/401"
/project/{project}/sequence/{sequence}:
@@ -880,6 +880,8 @@ paths:
responses:
"204":
description: The resource has been successfully updated.
"401":
$ref: "#/components/responses/401"
/project/{project}/plan:
@@ -912,6 +914,8 @@ paths:
responses:
"201":
description: Sequence successfully added
"401":
$ref: "#/components/responses/401"
put:
summary: Modify a planned sequence
@@ -928,6 +932,8 @@ paths:
responses:
"201":
description: Sequence successfully modified
"401":
$ref: "#/components/responses/401"
/project/{project}/plan/{sequence}:
@@ -950,6 +956,8 @@ paths:
responses:
"201":
description: Sequence successfully modified
"401":
$ref: "#/components/responses/401"
delete:
description: Remove a sequence from the plan.
@@ -960,6 +968,8 @@ paths:
responses:
"204":
description: Returned when the sequence no longer exists in the plan. Note that it is possible that the sequence never existed in the first place, as supplying a valid but non-existing sequence number is not an error.
"401":
$ref: "#/components/responses/401"
/project/{project}/event:
@@ -987,6 +997,8 @@ paths:
application/vnd.seis+json:
schema:
$ref: "#/components/schemas/SeisExport"
"401":
$ref: "#/components/responses/401"
post:
summary: Add a new event
tags: [ "log" ]
@@ -1004,6 +1016,8 @@ paths:
responses:
"201":
description: New event created successfully
"401":
$ref: "#/components/responses/401"
put:
summary: Update an existing event.
tags: [ "log" ]
@@ -1021,6 +1035,8 @@ paths:
responses:
"201":
description: Event updated successfully.
"401":
$ref: "#/components/responses/401"
delete:
summary: Delete an event.
tags: [ "log" ]
@@ -1046,6 +1062,8 @@ paths:
responses:
"204":
description: The event no longer exists.
"401":
$ref: "#/components/responses/401"
/project/{project}/event/{type}/{id}:
@@ -1084,6 +1102,8 @@ paths:
responses:
"201":
description: Event updated successfully.
"401":
$ref: "#/components/responses/401"
delete:
summary: Delete an event.
@@ -1114,6 +1134,8 @@ paths:
responses:
"204":
description: The event no longer exists.
"401":
$ref: "#/components/responses/401"
/project/{project}/label:
@@ -1131,6 +1153,8 @@ paths:
type: array
items:
$ref: "#/components/schemas/Label"
"401":
$ref: "#/components/responses/401"
/project/{project}/configuration/{path}:
@@ -1169,6 +1193,8 @@ paths:
"sequence"
]
}
"401":
$ref: "#/components/responses/401"
"404":
description: The requested parameter does not exist. Note that the HTTP return code allows us to differentiate between a non-existent parameter and one which is `null` or `undefined`.
@@ -1201,6 +1227,8 @@ paths:
- type: string
- type: number
- type: boolean
"401":
$ref: "#/components/responses/401"
/project/{project}/meta/{type}/{kind}/{path}:
@@ -1258,6 +1286,8 @@ paths:
- type: string
- type: number
- type: boolean
"401":
$ref: "#/components/responses/401"
"404":
description: The requested data does not exist. Note that the HTTP return code allows us to differentiate between a non-existent item and one which is `null` or `undefined`.
@@ -1303,6 +1333,8 @@ paths:
responses:
"201":
description: Metadata updated successfully.
"401":
$ref: "#/components/responses/401"
/navdata:
@@ -1321,6 +1353,8 @@ paths:
type: array
items:
$ref: "#/components/schemas/NavData"
"401":
$ref: "#/components/responses/401"
/navdata/gis/point:
@@ -1339,6 +1373,8 @@ paths:
type: array
items:
$ref: "#/components/schemas/GeoJSONFeature"
"401":
$ref: "#/components/responses/401"
/navdata/gis/line:
@@ -1361,6 +1397,9 @@ paths:
application/geo+json:
schema:
$ref: "#/components/schemas/GeoJSONFeature"
"401":
$ref: "#/components/responses/401"
/login:
@@ -1384,6 +1423,8 @@ paths:
responses:
"204":
description: Login successful. The token is returned in a `Set-Cookie` header.
"401":
$ref: "#/components/responses/401"
/logout: