chore: Automate data model generation from upcoming CycloneDX 2.0 machine-readable specification
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- json, typescript
- 領域
- build-system, tooling
調査の方向性
CycloneDX 2.0 のモジュール化された JSON schemas から始め、issue で言及されている既存の proof-of-concept 実装を確認します。schema references と composition をどのように扱うべきかを評価し、その後 generation および build workflow を定義します。完了条件は、決定論的な TypeScript models が build time より前に生成され、repository に commit されていることです。
索引モデルが issue の本文から書いたものです。
説明
Description
The current data models in this library are primarily handwritten and manually maintained. While functional, this approach introduces significant overhead in terms of development effort, code review, and long-term maintenance.
With the introduction of CycloneDX 2.0, the specification is evolving toward a modularized, machine-readable schema architecture. This creates an opportunity to fundamentally shift how data models are produced in this project: from manual implementation to schema-driven code generation.
This issue proposes aligning the library with that direction by adopting automated model generation based on the CycloneDX 2.0 modular JSON schemas.
Reference (work in progress):
- Python library discussion: https://github.com/CycloneDX/cyclonedx-python-lib/issues
- CycloneDX 2.0 modular schemas: https://github.com/CycloneDX/specification/tree/2.0-dev/schema/2.0/model
Problem
- Data models are manually implemented and maintained
- High maintenance and review overhead
- Repetitive and error-prone contributor work
- Slower adoption of specification updates
- Risk of inconsistencies with the official specification
Proposal
Introduce a schema-driven model generation pipeline based on the CycloneDX 2.0 modular JSON schemas.
Key aspects:
- Use the official modular schema definitions as the single source of truth
- Automatically generate JavaScript/TypeScript data models from these schemas
- Support the modular structure (i.e., multiple interdependent schema files)
- Integrate generation into the build and/or release workflow
- Ensure generated models remain aligned with upstream specification changes
This would replace most handwritten models with deterministically generated code, reducing manual effort and improving consistency.
Existing proof-of-concept implementations have already demonstrated feasibility. These should be revisited and consolidated into a production-ready approach.
Pipeline:
CycloneDX JSON Schema
↓
Preprocessing (if needed)
↓
Code Generation (datamodel-code-generator)
↓
Post-processing (formatting, adjustments)
↓
Generated Python Models
Possible Tools / Libraries
The following tools may be evaluated for compatibility with modular JSON Schema processing and TypeScript generation:
-
quicktype (Apache 2.0)
Generates TypeScript models from JSON Schema and other inputs -
json-schema-to-typescript (MIT)
Strong support for JSON Schema → TS interfaces (including unions and enums) -
typebox (MIT)
Schema-first approach with runtime validation and static typing -
ajv + tooling (MIT)
Useful for schema validation and potential type generation workflows -
Custom generator layer (optional)
May be required to properly resolve CycloneDX modular schema composition and cross-references
Expected Benefits
- Significant reduction in manual maintenance effort
- Guaranteed alignment with the official CycloneDX specification
- Faster and safer adoption of future spec versions
- Improved consistency and correctness of data models
- Better contributor experience (less repetitive work)
Considerations / Open Questions
- What is the exact structure and format of the CycloneDX 2.0 machine-readable specification (JSON Schema variants, bundling, refs)?
- JSON Schema it is
- How should modular schemas be resolved and composed during generation?
- Should generated code be committed to the repository or produced at build time?
- decision: generated before build time, and commited to the repo
- How should custom extensions or library-specific logic be layered on top of generated models?
- What strategy ensures backward compatibility with CycloneDX 1.x?
- easy path: breaking change, and only support CDX 2.0 from then on
Additional Context
This effort aligns closely with the goals of CycloneDX 2.0 to provide a modular, tooling-friendly specification. Leveraging this architecture for automated model generation will significantly improve the long-term sustainability and scalability of this library.
Note: This issue serves as a meta-ticket to coordinate related subtasks, experiments, and implementation steps for introducing schema-driven model generation.
- 主要言語
- TypeScript
- スター
- 25
- フォーク
- 16
- 平均マージ
- 7日 18時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CycloneDX/cyclonedx-javascript-library のほかの issue
-
export for denoオープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
CycloneDX 1.7.1オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
enhancement schema 2.0
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
CycloneDX/cyclonedx-javascript-library の issue をすべて見る
似ている issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
🎙️ task - drop the raw `./node_modules/.bin/rhachet roles boot` line from bhuild's feedback templateオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ehmpathy/rhachet-roles-bhuild#639 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
redhat-developer/rhdh-plugin-export-overlays#4650 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 13 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
omdsh-dev/DSH-better-sidebar#1098 ·
メンテナーはふだん 2 日以内に返信