Skip to content

Fix validation errors/warnings in /retrieve-age-band (#276) - #278

Merged
bigludo7 merged 2 commits into
camaraproject:mainfrom
rartych:validation-fix
Jul 30, 2026
Merged

Fix validation errors/warnings in /retrieve-age-band (#276)#278
bigludo7 merged 2 commits into
camaraproject:mainfrom
rartych:validation-fix

Conversation

@rartych

@rartych rartych commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • correction

What this PR does / why we need it:

Fixes the validation errors and warnings in code/API_definitions/sim-swap.yaml that were introduced by PR #273.

  • Broken refs in /retrieve-age-band: the operation's x-correlator parameter/header and its 400/401 responses used dangling local #/components/... refs. Since these response bodies are identical to the shared CAMARA_common.yaml .definitions, they now point to ../common/CAMARA_common.yaml#/components/..., consistent with /retrieve-date and /check.
  • Local Generic403/404/422/429/501 responses: these differ in content from CAMARA_common.yaml (different code enums/messages), so they are kept local, but /retrieve-date and /check are now aligned to use the same local refs for these five codes, giving a single uniform ref pattern per status code across all three operations. The now-unused local Generic400/Generic401 duplicates were removed. The retained local blocks' nested x-correlator/ErrorInfo sub-refs were repointed to CAMARA_common.yaml.
  • yamllint issues: removed trailing whitespace, fixed the AGEBAND_2LEGS example indentation, added the missing trailing newline at end of file.
  • additional-error-responses mandatory block: moved the three /retrieve-age-band-specific error-handling paragraphs outside the <!-- CAMARA:MANDATORY:additional-error-responses --> markers so the mandatory block matches the canonical template in code/common/info-description-templates.yaml.
  • Schema/description gaps: added format: int32, minimum: 1, maximum: 111 to the SimSwapAgeBand schema (temporary solution - see for possible target resolution: SimSwapAgeBand schema can't express valid limits for the 111 sentinel (S-310/S-311 in #276) #277 ), and description fields to CreateSimSwapAgeBand and the six AGEBAND_* examples.
  • Tag casing: renamed the Retrieve SIM swap age band tag to Title Case Retrieve SIM Swap Age Band.

Additionally fixes wrong x-correlator ref type on /retrieve-date and /check: their 200 response headers referenced the Parameter Object (.../components/parameters/x-correlatort) instead of the Header Object (.../components/headers/x-correlator), making both responses schema-invalid - fixed here since it's a one-line change per operation. /retrieve-age-band already used the correct ref.

Which issue(s) this PR fixes:

Fixes #276

Special notes for reviewers:

  • No behavioral/content changes were made to /retrieve-date or /check beyond switching which $ref target (local vs. CAMARA_common.yaml) they use for 403/404/422/429, and fixing the x-correlator header ref type described above — the effective response schemas for those two operations are otherwise unchanged.
  • For safety reason error response definitions were synchronized with r3.3 - they should be reviewed for more applicable codes/endpoint specific messages - the good moment for it is when applying the model proposed in Minimal referenceable error responses + reusable error examples Commonalities#665.

Changelog input

Fixed validation errors and warnings in the `/retrieve-age-band` operation of the SIM Swap API.

Additional documentation

rartych added 2 commits July 23, 2026 22:51
- Fix dangling refs in /retrieve-age-band: x-correlator parameter/header
  and 400/401 responses now point to CAMARA_common.yaml (identical content).
- Keep 403/404/422/429/501 responses local since their content diverges
  from CAMARA_common.yaml; align /retrieve-date and /check to use the
  same local refs for these codes for a uniform pattern across all three
  operations. Delete now-unused local Generic400/Generic401 duplicates.
- Repoint nested x-correlator/ErrorInfo refs inside the retained local
  Generic403/404/422/429/501 blocks to CAMARA_common.yaml, since
  sim-swap.yaml has no local headers/parameters/ErrorInfo components.
- Fix yamllint issues: trailing whitespace, AGEBAND_2LEGS indentation,
  missing trailing newline.
- Move /retrieve-age-band-specific error-handling prose outside the
  CAMARA:MANDATORY:additional-error-responses markers so the mandatory
  block matches the canonical template.
- Add format/minimum/maximum to SimSwapAgeBand schema, description
  fields to CreateSimSwapAgeBand and age-band examples.
- Rename tag 'Retrieve SIM swap age band' to Title Case
  'Retrieve SIM Swap Age Band' for consistency with sibling tags.
…onses

The 200 response x-correlator header in /retrieve-date and /check
incorrectly referenced the Parameter Object
(.../components/parameters/x-correlator, which has 'name'/'in'
fields not allowed on a Header Object) instead of the Header Object
(.../components/headers/x-correlator). This made both responses
schema-invalid per OpenAPI 3.0.3, confirmed via swagger-parser:

  #/paths/~1retrieve-date/post/responses/200/headers/x-correlator
    must NOT have additional properties
  #/paths/~1check/post/responses/200/headers/x-correlator
    must NOT have additional properties

/retrieve-age-band already used the correct headers/x-correlator ref.
Pre-existing bug from commit 1f1f848, unrelated to issue camaraproject#276 but
found while validating the /retrieve-age-band fix.

@bigludo7 bigludo7 left a comment

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.

Thank you @rartych
Look good for me.
We can go on the next step once @fernandopradocabrillo or @maxl2287 approved.

@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

It is fine for us @bigludo7, we can wait for @maxl2287 ok as well

@bigludo7
bigludo7 merged commit fe832b8 into camaraproject:main Jul 30, 2026
2 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.

Validation errors/warnings from #273 (/retrieve-age-band) landed on main unsurfaced

3 participants