Skip to content

fix: comment out placeholders in CAMARA_common.yaml for $ref consumption#602

Open
hdamker wants to merge 1 commit intocamaraproject:mainfrom
hdamker:fix/comment-out-placeholders
Open

fix: comment out placeholders in CAMARA_common.yaml for $ref consumption#602
hdamker wants to merge 1 commit intocamaraproject:mainfrom
hdamker:fix/comment-out-placeholders

Conversation

@hdamker
Copy link
Collaborator

@hdamker hdamker commented Mar 18, 2026

What type of PR is this?

  • correction

What this PR does / why we need it:

Comments out {{SPECIFIC_CODE}} and {{field}} placeholder patterns in Generic error responses (400, 403, 404, 409, 422) of CAMARA_common.yaml. The commented lines remain as human-readable documentation for API developers, while the file becomes directly consumable via $ref by bundling tools, Spectral, and YAML parsers.

This unblocks $ref-based consumption of common schemas as discussed in #577 and the bundling design in ReleaseManagement#436.

Three types of placeholder occurrences are commented out:

  1. Enum values- "{{SPECIFIC_CODE}}" in code enums (5 responses)
  2. Example blocksGENERIC_4xx_{{SPECIFIC_CODE}}: entries with their value blocks (5 responses)
  3. Example message"{{field}} is not consistent with access token." (1 occurrence in Generic403)

Which issue(s) this PR fixes:

Fixes #601

Does this PR introduce a breaking change?

  • Yes
  • No

Special notes for reviewers:

  • YAML validation and Spectral linting pass cleanly (0 errors, only pre-existing unused-component warnings)
  • 38 lines changed, line count preserved (comment prefix added, no lines deleted)
  • API-specific error code extension patterns (allOf, property override, etc.) are a separate topic (Establish guidance for consuming schemas from CAMARA_common.yaml #577)
  • Thanks and credits to @rartych for the idea and testing it in a PoC

Changelog input

fix: comment out placeholder patterns in CAMARA_common.yaml to enable $ref consumption

Additional documentation

Related design: ReleaseManagement#436 (section 8.1)

Comment out {{SPECIFIC_CODE}} and {{field}} placeholder patterns in
Generic error responses (400, 403, 404, 409, 422). Commented lines
remain as documentation for API developers. The file becomes directly
consumable via $ref by bundling tools, Spectral, and YAML parsers.

Fixes camaraproject#601
Copy link
Contributor

@PedroDiez PedroDiez left a comment

Choose a reason for hiding this comment

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

LGTM

@rartych
Copy link
Contributor

rartych commented Mar 20, 2026

If we want to use yamllint for artifacts (for now no linting is implemented in Commonalities) then we need to consider that
the implementation of comments-indentation rule in yamllint is buggy:

  326:13    error    comment not indented like content  (comments-indentation)
  391:13    error    comment not indented like content  (comments-indentation)
  430:13    error    comment not indented like content  (comments-indentation)
  537:13    error    comment not indented like content  (comments-indentation)
  665:13    error    comment not indented like content  (comments-indentation)

https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.comments_indentation

The quick fixes are:

  • to start each comment line # with the same indentation as the line above the comment (line 325 in the first case)
                message: Client specified an invalid range.
                # GENERIC_400_{{SPECIFIC_CODE}}:
                #   description: Specific Syntax Exception regarding a field that is relevant in the context of the API
                #   value:
                #     status: 400
                #     code: "{{SPECIFIC_CODE}}"
                #     message: Message for specific code
  • or disable the rule by adding comment :
# yamllint disable rule:comments-indentation

https://yamllint.readthedocs.io/en/stable/disable_with_comments.html#disabling-checks-for-all-or-part-of-the-file

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.

Comment out placeholders in CAMARA_common.yaml for $ref consumption

3 participants