Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSAF 2.1 Format Validation

Files Used

Previous version before the metaschema change, revision:

New version, revision:

The files are located locally under fixtures/old and fixtures/new.

Changes to the Example

Two invalid files were created from the valid example:

  • In invalid-format.json, only /document/tracking/current_release_date was changed:

    "current_release_date": "heute-04-17T15:08:41Z"
  • In invalid-structure.json, only the required field /document/title was removed. This case checks whether the library applies the schema at all.

The new main schema references the new CSAF metaschema through $schema. There, the vocabulary https://json-schema.org/draft/2020-12/vocab/format-assertion is marked with true.

Results

The libraries evaluated here were found through search engines or searches of the relevant package indexes and were selected because they appeared reasonably mature.

Library Schema Valid Document Missing Title Invalid Date
Rust (jsonschema 0.51.0) old accepted rejected accepted
Rust (jsonschema 0.51.0) new accepted rejected rejected
Python (jsonschema 4.26.0) old accepted rejected accepted
Python (jsonschema 4.26.0) new accepted rejected accepted
C++ CLI (sourcemeta/jsonschema 16.9.0) old accepted rejected accepted
C++ CLI (sourcemeta/jsonschema 16.9.0) new accepted rejected rejected
Go (kaptinlin/jsonschema 0.9.9) old accepted rejected accepted
Go (kaptinlin/jsonschema 0.9.9) new error error error
Go (santhosh-tekuri/jsonschema 6.0.3) old accepted rejected accepted
Go (santhosh-tekuri/jsonschema 6.0.3) new accepted rejected rejected
Kotlin (networknt/json-schema-validator 3.0.6) old accepted rejected accepted
Kotlin (networknt/json-schema-validator 3.0.6) new accepted rejected rejected
Kotlin (erosb/json-sKema 0.28.0) old accepted rejected accepted
Kotlin (erosb/json-sKema 0.28.0) new accepted rejected rejected

Additional research:

Notes

The validators require Internet access for the external schema references.

Rust jsonschema issue: Stranger6667/jsonschema#1496

PR #962: oasis-tcs/csaf#962

CSAF 2.1 Draft, section 2.2: https://github.com/oasis-tcs/csaf/blob/master/csaf_2.1/prose/share/csaf-v2.1-draft.md#22-format-validation-

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages