XML Schema HTML viewer generator script supports generating for one particular CDX version #508
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.
The XML Schema HTML viewer generator script
docgen/xml/gen.sh
supports generating only for one particular CycloneDX version, including the possibility of generating the HTML only for draft version of CycloneDX during dev time.See also a similar PR for JSON: #507
Use Case
I want to propose new objects in the CycloneDX Specification. And for checking the XML XSD Schema, I like to locally use the HTML view to check the content of the XSD.
However, I found it not convenient that the script
docgen/xml/gen.sh
regenerate the HTML doc for every version of CycloneDX each time I run it when I only need the version I am working on.Proposition
I modified the script
docgen/xml/gen.sh
to be able to rungen.sh
only for a particular version of CycloneDX.For example:
But I also added a list
DRAFT_CYCLONEDX_VERSIONS
for when I am working on a draft proposition of CycloneDX spec.For example:
# I modify `docgen/xml/gen.sh` to add the name of my draft file DRAFT_CYCLONEDX_VERSIONS=(my_cdx_dev_draft)
I create a JSON schema draft file
schema/bom-my_cdx_dev_draft.xsd
:Then I run:
Which creates only the HTML for
my_cdx_dev_draft
And in order not to disturb the way
docgen/xml/gen.sh
works now, running it without argument generates the HTML for all the CDX versions:I also added a small usage help message.
Conclusion
There are probably other way to achieve this result. I think this one is the cheapest in terms of how the
gen.sh
script is modified.