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

v1.4 General Availability #121

Merged
merged 92 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
46440f2
Prepared v1.4 development branch from current master
stevespringett Sep 16, 2021
7d9c574
Fixed 1.4 namespace
stevespringett Sep 19, 2021
dccbe44
#87 - Implemented release notes in XML, JSON, and Protobuf. Added uni…
stevespringett Sep 19, 2021
cc4105f
#87 - Added release notes as an external reference type
stevespringett Sep 19, 2021
adb75ab
#38 - Added initial support for vulnerabilities as part of core spec.…
stevespringett Oct 3, 2021
173b781
Corrected issues preventing validation
stevespringett Oct 3, 2021
431eeb2
Made component version optional. Updated minimal viable unit tests
stevespringett Oct 4, 2021
8f240ab
Reverted changes to version being optional in proto schema. Added doc…
stevespringett Oct 5, 2021
a1e2909
Added support for properties to release notes. https://github.com/Cyc…
stevespringett Oct 5, 2021
18d0a43
Added documentation to attachment text that states "Proactive control…
stevespringett Oct 5, 2021
a04e72f
Clarified description of when the vulnerability was created per https…
stevespringett Oct 5, 2021
821fdfa
Refactored 'affects' by incorporating ranges and versions into indivi…
stevespringett Oct 15, 2021
df947e9
Refactored 'affects' by incorporating ranges and versions into indivi…
stevespringett Oct 15, 2021
d290235
spelling
stevespringett Oct 15, 2021
f58b508
Initial implementation of JSF 0.82 as JSON Schema. Required to #89
stevespringett Oct 17, 2021
fb39f04
Added JSF support to core schema supporting component, service, compo…
stevespringett Oct 18, 2021
00ad666
Added json schema doc generation. Initial commit for automation of docs.
stevespringett Oct 25, 2021
77a50f2
Updating title and description
stevespringett Oct 25, 2021
0252b8d
fixed issue with quoted variable in docs
stevespringett Oct 25, 2021
b7e37c6
Added not_affected justifications based on discussion https://github.…
stevespringett Nov 12, 2021
f15b462
Removed not_set as its implied if value is not specified. Added expli…
stevespringett Nov 12, 2021
052e702
Added description for vulnerability reference
stevespringett Nov 18, 2021
485456c
Added description for vulnerability reference
stevespringett Nov 18, 2021
8db5a20
Standardizing on version range syntax from CVE v5.0 JSON schema
stevespringett Nov 19, 2021
35b5bc0
Minor hardening. Added default to affected status as unlike the CVE 5…
stevespringett Nov 20, 2021
3bc4c0d
Added external references support to tools
stevespringett Nov 20, 2021
d3f0e50
Documentation updates
stevespringett Nov 22, 2021
dcad6ef
Added info to severity
stevespringett Nov 22, 2021
6c62cc6
Documentation updates
stevespringett Nov 22, 2021
0ac6b87
#91 - Added analysis (vendor) response
stevespringett Dec 7, 2021
b42bbca
#91 - Changed credits from a string to structured data supporting an …
stevespringett Dec 7, 2021
62774d0
Corrected maxoccurs
stevespringett Dec 7, 2021
446fce1
Corrected maxoccurs
stevespringett Dec 7, 2021
efed5c4
Added newline
stevespringett Dec 7, 2021
2e8eca4
Changed release type from enum to string with a description on recomm…
stevespringett Dec 7, 2021
9f9f4ca
Migrated from version range syntax defined in CVE 5.0 Schema to Packa…
stevespringett Dec 13, 2021
5ac7976
Minor doc updates
stevespringett Dec 13, 2021
1ec2ca4
Added XSD and XML example that are ported from the draft JSON schema.
stevespringett Dec 13, 2021
ae3a4ab
Added Protobuf and textproto example that are ported from the draft J…
stevespringett Dec 14, 2021
937b8fd
Changed SEVERITY_UNKNOWN to default
stevespringett Dec 17, 2021
7a7d7ad
Changed SEVERITY_UNKNOWN to default
stevespringett Dec 17, 2021
6201ede
Changed IMPACT_ANALYSIS_STATE_NULL to default
stevespringett Dec 17, 2021
c85bdd6
Changed IMPACT_ANALYSIS_JUSTIFICATION_NULL to default and VULNERABILI…
stevespringett Dec 17, 2021
0e1df61
Changed VULNERABILITY_AFFECTED_STATUS_UNKNOWN to default
stevespringett Dec 17, 2021
cf4b738
Merge pull request #102 from CycloneDX/v1.4-extref-tools
stevespringett Dec 17, 2021
0e20883
Merge pull request #92 from CycloneDX/v1.4-component-version-optional
stevespringett Dec 17, 2021
9dcd16c
Merge pull request #91 from CycloneDX/v1.4-vulns
stevespringett Dec 20, 2021
b76ee21
Merge remote-tracking branch 'origin/v1.4-dev' into v1.4-release-notes
stevespringett Dec 20, 2021
0689101
Merge pull request #88 from CycloneDX/v1.4-release-notes
stevespringett Dec 20, 2021
2759c8a
Merge remote-tracking branch 'origin/v1.4-dev' into v1.4-jsf
stevespringett Dec 20, 2021
edd2d92
Merge pull request #93 from CycloneDX/v1.4-jsf
stevespringett Dec 20, 2021
0cfb1cc
#89 - Hardened JSON schema. Removed support for relaxed schema.
stevespringett Dec 20, 2021
7b2c23a
Removed CPE deprecation - Resolves #105
stevespringett Dec 20, 2021
0ce5f5e
#106 - Added $schema to 1.4-SNAPSHOT
stevespringett Dec 20, 2021
bc7e9ab
#86 - Adding v1.4 unit tests
stevespringett Dec 20, 2021
567cdfe
spec 1.4 JSON: removed duplicate `$id`s - replace with `$ref`s
jkowalleck Dec 22, 2021
8fb11aa
spec 1.4 JSON: removed unused `$id` when they equaled the json-path
jkowalleck Dec 22, 2021
68d93b1
Merge pull request #109 from jkowalleck/json-fixes_issue83
stevespringett Dec 23, 2021
ec00466
#83 - Added JSON schema linting
stevespringett Dec 23, 2021
c628fd5
Merge remote-tracking branch 'origin/v1.4-dev' into v1.4-dev
stevespringett Dec 23, 2021
f9470f1
#83 - Added JSON schema linting of jsf-0.82 and spdx schemas
stevespringett Dec 23, 2021
5698d3e
spec 1.4 JSON schema: remove unnecessary self-shadowing `$id`
jkowalleck Dec 23, 2021
1b0c21b
Merge pull request #111 from jkowalleck/json-fixes_issue83-2
stevespringett Dec 24, 2021
4d31842
Revert "spec 1.4 JSON: removed duplicate `$id`s - replace with `$ref`s"
stevespringett Dec 28, 2021
33d9445
Revert "spec 1.4 JSON: removed unused `$id` when they equaled the jso…
stevespringett Dec 28, 2021
7d817b0
Merge remote-tracking branch 'origin/v1.4-dev' into v1.4-dev
stevespringett Dec 28, 2021
89a80f0
Updates to support docgen
stevespringett Dec 28, 2021
617ea4b
Updates to support docgen
stevespringett Dec 28, 2021
33c4dbb
Updates to support docgen
stevespringett Dec 28, 2021
0018071
Updates to support docgen
stevespringett Dec 28, 2021
6513ba6
Updates to support docgen
stevespringett Dec 28, 2021
20b1d36
Updates to support docgen
stevespringett Dec 28, 2021
ab88610
#99 - Doc updates
stevespringett Dec 28, 2021
31be6e0
schema spec1.4: own type for `ref`/`bom-ref`
jkowalleck Dec 28, 2021
0c503ec
spec 1.4 JSON schema: removed redundant/self-sadowing `$id`s
jkowalleck Dec 28, 2021
886aa6a
spec 1.4 JSON schema: removed unused `$id`s
jkowalleck Dec 28, 2021
f62480b
Merge pull request #116 from jkowalleck/v1.4-dev_ref-type
stevespringett Dec 29, 2021
374aa4c
Merge pull request #117 from jkowalleck/v1.4-dev_bugfix_issue83
stevespringett Dec 29, 2021
bc7deaf
#99 - Doc updates
stevespringett Dec 29, 2021
bafd260
#99 - Hiding $ attributes from generated docs.
stevespringett Dec 29, 2021
24f5984
Updated json-schema-for-humans to v0.39.3
stevespringett Dec 29, 2021
7b6350a
Added deprecated doc support
stevespringett Dec 29, 2021
86ed6c1
Corrected grammar
stevespringett Dec 30, 2021
fa1ede2
Add service release notes to v1.4 proto file
coderpatros Jan 3, 2022
7348609
Merge pull request #120 from CycloneDX/service-release-notes
stevespringett Jan 3, 2022
618bcda
Updating json-schema-for-humans to 0.39.5 which resolves https://gith…
stevespringett Jan 4, 2022
1e5c939
Documentation updates
stevespringett Jan 7, 2022
ba894e0
#89 - Added additional hardening
stevespringett Jan 7, 2022
eb7b3c9
Removed SNAPSHOT
stevespringett Jan 7, 2022
1383156
Removed SNAPSHOT from docgen
stevespringett Jan 7, 2022
d9ed1f1
Removed SNAPSHOT from docgen
stevespringett Jan 7, 2022
ec99395
Merge branch 'master' into v1.4-dev
stevespringett Jan 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI Build

