Skip to content

Commit

Permalink
Merge pull request #4056 from Agnul97/fix-Api_Doc_409_dev_management
Browse files Browse the repository at this point in the history
FIX: changed openApi docs to introduce new error code 409 for device management requests
  • Loading branch information
Coduz authored Jun 14, 2024
2 parents bdc97db + 70632d3 commit e498d61
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
post:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
/{scopeId}/devices/{deviceId}/keystore/items:
Expand Down Expand Up @@ -74,6 +76,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
/{scopeId}/devices/{deviceId}/keystore/item:
Expand Down Expand Up @@ -113,6 +117,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
delete:
Expand Down Expand Up @@ -147,6 +153,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
/{scopeId}/devices/{deviceId}/keystore/items/certificateInfo:
Expand Down Expand Up @@ -175,6 +183,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
/{scopeId}/devices/{deviceId}/keystore/items/certificateRaw:
Expand Down Expand Up @@ -203,6 +213,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
/{scopeId}/devices/{deviceId}/keystore/items/keypair:
Expand Down Expand Up @@ -231,6 +243,8 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
/{scopeId}/devices/{deviceId}/keystore/items/csr:
Expand Down Expand Up @@ -263,5 +277,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ paths:
$ref: '../openapi.yaml#/components/responses/unauthenticated'
403:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
409:
$ref: '../openapi.yaml#/components/responses/entityUniqueness'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ paths:
$ref: '../openapi.yaml#/components/responses/subjectUnauthorized'
404:
$ref: '../openapi.yaml#/components/responses/entityNotFound'
409:
$ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected'
500:
$ref: '../openapi.yaml#/components/responses/kapuaError'
23 changes: 23 additions & 0 deletions rest-api/resources/src/main/resources/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,20 @@ components:
httpErrorCode: 403
message: "This operation can be performed only on the current logged User."
kapuaErrorCode: "SELF_MANAGED_ONLY"
DeviceNotConnectedExceptionInfo:
description: The device is currently disconnected
allOf:
- $ref: '#/components/schemas/exceptionInfo'
- properties:
deviceId:
description: The id of the disconnected device
$ref: '#/components/schemas/kapuaId'
example:
type: "deviceNotConnectedExceptionInfo"
httpErrorCode: 409
message: "The device 3243535747637285611 is not CONNECTED. Current device connection status is: null"
kapuaErrorCode: "DEVICE_NOT_CONNECTED"
deviceId: "LQNak9Yzkus"
### Other Base Entities ###
kapuaListResult:
description: A container for all the Entities List
Expand Down Expand Up @@ -1294,6 +1308,15 @@ components:
application/xml:
schema:
$ref: '#/components/schemas/entityUniquenessExceptionInfo'
conflictDeviceNotConnected: #409 response - device not connected
description: A conflict in the request - the device is disconnected and the request cannot be accomplished
content:
application/json:
schema:
$ref: '#/components/schemas/DeviceNotConnectedExceptionInfo'
application/xml:
schema:
$ref: '#/components/schemas/DeviceNotConnectedExceptionInfo'
# Security schemes
securitySchemes:
kapuaToken:
Expand Down

0 comments on commit e498d61

Please sign in to comment.