CycloneDX / CycloneDX/cyclonedx-core-java

validate method should read schema version from the file

Open
#332 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
120
Forks
90
Avg merge
12h 43m
Merged PRs (30d)
18

Description

In the `parse` method, it does read the schema version from the source file which is working fine. But when users call the `isValid` or `validate` method without specify a schema version it always use latest version as default. This does not work for the case of XML since the xmlns in the source file does not match with the one in the latest version.

In library we have a method to get the schema version from the source file but this method is private and cannot be used by the users. It means in order to get correct version, users need to check themselves before hand.

I suggest we should read schema version automatically as we do with the `parse` method.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.