Skip to content

Update API definitions to fix CAMARA validation warnings and hints#272

Open
bigludo7 wants to merge 11 commits into
mainfrom
fix271
Open

Update API definitions to fix CAMARA validation warnings and hints#272
bigludo7 wants to merge 11 commits into
mainfrom
fix271

Conversation

@bigludo7

@bigludo7 bigludo7 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

Add one of the following kinds:

correction
cleanup
repository management

What this PR does / why we need it:

CAMARA validation is reporting many warnings and hints. This PR reduces that number.

Which issue(s) this PR fixes:

Fixes #271

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 June 9, 2026 18:11
Updated API specification for SIM swap, including error responses, request body strictness, and reference adjustments to CAMARA common definitions.
Align with Commonalities  subscription & event
@camara-validation

camara-validation Bot commented Jun 9, 2026

Copy link
Copy Markdown

CAMARA Validation — PASS (with warnings)

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

View full results

@bigludo7

bigludo7 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

@rartych @hdamker I need help here as I'm struggling to solve last error:

:1 — [spectral-execution-error] Spectral exited with code 2: Error running Spectral! Use --verbose flag to print the error stack. Error #1: Cannot read properties of null (reading 'in') (code/API_definitions/sim-swap.yaml)

Any help welcome :)
Thanks

@hdamker

hdamker commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@rartych @hdamker I need help here as I'm struggling to solve last error:

:1 — [spectral-execution-error] Spectral exited with code 2: Error running Spectral! Use --verbose flag to print the error stack. Error #1: Cannot read properties of null (reading 'in') (code/API_definitions/sim-swap.yaml)

Any help welcome :) Thanks

@bigludo7

Two separate issues:

@bigludo7

Copy link
Copy Markdown
Collaborator Author

Thanks @hdamker
I wait for the signal.

Comment thread code/API_definitions/sim-swap.yaml Outdated
Comment on lines +219 to +223
latestSimChange:
type: string
format: date-time
description: Timestamp of latest SIM swap performed. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
nullable: true
example: "2023-07-03T14:27:08.312+02:00"
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/DateTime"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here referencing the common definition does not work, as nullable: true needs a type sibling, not possible in OAS 3.0.3. On the other side the common DateTime can't be defined with nullable: true.

My recommendation: go back to inline definition, just adding the maxLength field.

latestSimChange:
  type: string
  format: date-time
  maxLength: 64
  nullable: true
  description: Timestamp of latest SIM swap performed. It must follow [RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.

@hdamker

hdamker commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks @hdamker
I wait for the signal.

The crash(es) of validation are fixed. There were actually two different ones, one in our custom rule (camaraproject/tooling#322), and after that was fixed an upstream bug got unmasked (camaraproject/tooling#328).

There are three errors now found by Validation, which have the same root cause. See my review comment https://github.com/camaraproject/SimSwap/pull/272/changes#r3394527908. The rule is firing for all three examples using the definition. Should be fixed before merging the PR.

Updated latestSimChange property to include type, format, and maxLength.
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

2 participants