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

Show comments of JSON Schema in Documentation #336

Closed
andreas-hilti opened this issue Nov 12, 2023 · 6 comments · Fixed by #344
Closed

Show comments of JSON Schema in Documentation #336

andreas-hilti opened this issue Nov 12, 2023 · 6 comments · Fixed by #344
Milestone

Comments

@andreas-hilti
Copy link
Contributor

andreas-hilti commented Nov 12, 2023

The comments that are part of the JSON schema are not shown in the documentation. Can they be added?

Example:
refType has a comment

"$comment": "value SHOULD not start with the BOM-Link intro 'urn:cdx:'"

"refType": {
"description": "Identifier for referable and therefore interlink-able elements.",
"type": "string",
"minLength": 1,
"$comment": "value SHOULD not start with the BOM-Link intro 'urn:cdx:'"
},

However, this does not show up in the documentation:
https://cyclonedx.org/docs/1.5/json/#metadata_component_bom-ref
grafik

@andreas-hilti
Copy link
Contributor Author

This is similar in spirit to #273.

@jkowalleck
Copy link
Member

jkowalleck commented Nov 12, 2023

Current JSON docs generator in insufficient to do so, according to coveooss/json-schema-for-humans#198

@jkowalleck
Copy link
Member

jkowalleck commented Nov 12, 2023

What you are referring to is a comment by me, the author. This is nothing relevant for documentation, so I thought at the time I wrote it.

The fact that the "value SHOULD not start with the BOM-Link intro 'urn:cdx:'" was stated, because it was a note for readers of the schema, in case they needed it for deeper understanding of the background of the change i made via 626dbbc
It was a comment for the future times when CycloneDX 2.0 would be written, when breaking changes would be allowed - when we would add regex-constraints to that element.

It is a mere comment, like

"$comment": "part of the pattern is based on `bom.serialNumber`'s pattern"

If you feel this comment has more value, I'd suggest you pullrequest a change and put this $comment into the description.

@andreas-hilti
Copy link
Contributor Author

Thanks, @jkowalleck. In my opinion, there are two aspects:

I can open a PR.

@jkowalleck
Copy link
Member

jkowalleck commented Nov 15, 2023

I can open a PR.

please do 👍
If this note is moved into the description, the $comment would simply be something like "TODO (breaking change): add a format constraint, that prevents the value from staring with urn:cdx:'" or something like this.

@jkowalleck jkowalleck linked a pull request Nov 19, 2023 that will close this issue
stevespringett added a commit that referenced this issue Nov 26, 2023
Move comment in `$comment` to description for increased visibility.

Closes: #336
@jkowalleck jkowalleck added this to the 1.6 milestone Nov 27, 2023
@jkowalleck jkowalleck linked a pull request Nov 27, 2023 that will close this issue
@jkowalleck jkowalleck mentioned this issue Nov 27, 2023
@jkowalleck
Copy link
Member

all work done. enhancement was merged to 1.6

@jkowalleck jkowalleck removed a link to a pull request Jan 16, 2024
stevespringett added a commit that referenced this issue Apr 9, 2024
## Added

* Core enhancement: Attestation
([#192](#192) via
[#348](#348))
* Core enhancement: Cryptography Bill of Materials — CBOM
([#171](#171),
[#291](#291) via
[#347](#347))
* Feature to express the URL to source distribution
([#98](#98) via
[#269](#269))
* Feature to express the URL to RFC 9116 compliant documents
([#380](#380) via
[#381](#381))
* Feature to express tags/keywords for services and components (via
[#383](#383))
* Feature to express details for component authors
([#335](#335) via
[#379](#379))
* Feature to express details for component and BOM manufacturer
([#346](#346) via
[#379](#379))
* Feature to express communicate concluded values from observed
evidences ([#411](#411)
via [#412](#412))
* Features to express license acknowledgement
([#407](#407) via
[#408](#408))
* Feature to express environmental consideration information for model
cards ([#396](#396) via
[#395](#395))
* Feature to express the address of organizational entities (via
[#395](#395))
* Feature to express additional component identifiers: Universal Bill Of
Receipts Identifier and Software Heritage persistent IDs
([#413](#413) via
[#414](#414))

## Fixed

* Allow multiple evidence identities by XML/JSON schema
([#272](#272) via
[#359](#359))
  This was already correct via ProtoBuff schema.
* Prevent empty `license` entities by XML schema
([#288](#288) via
[#292](#292))
  This was already correct in JSON/ProtoBuff schema.
* Prevent empty or malformed `property` entities by JSON schema
([#371](#371) via
[#375](#375))
  This was already correct in XML/ProtoBuff schema.
* Allow multiple `licenses` in `Metadata` by ProtoBuff schema
([#264](#264) via
[#401](#401))
  This was already correct in XML/JSON schema.

## Changed

* Allow arbitrary `$schema` values by JSON schema
([#402](#402) via
[#403](#403))
* Increased max length of `versionRange` (via
[`3e01ce6`](3e01ce6))
* Harmonized length of `version` (via
[#417](#417))

## Deprecated

* Data model "Component"'s field `author` was deprecated. (via
[#379](#379))
  Use field `authors` or field `manufacturer` instead.
* Data model "Metadata"'s field `manufacture` was deprecated.
([#346](#346) via
[#379](#379))
  Use "Metadata"'s field `component`'s field `manufacturer` instead. 
  - for XML: `/bom/metadata/component/manufacturer`
  - for JSON: `$.metadata.component.manufacturer`
  - for ProtoBuf: `Bom:metadata.component.manufacturer`

## Documentation

* Centralize version and version-range (via
[#322](#322))
* Streamlined SPDX expression related descriptions (via
[#327](#327))
* Enhanced descriptions of `bom-ref`/`refType`
([#336](#336) via
[#344](#344))
* Enhanced readability of enum documentation in JSON schema
([#361](#361) via
[#362](#362))
* Fixed typo "compliment" -> "complement" (via
[#369](#369))
* Added documentation for enum "ComponentScope"'s values in JSON schema
([#293](#293) via
[`d92e58e`](d92e58e))
  Texts were a taken from the existing ones in XML/ProtoBuff schema.
* Added documentation for enum "TaskType"'s values
([#245](#245) via
[#377](#377))
* Improve documentation for data model "Metadata"'s field `licenses`
([#273](#273) via
[#378](#378))
* Added documentation for enum "MachineLearningApproachType"'s values
([#351](#351) via
[#416](#416))
* Rephrased some texts here and there.

## Test data

* Added test data for newly added use cases
* Added quality assurance for our ProtoBuf schemas
([#384](#384) via
[#385](#385))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants