Skip to content

fix: restructure artifacts directory for $ref consumption#606

Draft
hdamker wants to merge 1 commit intocamaraproject:mainfrom
hdamker:fix/restructure-artifacts-v2
Draft

fix: restructure artifacts directory for $ref consumption#606
hdamker wants to merge 1 commit intocamaraproject:mainfrom
hdamker:fix/restructure-artifacts-v2

Conversation

@hdamker
Copy link
Copy Markdown
Collaborator

@hdamker hdamker commented Mar 30, 2026

What type of PR is this?

  • enhancement/feature

What this PR does / why we need it:

Phase 1 of artifacts directory restructuring (#603).

Establishes the common/ and api-templates/ directory structure so that $ref paths in templates are identical to those in API repositories:

  • Moves CAMARA_common.yaml to artifacts/common/CAMARA_common.yaml
  • Adds artifacts/api-templates/sample-service.yaml — a request-response CRUD template demonstrating $ref consumption of common schemas, error responses, parameters, headers, and security schemes

The sample-service template demonstrates two patterns for error responses:

  • Option A (pure $ref): For responses using only generic error codes — e.g., $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404"
  • Option B (local definition): For responses extending generic errors with API-specific codes — e.g., ResourceNotFound404 with IDENTIFIER_NOT_FOUND alongside generic NOT_FOUND

Which issue(s) this PR fixes:

Fixes #603 (phase 1)

Does this PR introduce a breaking change?

  • Yes
  • No

Special notes for reviewers:

Phase 2 (after #604 merges):

  • Add common/CAMARA_event_common.yaml with CloudEvent/Source/DateTime schemas
  • Add notification templates replacing notification-as-cloud-event.yaml
  • Add event-related API templates
  • Migrate camara-cloudevents/ content to new structure

Validation results (0 errors):

Redocly bundle resolves all $ref successfully:

bundling artifacts/api-templates/sample-service.yaml...
📦 Created a bundle for artifacts/api-templates/sample-service.yaml at /tmp/bundled-sample.yaml 20ms.

Spectral lint (1 pre-existing warning from CAMARA_common.yaml openId):

 153:12  warning  camara-properties-descriptions  Property description is missing or empty:
         "openId.description" property must be truthy  components.securitySchemes.openId

✖ 1 problem (0 errors, 1 warning, 0 infos, 0 hints)

Changelog input

 release-note
fix: restructure artifacts directory — move CAMARA_common.yaml to common/, add sample-service.yaml API template with $ref consumption

Additional documentation

docs
Updated references to CAMARA_common.yaml path in README.md and CAMARA-API-Design-Guide.md

…ect#603)

Phase 1 of artifacts restructuring:
- Move CAMARA_common.yaml to artifacts/common/ directory
- Add api-templates/sample-service.yaml demonstrating $ref consumption
- Update documentation references to new path

The sample-service template demonstrates two patterns for error responses:
- Option A: pure $ref for responses using only generic error codes
- Option B: local response definition extending generic errors with
  API-specific codes (ResourceNotFound404 example)

Next steps (after camaraproject#604 merges):
- Add CAMARA_event_common.yaml with CloudEvent/Source/DateTime schemas
- Add notification-templates/sample-notification.yaml
- Add event-related API templates (implicit events, subscriptions)
- Migrate camara-cloudevents/ content to new structure
@hdamker hdamker marked this pull request as draft March 30, 2026 18:46
@hdamker
Copy link
Copy Markdown
Collaborator Author

hdamker commented Mar 30, 2026

Converted to draft as I have discussed with @rartych to add also the restructure of event related artifacts after
#604 is merged. Plan is to do that tomorrow.

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.

Restructure artifacts directory for $ref consumption and bundling

1 participant