Skip to content

Upgrade API definitions to Commonalities r4.4 (#188) - #194

Merged
tlohmar merged 1 commit into
camaraproject:mainfrom
jimfengjinhua:upgrade-commonalities-r4.4
Oct 7, 2026
Merged

tlohmar merged 1 commit into
camaraproject:mainfrom
jimfengjinhua:upgrade-commonalities-r4.4

Conversation

@jimfengjinhua

Copy link
Copy Markdown
Contributor

Align the four API definitions with Commonalities r4.4 (0.9.0), whose common files were synced in #191.

What type of PR is this?

Add one of the following kinds:

  • enhancement/feature
  • tests

What this PR does / why we need it:

  • Bump info.x-camara-commonalities to 0.9 and apply the reworded "Additional CAMARA error responses" info.description template.
  • Replace the deprecated Generic* error responses per operation with the r4.4 catalogue: BadRequest400, BadRequestWithRange400, NotFound404, Unauthenticated401 and PermissionDenied403, and SinkGone410 on the callbacks. This also drops INVALID_TOKEN_CONTEXT, which r4.4 removed from 403.
  • List operations use BadRequest400, as invalid page/perPage values return 400 INVALID_ARGUMENT (Design Guide 4.1).
  • Keep local responses only where the catalogue does not fit: a 400 on POST /networks and POST /accesses that adds the sink-related codes INVALID_CREDENTIAL, INVALID_TOKEN and INVALID_SINK, the DEDICATED_NETWORK.* 404 codes on POST /networks, a 404 DEDICATED_NETWORK_ACCESSES.NETWORK_IDENTIFIER_NOT_FOUND on POST /accesses, and narrowed 409s on POST /accesses (INCOMPATIBLE_STATE) and the add/remove devices operations (ABORTED, INCOMPATIBLE_STATE).
  • Example labels: use the API prefix for locally defined examples, keep GENERIC_ for references to common examples, and define the shared 409 INCOMPATIBLE_STATE example once.
  • Replace the two inline sink definitions with the common Sink schema.
  • Test definitions: add createAccess_404.01_networkid_not_found, and make the pagination scenarios of listNetworks, readNetworkProfiles and retrieveNetworkServiceAreas expect INVALID_ARGUMENT, renaming their tags from *_out_of_range_pagination to *_invalid_pagination.

Which issue(s) this PR fixes:

Fixes #188

Special notes for reviewers:

Changelog input

 release-note

Additional documentation

This section can be blank.

docs

Align the four API definitions with Commonalities r4.4 (0.9.0), whose
common files were synced in camaraproject#191.

- Bump info.x-camara-commonalities to 0.9 and apply the reworded
  "Additional CAMARA error responses" info.description template.
- Replace the deprecated Generic* error responses per operation with the
  r4.4 catalogue: BadRequest400, BadRequestWithRange400, NotFound404,
  Unauthenticated401 and PermissionDenied403, and SinkGone410 on the
  callbacks. This also drops INVALID_TOKEN_CONTEXT, which r4.4 removed
  from 403.
- List operations use BadRequest400, as invalid page/perPage values
  return 400 INVALID_ARGUMENT (Design Guide 4.1).
- Keep local responses only where the catalogue does not fit: a 400 on
  POST /networks and POST /accesses that adds the sink-related codes
  INVALID_CREDENTIAL, INVALID_TOKEN and INVALID_SINK, the
  DEDICATED_NETWORK.* 404 codes on POST /networks, a 404
  DEDICATED_NETWORK_ACCESSES.NETWORK_IDENTIFIER_NOT_FOUND on
  POST /accesses, and narrowed 409s on POST /accesses (INCOMPATIBLE_STATE)
  and the add/remove devices operations (ABORTED, INCOMPATIBLE_STATE).
- Example labels: use the API prefix for locally defined examples, keep
  GENERIC_ for references to common examples, and define the shared 409
  INCOMPATIBLE_STATE example once.
- Replace the two inline sink definitions with the common Sink schema.
- Test definitions: add createAccess_404.01_networkid_not_found, and make
  the pagination scenarios of listNetworks, readNetworkProfiles and
  retrieveNetworkServiceAreas expect INVALID_ARGUMENT, renaming their
  tags from *_out_of_range_pagination to *_invalid_pagination.
value:
status: 409
code: INCOMPATIBLE_STATE
message: A referenced resource is in an incompatible state.

@tlohmar tlohmar Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, this message text is more generic than the generic error examples in Commonalities. I create an Issue in Commonalities, that the message in the example should not list state names explicitly.

@tlohmar tlohmar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good as base for followup work

@tlohmar
tlohmar merged commit 2556842 into camaraproject:main Oct 7, 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.

Upgrading to Commonalities r4.4

2 participants