Skip to content

CycloneDX 2.0 - Auto-Generate .proto Schema from JSON Schema in 2.0 #640

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

Open
stevespringett opened this issue May 6, 2025 · 0 comments

Comments

@stevespringett
Copy link
Member

Problem

In CycloneDX 1.x, the .proto schema for Protocol Buffers is manually maintained. This has led to:

  • Inconsistencies between the .proto definitions and the canonical JSON Schema
  • Increased maintenance overhead

As the JSON Schema is the authoritative source of truth, maintaining .proto files separately introduces unnecessary risk and manual effort.


Goal for 2.0

Automate the generation of the CycloneDX .proto schema directly from the JSON Schema.

This will ensure:

  • The .proto schema is always in sync with the JSON Schema
  • Manual maintenance is eliminated
  • Future changes to the data model propagate consistently across formats

Proposal

  • Build or adopt a tooling pipeline that transforms the JSON Schema into .proto
  • Apply CycloneDX-specific naming conventions (e.g. AGGREGATE_COMPLETE, NOT_SPECIFIED)
  • Generate comments and field metadata from the JSON Schema description and meta:enum entries
  • Validate output to ensure it meets current Protobuf compatibility and API expectations
  • Ensure enum ordering remains consistent from release-to-release

🔧 Benefits

  • Accuracy: Guaranteed alignment between .proto and JSON Schema
  • Efficiency: No manual work to maintain parallel definitions
  • Maintainability: Lower barrier to support future schema changes and extensions
  • Tooling Harmony: Protobuf-based consumers stay aligned with core model evolution

🧠 Related Topics

  • [#1662] Automate GraphQL schema generation
  • [#1489] Consolidate schema format pipelines
  • [#1724] Use JSON Schema as single source of truth for all serializations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant