Skip to content
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

chore: make sure all examples are schema-valid #51

Open
jkowalleck opened this issue Dec 4, 2024 · 0 comments
Open

chore: make sure all examples are schema-valid #51

jkowalleck opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels

Comments

@jkowalleck
Copy link
Member

jkowalleck commented Dec 4, 2024

problem

we have a lot of documents here, and while they claim to stick to the specs and authoritative guides, this needs to checked/reviewed manually.

what we might automate is:
detect which schema version the respective examples intend to comply to, and check that they actually do this.

possible solution

the following process it intended to run on each change of the default branch, as well as on every pull-request:

  1. rename all CycloneDX example files to *.cdx.{json,xml} -- so they are distinguished from other files in the example folders
  2. traverse over all example files - *.cdx.{json,xml}
    1. detect the schema
      • JSON: $.schemaVersion starts with main version - like 1.2.xyz -> CycloneDX v1.2
      • XML: see the actual XML schema of the document root node
    2. validate against the respective schema

Implementation details:

  • unclear whether to use one/many of our existing CycloneDX libraries, or to implement a standalone-solution in here.

pro/cons of using existing library

+ easy to implement, as most work was done already
+ maintenance can be driven by dependabot/renovate
- rely on the library being up-to-date

pro/cons of standalone

+ independent
- initial development might be slow
- needs manual maintenance
@jkowalleck jkowalleck self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant