Repository navigation
Conversation
Updated response references for number recycling API, replacing generic responses with specific ones.
| Set to true (Boolean, not string) when there has been a change in the subscriber associated with the specific phone number after “specifiedDate”. | ||
| responses: | ||
| Generic400: | ||
| CheckNumberRecycling400: |
There was a problem hiding this comment.
Commonalities r4.4 already provides BadRequestWithRange400, IdentifierNotFound404, and PhoneNumberIdentifier422 in CAMARA_common.yaml, with the same schema as these local definitions. Analogous r4.4 APIs that also operate on phone number with /check (SimSwap, DeviceSwap) reference all 5 error codes directly from common, with no local definitions.
Would it be possible to reference 400, 404, and 422 from common and remove the local definitions? A local definition is only needed if Number Recycling has error codes that are specific to this API. The r4.4 precedent for a justified local definition is RetrieveLocationUnprocessableEntity422 in DeviceLocation, which is API-specific.
There was a problem hiding this comment.
HI @albertoramosmonagas, thank you for your coment.
I can discuss openly on possibility to refer 400, 404, and 422 from common.yaml.
As you pointed out, Number Recycling has same error codes as common.yaml. However, I found that it has different descriptione and/or messagee in 400, 404, and 422 error. So I keep the original description and/or message as local definition at this moment.
So far, I would like to hear opinions also from other code owners. What do you think, @eric-murray and @grgpapadopoulos ?
There was a problem hiding this comment.
@albertoramosmonagas, it is ok for me to refer common 404 and 422 response. I will update "File changed" in this PR. Regading the 400 response, I am happy if we can keep the local definition as I commented here.
There was a problem hiding this comment.
Thanks, referencing 404 and 422 from common looks good. The 400 can stay local as discussed above, provided it follows the r4.4 naming pattern.
| code: INVALID_ARGUMENT | ||
| message: Client specified an invalid argument, request body or query param. | ||
| $ref: "../common/CAMARA_common.yaml#/components/examples/GENERIC_400_INMALID_ARGUMENT" | ||
| OutOfRange: |
There was a problem hiding this comment.
The inline OutOfRange example is identical to GENERIC_400_OUT_OF_RANGE from common. If the suggestion above (point 3) is applied and 400 is referenced from common, this is implicitly resolved. If the local definition is kept, this example should be replaced with a $ref to the common example to avoid duplication.
There was a problem hiding this comment.
There was a problem hiding this comment.
Thanks for the context. The canonical approach would be to use the common BadRequestWithRange400 response. We understand your point about PR #122 and its specific, non-normative message, and we're fine with whatever the other codeowners prefer.
Keeping the local definition is acceptable, but note that the Release Management review may raise this again. If the local definition stays, please align its naming with r4.4 (see my comment on the response name) and rebase the branch, as the diff still shows the pre-#122 OutOfRange description.
Co-authored-by: Alberto Ramos Monagas <alberto.ramosmonagas@telefonica.com>
Updated response references for 404 and 422 errors to use common definitions.
| $ref: "#/components/schemas/CheckNumRecyclingInfo" | ||
| '400': | ||
| $ref: '#/components/responses/Generic400' | ||
| $ref: '#/components/responses/CheckNumberRecycling400' |
There was a problem hiding this comment.
Naming alignment with r4.4: other APIs name local 400 responses BadRequest400 (for example RetrieveConnectivityBadRequest400, CreateSessionBadRequest400), and the example keys follow GENERIC_400_* / 400* as in artifacts/api-templates. Here they are CheckNumberRecycling400, InvalidArgument and OutOfRange. Suggested: CheckNumberRecyclingBadRequest400, with the examples keyed accordingly (GENERIC_400_INVALID_ARGUMENT for the common one, and an 400* key for the local out-of-range example).
There was a problem hiding this comment.
Thank you for your comment. I tried to rename as you commented. Please check it.
There was a problem hiding this comment.
This PR aligns the API definition but not the test definitions (code/Test_definitions/number-recycling.feature), for example the C02 phone-number scenarios. PR #130 covers part of this. Please coordinate both PRs so they land consistently.
And also, the PR description includes Fixes #126, but that issue was already closed by PR #127. Please remove that line so merging does not close it again. If this PR is meant to track the test alignment, please link it with a plain reference (for example “Related to #126”) instead.
|
Thanks @Masa8106 and @albertoramosmonagas |
Co-authored-by: Alberto Ramos Monagas <alberto.ramosmonagas@telefonica.com>
| status: 422 | ||
| code: MISSING_IDENTIFIER | ||
| message: The phone number cannot be identified | ||
| message: Client specified an invalid range. No newline at end of file |
There was a problem hiding this comment.
The file must end with exactly one newline after the last line (Y-011). A suggestion cannot express this reliably, so please add the newline in your editor (no extra blank line at the end).
Co-authored-by: Alberto Ramos Monagas <alberto.ramosmonagas@telefonica.com>
Co-authored-by: Alberto Ramos Monagas <alberto.ramosmonagas@telefonica.com>
Co-authored-by: Alberto Ramos Monagas <alberto.ramosmonagas@telefonica.com>
|
@albertoramosmonagas, thank you for suggesting corrections. I have done them. |
|
Thanks @Masa8106. I see on the linter another warning to solve: Emit annotations: code/API_definitions/number-recycling.yaml#L1 |
What type of PR is this?
What this PR does / why we need it:
To refer common error response from Commonalities r4.4 as much as possible.
What this PR proposes to refer is:
Note that there are error response differences between existing this API specification and r4.4 common.yaml regarding the other error responses.
Which issue(s) this PR fixes:
None
Special notes for reviewers:
Related to #126
Changelog input
Additional documentation
None