Skip to content

Fix HTTP status codes to match Design Guide semantics (#48) - #56

Merged
JoseMConde merged 2 commits into
camaraproject:mainfrom
DLondonoD:fix/issue-48
Jul 29, 2026
Merged

Fix HTTP status codes to match Design Guide semantics (#48)#56
JoseMConde merged 2 commits into
camaraproject:mainfrom
DLondonoD:fix/issue-48

Conversation

@DLondonoD

Copy link
Copy Markdown
Contributor

What type of PR is this?

correction

What this PR does / why we need it:

Aligns three error-code choices in the EAM API with the semantics defined
in the CAMARA API Design Guide (section 3.2.1):

  • deleteApp (DELETE /apps/{appId}): changes the 409 code from
    ABORTED to INCOMPATIBLE_STATE. ABORTED is defined for
    concurrent-modification conflicts, but this case — a delete blocked
    because a referenced running instance still exists — matches
    INCOMPATIBLE_STATE instead.
  • /deployments CRUD operations: removes 410 GONE from
    getAppDeployments (GET), deleteAppDeployment (DELETE) and
    updateAppDeployment (PATCH). The Design Guide and this API's own
    Generic410 response template scope 410 to the notification/callback
    flow only (correctly used by onAppInstanceStatusChange and
    onAppDeploymentStatusChange, left untouched). GET /deployments now
    uses 404 for the no-match case (previously had neither); DELETE/PATCH
    already declared 404, so the redundant 410 was simply dropped.
  • submitApp, createAppInstance, createAppDeployment: removes
    501 NOT_IMPLEMENTED. The Design Guide says 501 usage should be
    avoided and reserved for genuinely optional endpoints; none of these
    three creation operations state a justification for being optional.

Which issue(s) this PR fixes:

Fixes #48

Special notes for reviewers:

No runtime/behavioral change — this only corrects which error codes are
documented in the spec to align with the Design Guide's standardized
error-response semantics. Callback 410 usage (notification flow) was
intentionally left as-is since it already matches the Guide.

Changelog input

release-note Fix deleteApp 409 code (ABORTED to INCOMPATIBLE_STATE), remove 410 from plain /deployments CRUD operations,
and remove unjustified 501 from creation operations, per Design Guide error-response semantics.

Additional documentation

This section can be blank.

docs

JoseMConde
JoseMConde previously approved these changes Jul 27, 2026

@JoseMConde JoseMConde 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.

LGTM

Comment on lines +717 to +720
"403":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic403"
"410":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic410"
"404":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic404"

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.

The 200 above documents an empty list for the no-match case, so a 404 here contradicts it. Every other 404 in this file is on a by-id operation, and #58 adds GET /deployments/{appDeploymentId} where it is unambiguous. Suggest dropping it and keeping the 410 removal.

Suggested change
"403":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic403"
"410":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic410"
"404":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic404"
"403":
$ref: "../common/CAMARA_common.yaml#/components/responses/Generic403"

GET /deployments is a collection endpoint whose 200 response already
documents an empty list for the no-match case, so adding 404
contradicted it. 404 remains appropriate only for by-id lookups.

Addresses review comment from @seralogar on PR camaraproject#56.
@JoseMConde
JoseMConde merged commit 5243c99 into camaraproject:main Jul 29, 2026
2 checks passed
DLondonoD added a commit to DLondonoD/EdgeApplicationManagement that referenced this pull request Jul 29, 2026
getAppDeployments, deleteAppDeployment and updateAppDeployment no
longer document 410 in the spec since the fix in camaraproject#48/camaraproject#56 (410 is now
scoped to the notification/callback flow only). These 3 .feature
files still had leftover '410 GONE' scenarios asserting a response
code the operations never return.
DLondonoD added a commit to DLondonoD/EdgeApplicationManagement that referenced this pull request Jul 31, 2026
Commit 725880e applied seralogar's suggestion to change deleteApp's
409 $.code from ABORTED to INCOMPATIBLE_STATE (per camaraproject#56, ABORTED is
now only correct for updateAppDeployment's 409), but the scenario tag
was not part of that suggestion diff. Renaming
@eam_deleteApp_409.1_aborted -> @eam_deleteApp_409.1_incompatible_state
to match, as also requested in the same review comment.
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.

409/410/501 codes don't match Design Guide semantics

3 participants