-
Notifications
You must be signed in to change notification settings - Fork 35
fix: restructure artifacts directory for $ref consumption #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rartych
merged 18 commits into
camaraproject:main
from
hdamker:fix/restructure-artifacts-v2
Apr 13, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8227362
fix: restructure artifacts directory for $ref consumption (#603)
hdamker b674663
Merge remote-tracking branch 'upstream/main' into fix/restructure-art…
hdamker 21bfac9
fix: Phase 2 — event and subscription schemas restructured for $ref c…
hdamker 7494d0c
fix: update stale template reference in feature file comment
hdamker 914522e
fix: address review feedback and Design Guide compliance
hdamker 7ca2f60
fix: remove trailing blank line in sample-service-subscriptions.yaml
hdamker f1fe513
fix: comment out non-HTTP protocol support (not yet used in CAMARA)
hdamker 0061276
fix: move notificationsBearerAuth security scheme to CAMARA_event_com…
hdamker 267cd79
fix: comment out PLAIN sink credential (not used in CAMARA)
hdamker b90fb99
Apply suggestion from @hdamker - remove sinkCredential from response
hdamker f3e6a19
Apply suggestions from code review, with minor corrections
hdamker aa9cad9
fix: revert $ref additions to TimePeriod startDate/endDate
hdamker 9bbd0bf
fix: simplify TimePeriod to use $ref to DateTime schema
hdamker 71f439a
fix: replace api-name placeholders with sample-service-subscriptions
hdamker 1d702d2
fix: add 400 error responses to sample-service template operations
hdamker 845e53a
Merge remote-tracking branch 'upstream/main' into fix/restructure-art…
hdamker 58a0902
fix: address review comments and update Event Guide artifact paths
hdamker 7fa2cc3
Update documentation/CAMARA-API-Event-Subscription-and-Notification-G…
hdamker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
612 changes: 612 additions & 0 deletions
612
artifacts/api-templates/sample-service-subscriptions.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,245 @@ | ||
| openapi: 3.0.3 | ||
| info: | ||
| title: Sample Service | ||
| description: | | ||
| Template for a request-response CAMARA API. | ||
|
|
||
| Copy this file to your API repository's `code/API_definitions/` directory | ||
| and adapt it to your API's resources and operations. | ||
|
|
||
| This template demonstrates: | ||
| - `$ref` to `../common/CAMARA_common.yaml` for shared schemas, error responses, | ||
| parameters, headers, and security schemes | ||
| - Two options 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 | ||
| license: | ||
| name: Apache 2.0 | ||
| url: https://www.apache.org/licenses/LICENSE-2.0.html | ||
| version: wip | ||
| x-camara-commonalities: 0.7.0 | ||
| externalDocs: | ||
| description: Product documentation at CAMARA | ||
| url: https://github.com/camaraproject/{apiRepository} | ||
| # {apiRepository} MUST be replaced by the CAMARA API Repository name where the API specification is hosted. | ||
| servers: | ||
| - url: "{apiRoot}/sample-service/vwip" | ||
| variables: | ||
| apiRoot: | ||
| default: http://localhost:9091 | ||
| description: API root, defined by the service provider, e.g. `api.example.com` or `api.example.com/somepath` | ||
| tags: | ||
| - name: Resources | ||
| description: Operations on sample resources | ||
| security: | ||
| - openId: | ||
| - sample-service:resource:read | ||
| - sample-service:resource:write | ||
| paths: | ||
| /resources: | ||
| post: | ||
| tags: | ||
| - Resources | ||
| summary: Create a resource | ||
| description: Creates a new resource with the provided properties. | ||
| operationId: createResource | ||
| parameters: | ||
| - $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator" | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/CreateResource" | ||
| responses: | ||
| "201": | ||
| description: Resource created | ||
| headers: | ||
| x-correlator: | ||
| $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Resource" | ||
| "400": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" | ||
| "401": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" | ||
| "403": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" | ||
| "409": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic409" | ||
| "422": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic422" | ||
| "429": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic429" | ||
| "500": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" | ||
| get: | ||
| tags: | ||
| - Resources | ||
| summary: List resources | ||
| description: Returns a list of all resources accessible to the API consumer. | ||
| operationId: listResources | ||
| parameters: | ||
| - $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator" | ||
| responses: | ||
| "200": | ||
| description: List of resources | ||
| headers: | ||
| x-correlator: | ||
| $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: array | ||
|
rartych marked this conversation as resolved.
|
||
| minItems: 0 | ||
| maxItems: 1000 | ||
| items: | ||
| $ref: "#/components/schemas/Resource" | ||
| "400": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" | ||
| "401": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" | ||
| "403": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" | ||
| "500": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" | ||
| /resources/{resourceId}: | ||
| get: | ||
| tags: | ||
| - Resources | ||
| summary: Get a resource by ID | ||
| description: Returns the details of a specific resource identified by its ID. | ||
| operationId: getResource | ||
| parameters: | ||
| - $ref: "#/components/parameters/ResourceId" | ||
| - $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator" | ||
| responses: | ||
| "200": | ||
| description: Resource details | ||
| headers: | ||
| x-correlator: | ||
| $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Resource" | ||
| "400": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" | ||
| "401": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" | ||
| "403": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" | ||
| # Option A — pure $ref for responses using only generic error codes | ||
| "404": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" | ||
| "500": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" | ||
| delete: | ||
| tags: | ||
| - Resources | ||
| summary: Delete a resource | ||
| description: Deletes a specific resource identified by its ID. | ||
| operationId: deleteResource | ||
| parameters: | ||
| - $ref: "#/components/parameters/ResourceId" | ||
| - $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator" | ||
| responses: | ||
| "204": | ||
| description: Resource deleted | ||
| headers: | ||
| x-correlator: | ||
| $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" | ||
| "400": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" | ||
| "401": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" | ||
| "403": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" | ||
| # Option B — local response extending generic errors with API-specific codes | ||
| "404": | ||
| $ref: "#/components/responses/ResourceNotFound404" | ||
| "500": | ||
| $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" | ||
| components: | ||
| securitySchemes: | ||
| openId: | ||
| $ref: "../common/CAMARA_common.yaml#/components/securitySchemes/openId" | ||
| responses: | ||
| # Option B example: API-specific error response extending generic error codes. | ||
| # Use this pattern when an operation needs API-specific error codes in addition | ||
| # to the generic ones defined in CAMARA_common.yaml. | ||
| ResourceNotFound404: | ||
| description: Resource not found | ||
| headers: | ||
| x-correlator: | ||
| $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| allOf: | ||
| - $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo" | ||
| - type: object | ||
| properties: | ||
| status: | ||
| enum: | ||
| - 404 | ||
| code: | ||
| enum: | ||
| - NOT_FOUND | ||
| - IDENTIFIER_NOT_FOUND | ||
| examples: | ||
| GENERIC_404_NOT_FOUND: | ||
| description: The specified resource was not found | ||
| value: | ||
| status: 404 | ||
| code: NOT_FOUND | ||
| message: The specified resource is not found. | ||
| RESOURCE_404_IDENTIFIER_NOT_FOUND: | ||
| description: API-specific — some identifier cannot be matched to a resource | ||
| value: | ||
| status: 404 | ||
| code: IDENTIFIER_NOT_FOUND | ||
| message: Some of the provided identifiers are not found. | ||
| parameters: | ||
| ResourceId: | ||
| name: resourceId | ||
| in: path | ||
| required: true | ||
| description: Identifier of the resource to operate on | ||
| schema: | ||
| $ref: "#/components/schemas/ResourceId" | ||
| schemas: | ||
| ResourceId: | ||
| type: string | ||
| format: uuid | ||
|
rartych marked this conversation as resolved.
|
||
| maxLength: 36 | ||
| description: Unique identifier for the resource | ||
| CreateResource: | ||
| description: Properties for creating a new resource | ||
| type: object | ||
| required: | ||
| - name | ||
| properties: | ||
| name: | ||
| type: string | ||
| maxLength: 128 | ||
| description: Human-readable name for the resource | ||
| device: | ||
| $ref: "../common/CAMARA_common.yaml#/components/schemas/Device" | ||
| Resource: | ||
| description: A resource managed by the API | ||
| type: object | ||
| required: | ||
| - resourceId | ||
| - name | ||
| properties: | ||
| resourceId: | ||
| $ref: "#/components/schemas/ResourceId" | ||
| name: | ||
| type: string | ||
| maxLength: 128 | ||
| description: Human-readable name for the resource | ||
| device: | ||
| $ref: "../common/CAMARA_common.yaml#/components/schemas/Device" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.