File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,10 @@ def validate_document(document):
123123 The validator is loaded from the document specVersion property.
124124 """
125125 if isinstance (document , str ):
126+ document_str = document
126127 document = json .loads (document )
128+ else :
129+ document_str = json .dumps (document )
127130
128131 spec_version = document .get ("specVersion" )
129132 if not spec_version :
@@ -132,7 +135,8 @@ def validate_document(document):
132135 schema_version = SchemaVersion .from_version (spec_version )
133136
134137 json_validator = JsonStrictValidator (schema_version )
135- return json_validator ._validata_data (document )
138+ json_validation_errors = json_validator .validate_str (document_str )
139+ return json_validation_errors
136140
137141
138142def is_cyclonedx_bom (input_location ):
You can’t perform that action at this time.
0 commit comments