Fix validation errors/warnings in /retrieve-age-band (#276) - #3
Open
rartych wants to merge 2 commits into
Open
Conversation
- 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.
CAMARA Validation — FAIL1 errors, 0 warnings, 1 hints | Profile: standard |
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
Fixes the validation errors and warnings in
code/API_definitions/sim-swap.yamlthat were introduced by PR camaraproject#273./retrieve-age-band: the operation'sx-correlatorparameter/header and its400/401responses used dangling local#/components/...refs. Since these response bodies are identical to the sharedCAMARA_common.yaml.definitions, they now point to../common/CAMARA_common.yaml#/components/..., consistent with/retrieve-dateand/check.Generic403/404/422/429/501responses: these differ in content fromCAMARA_common.yaml(different code enums/messages), so they are kept local, but/retrieve-dateand/checkare 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 localGeneric400/Generic401duplicates were removed. The retained local blocks' nestedx-correlator/ErrorInfosub-refs were repointed toCAMARA_common.yaml.AGEBAND_2LEGSexample indentation, added the missing trailing newline at end of file.additional-error-responsesmandatory 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 incode/common/info-description-templates.yaml.format: int32,minimum: 1,maximum: 111to theSimSwapAgeBandschema (temporary solution - see for possible target resolution:SimSwapAgeBandschema can't express valid limits for the111sentinel (S-310/S-311 in #276) camaraproject/SimSwap#277 ), anddescriptionfields toCreateSimSwapAgeBandand the sixAGEBAND_*examples.Retrieve SIM swap age bandtag to Title CaseRetrieve SIM Swap Age Band.Additionally fixes wrong
x-correlatorref type on/retrieve-dateand/check: their200response 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-bandalready used the correct ref.Which issue(s) this PR fixes:
Fixes camaraproject#276
Special notes for reviewers:
/retrieve-dateor/checkbeyond switching which$reftarget (local vs.CAMARA_common.yaml) they use for403/404/422/429, and fixing thex-correlatorheader ref type described above — the effective response schemas for those two operations are otherwise unchanged.Changelog input
Additional documentation