Skip to content

reminder: fix AJV findings #208

Closed

Description

@jkowalleck

I just tried a new JSON schema validator, AJV, and this tool found some issues in current schema 1.4, that should be fixed in 1.5

Need to dig into the details. here are quick findings.

strict mode: missing type "object" for keyword "additionalProperties" at "http://cyclonedx.org/schema/bom-1.4.schema.json#/properties/affects/items/properties/versions/items" (strictTypes)
strict mode: missing type "object" for keyword "properties" at "http://cyclonedx.org/schema/bom-1.4.schema.json#/properties/affects/items/properties/versions/items" (strictTypes)
strict mode: missing type "object" for keyword "required" at "http://cyclonedx.org/schema/bom-1.4.schema.json#/properties/affects/items/properties/versions/items/oneOf/0" (strictTypes)
strict mode: required property "version" is not defined at "http://cyclonedx.org/schema/bom-1.4.schema.json#/properties/affects/items/properties/versions/items/oneOf/0" (strictRequired)
strict mode: missing type "object" for keyword "required" at "http://cyclonedx.org/schema/bom-1.4.schema.json#/properties/affects/items/properties/versions/items/oneOf/1" (strictTypes)
strict mode: required property "range" is not defined at "http://cyclonedx.org/schema/bom-1.4.schema.json#/properties/affects/items/properties/versions/items/oneOf/1" (strictRequired)
strict mode: "additionalItems" is ignored when "items" is not an array of schemas

!! another thing:

  • remove the bom.version from the required properties in JSON spec.
    Having it required just makes no sense, as the property has a default value.
    a default value is to be used when the element was missing – why would it be required, if it was allowed to be missing in the beginning??? see adjust/fix default values #216

Activity

  1. added this to the 1.5 milestone on Apr 7, 2023
  2. jkowalleck commented on Apr 7, 2023

    @jkowalleck
    MemberAuthor

    will research the reasons and try to fix them in current 1.5 draft.

    I might also add another schema validator to the CI.

  3. stevespringett commented on Apr 7, 2023

    @stevespringett
    Member

    Perhaps wait until more things are merged into the 1.5 branch so we can do them all at once?

  4. self-assigned this
    on Apr 14, 2023
  5. jkowalleck commented on May 29, 2023

    @jkowalleck
    MemberAuthor

    fixed by #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions