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
- Add a
components/examples section to CAMARA_common.yaml and move all GENERIC_xxx_CODE example objects to this section.
- 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.
- The
Generic4xx response objects can be relocated to API template artifacts for better clarity.
Alternative solution
- 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).
- 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.
Problem description
As indicated in #662 directly referencing error responses from
CAMARA_common.yamlcan result in incorrect defnitions within API specifications. Initially, theCAMARA_common.yamlfile was intended to serve as a source for copying text chunks rather than providing fully usable schema definitions for errors.Each
Generic4xxresponse object inCAMARA_common.yamlcurrently bundles two distinct components:allOfwith status/code enums. These schemas often need to be API-specific (individual APIs extend the enums for specific codes and exlude irrelevant codes).To avoid inconsistencies any response with API-customizable codes can not be
$ref'ed toCAMARA_common.yamlresponse.Expected behavior
components/examplessection toCAMARA_common.yamland move allGENERIC_xxx_CODEexample objects to this section.ErrorInfoschema and cherry-pick reusable examples via$ref. API-specific examples may be added locally.Generic4xxresponse objects can be relocated to API template artifacts for better clarity.Alternative solution
components/examplessection toCAMARA_common.yamland move allGENERIC_xxx_CODEexample objects to this section (similar to the expected behavior p.1 and 2).CAMARA_common.yamlto be referenced directly.Additional context
Current API templates artifacts may need to be updated to follow the choosen solution.