on: [push, pull_request]

env:
PYTHON_VERISON_DEFAULT: "3.10"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: |
cd tools
mvn -B package --file pom.xml
cd ..
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERISON_DEFAULT }}
architecture: 'x64'
- name: Generate JSON Schema documentation
run: |
cd docgen/json
./gen.sh
- name: Generate XML Schema documentation
run: |
cd docgen/xml
./gen.sh
- name: Archive JSON Schema documentation
uses: actions/upload-artifact@v2
with:
name: JSON-Schema-documentation
path: docgen/json/docs
- name: Archive XML Schema documentation
uses: actions/upload-artifact@v2
with:
name: XML-Schema-documentation
path: docgen/xml/docs
19 changes: 0 additions & 19 deletions .github/workflows/maven.yml

This file was deleted.

29 changes: 29 additions & 0 deletions docgen/json/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
rm -f -R docs
mkdir -p docs/{1.2,1.3,1.4}

# Check to see if generate-schema-doc is executable and is in the path. If not, install JSON Schema for Humans.
if ! [ -x "$(command -v generate-schema-doc)" ]; then
pip3 install json-schema-for-humans==0.39.5
fi

generate () {
version=$1
title='CycloneDX v'$version' JSON Reference'
echo Generating $title
STRICT_SCHEMA_FILE='../../schema/bom-'$version'-strict.schema.json'
if [ -f "$STRICT_SCHEMA_FILE" ]; then
SCHEMA_FILE='../../schema/bom-'$version'-strict.schema.json'
else
SCHEMA_FILE='../../schema/bom-'$version'.schema.json'
fi
echo $SCHEMA_FILE
generate-schema-doc --config no_link_to_reused_ref --config no_show_breadcrumbs --config no_collapse_long_descriptions --config deprecated_from_description --config title="$title" --config custom_template_path=$(pwd)'/templates/cyclonedx/base.html' --minify $SCHEMA_FILE 'docs/'$version'/index.html'
sed -i -e "s/\${quotedTitle}/\"$title\"/g" 'docs/'$version'/index.html'
sed -i -e "s/\${title}/$title/g" 'docs/'$version'/index.html'
sed -i -e "s/\${version}/$version/g" 'docs/'$version'/index.html'
}

generate 1.2
generate 1.3
generate 1.4
14 changes: 14 additions & 0 deletions docgen/json/templates/cyclonedx/badge_type.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{%- if type_name == "string" -%}
{%- if schema.kw_min_length -%}
{{ restriction("Must be at least <code>" ~ schema.kw_min_length.literal ~ "</code> characters long", "min-length", schema.kw_min_length.html_id) }}
{%- endif -%}
{%- if schema.kw_max_length -%}
{{ restriction("Must be at most <code>" ~ schema.kw_max_length.literal ~ "</code> characters long", "max-length", schema.kw_max_length.html_id) }}
{%- endif -%}
{%- endif -%}
{%- if type_name in ["integer", "number"] -%}
{%- set restriction_text = (schema | get_numeric_restrictions_text("<code>", "</code>")) -%}
{%- if restriction_text -%}
{{ restriction(schema | get_numeric_restrictions_text("<code>", "</code>"), "numeric", schema.html_id ~ "_number") }}
{%- endif -%}
{%- endif -%}
85 changes: 85 additions & 0 deletions docgen/json/templates/cyclonedx/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{% from 'content.html' import content with context %}

<!DOCTYPE html>
<html lang="en">
<head>
<title>${title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta charset="UTF-8"/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@CycloneDX_Spec"/>
<meta name="twitter:title" content="${quotedTitle}"/>
<meta name="twitter:image" content="https://cyclonedx.org/theme/assets/images/CycloneDX-Twitter-Card.png"/>
<meta name="twitter:description" content="${quotedTitle}"/>
<meta name="description" content="${quotedTitle}"/>
<meta property="og:description" content="${quotedTitle}"/>
<meta property="og:title" content="${quotedTitle}"/>
<meta property="og:locale" content="en_US"/>
<meta property="og:type" content="website" />
<meta property="og:image" content="https://cyclonedx.org/theme/assets/images/CycloneDX-Twitter-Card.png" />
<link rel="icon" href="https://cyclonedx.org/cyclonedx-icon.png" type="image/png"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.0/css/bootstrap.min.css" integrity="sha512-P5MgMn1jBN01asBgU0z60Qk4QxiXo86+wlFahKrsQf37c9cro517WzVSPPV1tDKzhku2iJ2FVgL67wG03SGnNA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" type="text/css" href="schema_doc.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.slim.js" integrity="sha512-HNbo1d4BaJjXh+/e6q4enTyezg5wiXvY3p/9Vzb20NIvkJghZxhzaXeffbdJuuZSxFhJP87ORPadwmU9aN3wSA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.0/js/bootstrap.min.js" integrity="sha512-XKa9Hemdy1Ui3KSGgJdgMyYlUg1gM+QhL6cnlyTe2qzMCYm4nAZ1PsVerQzTTXzonUR+dmswHqgJPuwCq1MaAg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/12.2.0/markdown-it.min.js" integrity="sha512-cTQeM/op796Fp1ZUxfech8gSMLT/HvrXMkRGdGZGQnbwuq/obG0UtcL04eByVa99qJik7WlnlQOr5/Fw5B36aw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="schema_doc.min.js"></script>
</head>
<body class="blue" data-spy="scroll" data-target=".js-scrollspy" onload="anchorOnLoad();" id="root">

<nav class="navbar fixed-top navbar-expand-sm navbar-inverse">
<a href="https://cyclonedx.org" class="navbar-brand site-header__logo"><img src="https://cyclonedx.org/theme/assets/images/layout/logo-white.svg" width="150"></img></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarScroll">
<ul class="navbar-nav mr-auto my-2 my-lg-0 navbar-nav-scroll" style="max-height: 100px;">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarScrollingDropdown" role="button" data-toggle="dropdown" aria-expanded="false">
v${version} (JSON)
</a>
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.4/json/">v1.4 (JSON)</a></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.3/json/">v1.3 (JSON)</a></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.2/json/">v1.2 (JSON)</a></li>
<li><hr class="dropdown-divider"/></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.4/xml/">v1.4 (XML)</a></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.3/xml/">v1.3 (XML)</a></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.2/xml/">v1.2 (XML)</a></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.1/xml/">v1.1 (XML)</a></li>
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.0/xml/">v1.0 (XML)</a></li>
</ul>
</li>
</ul>
</div>
</nav>


<div class="container-fluid" style="margin-top:70px; margin-bottom:3rem">
<h1>${title}</h1>

{%- if title -%}
<h1>{{ title }}</h1>
{%- endif -%}
{%- if config.expand_buttons -%}
<div class="text-right">
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target=".collapse:not(.show)" aria-expanded="false">Expand all</button>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target=".collapse.show" aria-expanded="false">Collapse all</button>
</div>
{%- endif -%}

{{ content(schema) }}

<footer class="site-footer__copyright fixed-bottom">
<div class="container">
<div class="row">
<div class="col-sm-12">
&copy; OWASP Foundation - CycloneDX is a <a href="https://owasp.org/cyclonedx">OWASP Flagship Project</a>
</div>
</div>
</div>
</footer>

</body>
</html>
17 changes: 17 additions & 0 deletions docgen/json/templates/cyclonedx/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="breadcrumbs">
{%- for node in schema.nodes_from_root -%}
{%- if loop.first -%}
root
{%- else -%}
<a href="#{{ node.html_id }}" onclick="anchorLink('{{ node.html_id }}')">{{ node.name_for_breadcrumbs }}</a>
{%- endif -%}
{%- if not loop.last %}
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-arrow-right-short" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path
fill-rule="evenodd"
d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z"
/>
</svg>
{% endif -%}
{%- endfor -%}
</div>
116 changes: 116 additions & 0 deletions docgen/json/templates/cyclonedx/content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{% from "macro_restriction.html" import restriction with context %}

{%- macro tabbed_section(operator, current_node) -%}
{% include "tabbed_section.html" %}
{%- endmacro -%}

{%- macro content(schema, skip_headers=False) -%}
{% set keys = schema.keywords %}

{# Resolve type #}
{%- set type_name = schema.type_name -%}

{% if not skip_headers %}
{%- if config.show_breadcrumbs -%}
{%- include "breadcrumbs.html" -%}
{%- endif -%}

{# Display type #}
{%- if not schema is combining -%}
<span class="badge value-type">Type: {{ type_name }}</span>
{%- endif -%}

{# Display default #}
{%- set default_value = schema.default_value -%}
{%- if default_value -%}
{{ " " }}<span class="badge default-value">Default: {{ default_value }}</span>
{%- endif -%}
<br/>

{%- set description = (schema | get_description) -%}
{%- include "section_description.html" -%}
{%- endif -%}


{%- if schema.should_be_a_link(config) -%}
<a href="#{{ schema.links_to.html_id }}" onclick="anchorLink('{{ schema.links_to.html_id }}')" class="ref-link">Same definition as {{ schema.links_to.link_name }}</a>
{%- elif schema.refers_to -%}
{{ content(schema.refers_to_merged, True) }}
{%- else -%}
{# Handle having oneOf or allOf with only one condition #}
{%- if schema.kw_all_of and (schema.kw_all_of.array_items | length) == 1 -%}
{{ content(schema.kw_all_of.array_items[0]) }}
{%- elif schema.kw_any_of and (schema.kw_any_of.array_items | length) == 1 -%}
{{ content(schema.kw_any_of.array_items[0]) }}
{%- else -%}
{%- if schema.explicit_no_additional_properties -%}
{{ " " }}<span class="badge no-additional">No Additional Properties</span>
{%- endif -%}

{# Combining: allOf, anyOf, oneOf, not #}
{%- if schema.kw_all_of -%}
<div class="all-of-value" id="{{ schema.kw_all_of.html_id }}">{{ tabbed_section("allOf", schema.kw_all_of) }}</div>
{%- endif -%}
{%- if schema.kw_any_of -%}
<div class="any-of-value" id="{{ schema.kw_any_of.html_id }}">{{ tabbed_section("anyOf", schema.kw_any_of) }}</div>
{%- endif -%}
{%- if schema.kw_one_of -%}
<div class="one-of-value" id="{{ schema.kw_one_of.html_id }}">{{ tabbed_section("oneOf", schema.kw_one_of) }}</div>
{%- endif -%}
{%- if schema.kw_not -%}
{% include "section_not.html" %}
{%- endif -%}

{# Enum and const #}
{%- if schema.kw_enum -%}
<div class="enum-value" id="{{ schema.kw_enum.html_id }}">
<h4>Must be one of:</h4>
<ul class="list-group">
{%- for enum_choice in schema.kw_enum.array_items -%}
<li class="list-group-item enum-item">{{ enum_choice.literal | python_to_json }}</li>
{%- endfor -%}
</ul>
</div>
{%- endif -%}
{%- if schema.kw_const -%}
<span class="const-value" id="{{ schema.kw_const.html_id }}">Specific value: <code>{{ schema.kw_const.raw | python_to_json }}</code></span>
{%- endif -%}

{# Pattern (Regular Expression) #}
{%- if schema.kw_pattern -%}
<span class="pattern-value" id="{{ schema.kw_pattern.html_id }}">Must match regular expression: <code>{{ schema.kw_pattern.literal | escape }}</code></span>
{%- endif -%}

{# Conditional subschema, or if-then-else section #}
{%- if schema.has_conditional -%}
{% include "section_conditional_subschema.html" %}
{%- endif -%}

{# Required properties that are not defined under "properties". They will only be listed #}
{% include "section_undocumented_required_properties.html" %}

{# Show the requested type(s) #}
{% include "badge_type.html" %}

{# Show array restrictions #}
{%- if type_name.startswith("array") -%}
{% include "section_array.html" %}
{%- endif -%}

{# Display examples #}
{%- set examples = schema.examples -%}
{%- if examples -%}
{% include "section_examples.html" %}
{%- endif -%}

{# Properties, pattern properties, additional properties #}
{%- for sub_property in schema.iterate_properties -%}
{# Custom modification to remove $ properties from documentation #}
{%- if not sub_property.property_display_name.startswith("$") -%}
{% include "section_properties.html" %}
{%- endif -%}
{%- endfor -%}

{%- endif -%}
{%- endif -%}
{%- endmacro -%}
3 changes: 3 additions & 0 deletions docgen/json/templates/cyclonedx/macro_restriction.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%- macro restriction(inner_text, css_class_name, html_id) -%}
<p><span class="badge badge-light restriction {{ css_class_name }}-restriction" id="{{ html_id }}">{{ inner_text }}</span></p>
{%- endmacro -%}
Loading