Skip to content

Commit 2f2b21e

Browse files
committed
BREAKING CHANGE: replaced concept of default schema version with latest supported #171
Signed-off-by: Paul Horton <[email protected]>
1 parent a926b34 commit 2f2b21e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cyclonedx/output/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def to_version(self) -> str:
5050
return f'{self.value[1]}.{self.value[5]}'
5151

5252

53-
DEFAULT_SCHEMA_VERSION = SchemaVersion.V1_4
53+
LATEST_SUPPORTED_SCHEMA_VERSION = SchemaVersion.V1_4
5454

5555

5656
class BaseOutput(ABC):
@@ -105,7 +105,7 @@ def output_to_file(self, filename: str, allow_overwrite: bool = False) -> None:
105105

106106

107107
def get_instance(bom: Bom, output_format: OutputFormat = OutputFormat.XML,
108-
schema_version: SchemaVersion = DEFAULT_SCHEMA_VERSION) -> BaseOutput:
108+
schema_version: SchemaVersion = LATEST_SUPPORTED_SCHEMA_VERSION) -> BaseOutput:
109109
"""
110110
Helper method to quickly get the correct output class/formatter.
111111

docs/outputting.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We provide two helper methods:
2323
* Output to string (for you to do with as you require)
2424
* Output directly to a filename you provide
2525

26-
The default output will be in XML at Schema Version 1.4.
26+
By default output will be in XML at latest supported schema version - see :py:mod:`cyclonedx.output.LATEST_SUPPORTED_SCHEMA_VERSION`.
2727

2828
Supported CycloneDX Schema Versions
2929
-----------------------------------
@@ -34,12 +34,12 @@ This library supports the following schema versions:
3434
* 1.1 (XML) - `(note, 1.1 schema version has no support for JSON)`
3535
* 1.2 (XML, JSON)
3636
* 1.3 (XML, JSON)
37-
* 1.4 (XML, JSON)
37+
* 1.4 (XML, JSON) - the latest supported schema version
3838

3939
Outputting to JSON
4040
------------------
4141

42-
The below example relies on the default schema version being 1.4, but sets the output format to JSON. Output is returned
42+
The below example relies on the latest schema version, but sets the output format to JSON. Output is returned
4343
as a ``str``.
4444

4545
.. code-block:: python

0 commit comments

Comments
 (0)