Skip to content

fix: add error response examples to session-insights API#85

Merged
benhepworth merged 5 commits intocamaraproject:mainfrom
mohdfarhanakram:fix/add-error-response-examples
Apr 16, 2026
Merged

fix: add error response examples to session-insights API#85
benhepworth merged 5 commits intocamaraproject:mainfrom
mohdfarhanakram:fix/add-error-response-examples

Conversation

@mohdfarhanakram
Copy link
Copy Markdown
Contributor

What type of PR is this?

correction

What this PR does / why we need it:

Adds the missing examples section to all error response definitions in session-insights.yaml, following the pattern established in CAMARA_common.yaml (Commonalities r3.2). This was flagged as a requirement for Commonalities alignment.

  • Added allOf schema with proper status and code enums to BadRequest400, Forbidden403, NotFound404, and Conflict409 (previously using plain ErrorInfo references)
  • Added examples to all 8 error responses:
    • BadRequest400: INVALID_ARGUMENT, OUT_OF_RANGE
    • Generic401: UNAUTHENTICATED
    • Forbidden403: PERMISSION_DENIED, INVALID_TOKEN_CONTEXT
    • NotFound404: NOT_FOUND, IDENTIFIER_NOT_FOUND
    • Conflict409: ABORTED, ALREADY_EXISTS, CONFLICT
    • Generic410: GONE
    • Generic422: SERVICE_NOT_APPLICABLE, MISSING_IDENTIFIER, UNSUPPORTED_IDENTIFIER, UNNECESSARY_IDENTIFIER
    • Generic429: QUOTA_EXCEEDED, TOO_MANY_REQUESTS

Which issue(s) this PR fixes:

Fixes #71

Special notes for reviewers:

PR #84 (issue #70) also modifies BadRequest400 to add INVALID_SINK, INVALID_CREDENTIAL, and INVALID_TOKEN codes. If #84 merges first, this PR may have a minor conflict in that section -- happy to rebase and resolve.

Changelog input

Added error response examples to all error definitions following CAMARA_common.yaml r3.2 pattern. Added allOf schema with status and code enums where missing.

Additional documentation

Add examples section to all error response definitions following
the CAMARA_common.yaml r3.2 reference pattern:

- BadRequest400: INVALID_ARGUMENT, OUT_OF_RANGE
- Generic401: UNAUTHENTICATED
- Forbidden403: PERMISSION_DENIED, INVALID_TOKEN_CONTEXT
- NotFound404: NOT_FOUND, IDENTIFIER_NOT_FOUND
- Conflict409: ABORTED, ALREADY_EXISTS, CONFLICT
- Generic410: GONE
- Generic422: SERVICE_NOT_APPLICABLE, MISSING_IDENTIFIER,
  UNSUPPORTED_IDENTIFIER, UNNECESSARY_IDENTIFIER
- Generic429: QUOTA_EXCEEDED, TOO_MANY_REQUESTS
Kevsy
Kevsy previously approved these changes Apr 7, 2026
Copy link
Copy Markdown
Contributor

@Kevsy Kevsy left a comment

Choose a reason for hiding this comment

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

Thanks @mohdfarhanakram - LGTM

Copy link
Copy Markdown
Contributor

@benhepworth benhepworth left a comment

Choose a reason for hiding this comment

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

looks good @mohdfarhanakram - thanks for putting this PR in! One minor thing - the Out of Range is a QoD thing (probably copied from it's error responses/examples). I suggested removing it. This will now conflict with PR 84, but we can hash that out when merging.

Comment thread code/API_definitions/session-insights.yaml
Comment thread code/API_definitions/session-insights.yaml
Co-authored-by: Ben Hepworth <125334035+benhepworth@users.noreply.github.com>
Co-authored-by: Ben Hepworth <125334035+benhepworth@users.noreply.github.com>
@mohdfarhanakram
Copy link
Copy Markdown
Contributor Author

Thanks @benhepworth for catching that you are right, OUT_OF_RANGE is QoD-specific and doesn't belong here. Applied both suggestions.

@benhepworth benhepworth self-requested a review April 16, 2026 03:45
Copy link
Copy Markdown
Contributor

@benhepworth benhepworth left a comment

Choose a reason for hiding this comment

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

merge conflict resolved - looks good now

@benhepworth benhepworth merged commit 1410318 into camaraproject:main Apr 16, 2026
3 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.

Add error response examples to API YAML

3 participants