Skip to content

Error responses in CAMARA_common.yaml have limited reusability #663

Description

@rartych

Problem description
As indicated in #662 directly referencing error responses from CAMARA_common.yaml can result in incorrect defnitions within API specifications. Initially, the CAMARA_common.yaml file was intended to serve as a source for copying text chunks rather than providing fully usable schema definitions for errors.

Each Generic4xx response object in CAMARA_common.yaml currently bundles two distinct components:

  • Schema: Contains allOf with status/code enums. These schemas often need to be API-specific (individual APIs extend the enums for specific codes and exlude irrelevant codes).
  • Examples: Provides illustrative static values for each error code. These examples are invariant across all APIs that utilize the corresponding error codes.

To avoid inconsistencies any response with API-customizable codes can not be $ref'ed to CAMARA_common.yaml response.

Expected behavior

  1. Add a components/examples section to CAMARA_common.yaml and move all GENERIC_xxx_CODE example objects to this section.
  2. API specifications should define their full local response structure based on ErrorInfo schema and cherry-pick reusable examples via $ref. API-specific examples may be added locally.
  3. The Generic4xx response objects can be relocated to API template artifacts for better clarity.

Alternative solution

  1. Add a components/examples section to CAMARA_common.yaml and move all GENERIC_xxx_CODE example objects to this section (similar to the expected behavior p.1 and 2).
  2. Split response components based on invariance:
    • Keep fully-reusable, most common ones in CAMARA_common.yaml to be referenced directly.
    • Relocate variable, API-specific response templates to API template artifacts for customization.

Additional context
Current API templates artifacts may need to be updated to follow the choosen solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctioncorrection in documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions