Skip to content

BREAKING CHANGE: Updated default schema version to 1.4 from 1.3 #164

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

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cyclonedx/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def to_version(self) -> str:
return f'{self.value[1]}.{self.value[5]}'


DEFAULT_SCHEMA_VERSION = SchemaVersion.V1_3
DEFAULT_SCHEMA_VERSION = SchemaVersion.V1_4


class BaseOutput(ABC):
Expand Down
14 changes: 14 additions & 0 deletions docs/architecture.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

Architecture
============

Expand Down
14 changes: 14 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

.. mdinclude:: ../CHANGELOG.md
14 changes: 14 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

Installation
============

Expand Down
14 changes: 14 additions & 0 deletions docs/modelling.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

Modelling
=========

Expand Down
18 changes: 16 additions & 2 deletions docs/outputting.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

Outputting
==========

Expand All @@ -9,7 +23,7 @@ We provide two helper methods:
* Output to string (for you to do with as you require)
* Output directly to a filename you provide

The default output will be XML at Schema Version 1.3.
The default output will be in XML at Schema Version 1.4.

Supported CycloneDX Schema Versions
-----------------------------------
Expand All @@ -25,7 +39,7 @@ This library supports the following schema versions:
Outputting to JSON
------------------

The below example relies on the default schema version being 1.3, but sets the output format to JSON. Output is returned
The below example relies on the default schema version being 1.4, but sets the output format to JSON. Output is returned
as a ``str``.

.. code-block:: python
Expand Down
16 changes: 15 additions & 1 deletion docs/schema-support.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

Schema Support
==============

Expand All @@ -14,7 +28,7 @@ supported in prior versions of the CycloneDX schema.
+----------------------------+---------------+---------------------------------------------------------------------------------------------------+
| ``bom[@serialNumber]`` | Yes | |
+----------------------------+---------------+---------------------------------------------------------------------------------------------------+
| ``bom.metadata`` | Yes (partial) | Not supported: ``authors``, ``manufacture``, ``supplier``, ``licenses``, ``properties``. |
| ``bom.metadata`` | Yes | |
+----------------------------+---------------+---------------------------------------------------------------------------------------------------+
| ``bom.components`` | Yes | Not supported: ``modified`` (as it is deprecated), ``signature``. |
+----------------------------+---------------+---------------------------------------------------------------------------------------------------+
Expand Down
14 changes: 14 additions & 0 deletions docs/support.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.. # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

Support
=======

Expand Down
8 changes: 4 additions & 4 deletions tests/test_output_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from cyclonedx.model.bom import Bom
from cyclonedx.model.component import Component
from cyclonedx.output import get_instance, OutputFormat, SchemaVersion
from cyclonedx.output.xml import XmlV1Dot3
from cyclonedx.output.xml import XmlV1Dot3, XmlV1Dot4


class TestOutputGeneric(TestCase):
Expand All @@ -34,11 +34,11 @@ def setUpClass(cls) -> None:

def test_get_instance_default(self) -> None:
i = get_instance(bom=TestOutputGeneric._bom)
self.assertIsInstance(i, XmlV1Dot3)
self.assertIsInstance(i, XmlV1Dot4)

def test_get_instance_xml(self) -> None:
def test_get_instance_xml_default(self) -> None:
i = get_instance(bom=TestOutputGeneric._bom, output_format=OutputFormat.XML)
self.assertIsInstance(i, XmlV1Dot3)
self.assertIsInstance(i, XmlV1Dot4)

def test_get_instance_xml_v1_3(self) -> None:
i = get_instance(bom=TestOutputGeneric._bom, output_format=OutputFormat.XML, schema_version=SchemaVersion.V1_3)
Expand Down