[Accesses API] Small corrections in the API definition #152
Description
Problem description
Three unrelated small items in code/API_definitions/dedicated-network-accesses.yaml.
1. The API-specific error code has the wrong prefix. The code is
DEDICATED_NETWORK_ACCESS.NO_VALID_DEVICE, in the singular, while the base path of this API is
dedicated-network-accesses:
servers:
- url: "{apiRoot}/dedicated-network-accesses/vwip"so its codes should be prefixed DEDICATED_NETWORK_ACCESSES. The current prefix appears three times:
in the code enum of the 422 response, in the name of the example
DEDICATED_NETWORK_ACCESS_422_NO_VALID_DEVICE, and in that example's code value.
2. The Location header schema has no uri format. On POST /accesses it is declared as:
Location:
description: 'URL including the resource identifier of the newly created network access.'
required: true
schema:
type: string
maxLength: 2048createNetwork in code/API_definitions/dedicated-network.yaml declares the same header with
format: uri as well. Without it, a value that is not a URL is valid against the Accesses
specification even though the description says it is one. There is nothing to reference from the
common files — CAMARA_common.yaml defines x-correlator, x-total-count, x-total-pages and
link under components/headers, but no Location.
3. Two code fields are free strings. ResultForDevice.code carries the per-device outcome and
ReasonInfo.code the reason for a status change; both are type: string, maxLength: 96 with no set of
values. A consumer acting on ResultForDevice.code cannot tell what it may contain — the examples use
IDENTIFIER_NOT_FOUND and CONFLICT, and the neighbouring status description mentions 429, but
none of those is in the schema. For ReasonInfo.code a set does exist, but only where
DeviceStatusInfo narrows it to REQUEST_APPROVED, REQUEST_REJECTED, REQUEST_FAILED,
ACCESS_REVOKED and ACCESS_FAILED, so any other use of ReasonInfo would carry none. Both are
reported by CAMARA Validation on the r2.2 release-review pull request as hint S-313.
Expected behavior
- Rename the error code to
DEDICATED_NETWORK_ACCESSES.NO_VALID_DEVICEin all three places. - Add
format: urito theLocationheader schema, matchingdedicated-network.yaml. - Give
ResultForDevice.codean enum of the codes the API can return, and consider moving
ReasonInfo's set of values onto the base schema so it holds whereverReasonInfois used.
Activity
hubertp-ericsson commentedon Aug 26, 2026
Thanks for a great review, very appreciated!
Addressing individual points:
Re 1 & 2 - Agree, to be fixed.
Re 3 - Agree on ResultForDevice.code - will define specific codes; ReasonInfo is generic and is inherited by DeviceStatusInfo where code enum is defined - suggest to keep it as is since only DeviceStatusInfo is returned by the API.