Skip to content

Update API definitions to fix CAMARA validation warnings and hint - #96

Merged
jgarciahospital merged 5 commits into
mainfrom
fix95
Aug 3, 2026
Merged

Update API definitions to fix CAMARA validation warnings and hint#96
jgarciahospital merged 5 commits into
mainfrom
fix95

Conversation

@bigludo7

Copy link
Copy Markdown
Collaborator

What type of PR is this?

Add one of the following kinds:

  • correction
  • cleanup
  • subproject management

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

 release-note
- Update API definitions to fix CAMARA validation warnings and hints

Additional documentation

This section can be blank.

docs

bigludo7 added 2 commits July 16, 2026 13:46
Updated error response references and added descriptions for request body properties in device-swap.yaml.
@camara-validation

camara-validation Bot commented Jul 16, 2026

Copy link
Copy Markdown

CAMARA Validation — PASS

0 errors, 0 warnings, 0 hints | Profile: standard

View full results

@bigludo7 bigludo7 changed the title Fix95 Update API definitions to fix CAMARA validation warnings and hint Jul 16, 2026
$ref: "#/components/examples/RETRIEVE_MONITORED_NULL"
"400":
$ref: "#/components/responses/Generic400"
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic400"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using here the generic reference adds the unused error "OUT_OF_RANGE"

@bigludo7 bigludo7 Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood @bigludo7, i left some comments below for aligment with Sim-Swap

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread code/API_definitions/device-swap.yaml Outdated
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic401"
"403":
$ref: "#/components/responses/Generic403"
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic403"

@PedroDiez PedroDiez Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using in both endpoints local generic reference introduces undesired "INVALID_TOKEN_CONTEXT"

Better to keep the local reference within this API

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment than previous.
Perhaps the issue is on sim swap ;(

example: 120
format: int32
minimum: 1
maximum: 999

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bigludo7 bigludo7 Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked for SIM swap and we have:

          type: integer
          format: int32
          minimum: 1
          maximum: 999

I propose to keep same - WDYT @albertoramosmonagas ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PedroDiez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is fine, two minor comments

Comment thread code/API_definitions/device-swap.yaml Outdated
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action.
Generic404:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local swagger 404 can be removed is not used

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread code/API_definitions/device-swap.yaml Outdated
status: 422
code: UNNECESSARY_IDENTIFIER
message: The device is already identified by the access token.
Generic429:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem can be removed, not used

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ! will do now

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PedroDiez done !

Removed Generic404 and Generic429 error definitions from the device-swap.yaml file.

@PedroDiez PedroDiez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bigludo7

Copy link
Copy Markdown
Collaborator Author

Up to you @jgarciahospital - Then we can merge and create the snapshot.

@jgarciahospital jgarciahospital left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jgarciahospital
jgarciahospital merged commit a2b06c8 into main Aug 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align with commonalities r43

4 participants