Update API definitions to fix CAMARA validation warnings and hint - #96
Conversation
Updated error response references and added descriptions for request body properties in device-swap.yaml.
CAMARA Validation — PASS0 errors, 0 warnings, 0 hints | Profile: standard |
| $ref: "#/components/examples/RETRIEVE_MONITORED_NULL" | ||
| "400": | ||
| $ref: "#/components/responses/Generic400" | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" |
There was a problem hiding this comment.
Using here the generic reference adds the unused error "OUT_OF_RANGE"
There was a problem hiding this comment.
Thanks @PedroDiez for the review
I can change but we will have a inconsistency with SIM Swap which use the generic for same operation.
WDYT?
adding @albertoramosmonagas
There was a problem hiding this comment.
Understood @bigludo7, i left some comments below for aligment with Sim-Swap
There was a problem hiding this comment.
For /retrieve-date. I think it would be needed to align with Sim-Swap approach https://github.com/camaraproject/SimSwap/blob/main/code/API_definitions/sim-swap.yaml#L192
So some error references keep to the local Device Swap error definition
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" | ||
| "403": | ||
| $ref: "#/components/responses/Generic403" | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" |
There was a problem hiding this comment.
Using in both endpoints local generic reference introduces undesired "INVALID_TOKEN_CONTEXT"
Better to keep the local reference within this API
There was a problem hiding this comment.
Same comment than previous.
Perhaps the issue is on sim swap ;(
| example: 120 | ||
| format: int32 | ||
| minimum: 1 | ||
| maximum: 999 |
There was a problem hiding this comment.
format: int32 and minimum: 1 seem reasonable. However, maximum: 999 introduces a functional restriction, as providers supporting a longer monitoring period would no longer be compliant. I would only add this maximum if there is an agreed requirement behind it.
There was a problem hiding this comment.
I checked for SIM swap and we have:
type: integer
format: int32
minimum: 1
maximum: 999
I propose to keep same - WDYT @albertoramosmonagas ?
There was a problem hiding this comment.
I see that is a change to align with commonalities, okey for me!
| $ref: "#/components/examples/RETRIEVE_MONITORED_NULL" | ||
| "400": | ||
| $ref: "#/components/responses/Generic400" | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" |
There was a problem hiding this comment.
Understood @bigludo7, i left some comments below for aligment with Sim-Swap
| $ref: "#/components/examples/RETRIEVE_MONITORED_NULL" | ||
| "400": | ||
| $ref: "#/components/responses/Generic400" | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" |
There was a problem hiding this comment.
For /retrieve-date. I think it would be needed to align with Sim-Swap approach https://github.com/camaraproject/SimSwap/blob/main/code/API_definitions/sim-swap.yaml#L192
So some error references keep to the local Device Swap error definition
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/CheckDeviceSwapInfo" | ||
| "400": |
There was a problem hiding this comment.
For /check. I think it would be needed to align with Sim-Swap approach
https://github.com/camaraproject/SimSwap/blob/main/code/API_definitions/sim-swap.yaml#L241
So some error references keep to the local Device Swap error definition
Updated response references to use local definitions instead of external common file.
PedroDiez
left a comment
There was a problem hiding this comment.
Change is fine, two minor comments
| status: 403 | ||
| code: PERMISSION_DENIED | ||
| message: Client does not have sufficient permissions to perform this action. | ||
| Generic404: |
There was a problem hiding this comment.
local swagger 404 can be removed is not used
| status: 422 | ||
| code: UNNECESSARY_IDENTIFIER | ||
| message: The device is already identified by the access token. | ||
| Generic429: |
There was a problem hiding this comment.
Yes ! will do now
Removed Generic404 and Generic429 error definitions from the device-swap.yaml file.
|
Up to you @jgarciahospital - Then we can merge and create the snapshot. |
What type of PR is this?
Add one of the following kinds:
What this PR does / why we need it:
CAMARA validation is reporting warnings and hints.
Which issue(s) this PR fixes:
Fixes #95
Special notes for reviewers:
Changelog input
Additional documentation
This section can be blank.