Skip to content

Establish guidance for consuming schemas from CAMARA_common.yaml #577

@clundie-CL

Description

@clundie-CL

Problem description

Section 2.1 of the CAMARA API Design Guide designates CAMARA_common.yaml as "an external repository" for common data types but provides no specification for how APIs should consume these schemas. This gap has led to inconsistent practices across CAMARA API families:

  • Most APIs copy/paste schema definitions directly into their OpenAPI spec files
  • Provenance is lost: No way to determine which Commonalities release tag the schemas originated from
  • Version ambiguity: APIs declaring x-camara-commonalities: 0.6 could be using schemas from r3.1, r3.2, r3.3, or r3.4 (all share the same guidelines version but have different schema artifact versions)
  • Maintenance burden: Schema improvements in Commonalities must be manually propagated to every API

Concrete example: In r3.4, the ErrorInfo schema properties order was fixed to align with the API Design Guide. APIs that copy/pasted ErrorInfo from earlier releases would have incorrect property ordering unless they manually tracked and re-copied the updated schema. The change was minor, but merely reflects maintenance burden required to state up to date the latest rX.Y release for a given x-camara-commonalities version.

Expected action

  1. Document a standard approach in Section 2.1 of the API Design Guide for consuming schemas from CAMARA_common.yaml

  2. Evaluate technical approaches for schema consumption (with community input):

    • Bundling approach (embed versioned CAMARA_common.yaml, use $ref, bundle with tools like redocly cli) - as used by Network Access Management API
    • Git submodules (pin Commonalities repo at specific tag)
    • URL-based $ref (reference GitHub raw URLs with tagged releases)
    • Package registry (publish schemas as versioned artifacts)
    • Other approaches suggested by the community
  3. Add traceability guidance: Specify how APIs should indicate which Commonalities schema artifact version they're using (beyond just x-camara-commonalities guidelines version)

Evaluation criteria for approaches:

  • Traceability: Can we determine which Commonalities release tag an API's schemas originated from?
  • Maintainability: How easy is it to update to newer Commonalities schemas?
  • Contributor Experience: Does it create barriers for new contributors?
  • Tooling Compatibility: Does it work with standard OpenAPI tools (Swagger UI, Redocly, etc.)?
  • CI/CD Integration: Can validation and bundling be automated?

Additional context

Related example: OptimalEdgeDiscovery API (issue #25) recently needed geographic area schemas (Area, Circle, Polygon, etc.) from CAMARA_common.yaml. Without established guidance, these were copy/pasted, creating immediate technical debt.

Versioning complexity: Between r3.1 and r3.4, x-camara-commonalities remained 0.6 while schema artifact versions evolved 0.6.10.7.1. APIs can't reliably communicate which schema versions they're using.

Related work: Issue #556 discusses bundling/dereferencing tools for CAMARA APIs, which aligns with some approaches being considered here.

Broader applicability: Establishing a bundling pattern for Commonalities consumption would also benefit:

  • Large APIs: Breaking monolithic specs into templates + reusable domain-specific schemas (reducing contributor friction, minimizing merge conflicts)
  • API families: Cross-repo schema sharing (e.g., EdgeCloudZone schema currently duplicated across EdgeCloud family repos, requiring manual propagation of changes)

Reference documents:

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions