Skip to content

No format validation for uri-reference #220

@binste

Description

@binste

Hi @sirosen, I'm trying out the suggestion you made here vega/altair#2771 (comment) for the Altair repository (related Altair issue vega/altair#2801). The vega-lite schema I'm validating has an invalid uri-reference format and so I'd expect the validation to fail. This is the case if I use jsonschema

import json
import jsonschema
with open("altair/vegalite/v5/schema/vega-lite-schema.json", "r") as f:
    schema = json.load(f)

jsonschema.Draft7Validator.check_schema(schema)
ValueError: '#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef<TypeForShape>,(string|null)>' is not a valid 'URI_reference'.

But not if I use check-jsonschema:

check-jsonschema --check-metaschema altair/vegalite/v5/schema/vega-lite-schema.json
# ok -- validation done

I only found this reference in the docs on format validation which mentions that it is enabled by default. Any pointers towards the cause of this would be greatly appreciated :) In a next step, I'd then actually need to disable that specific uri-reference check which I might do by uninstalling the relevant format package in the CI but I first wanted to make sure that check-jsonschema actually runs the format checks.

Versions:

  • check-jsonschema: 0.20.0
  • jsonschema: 4.17.3 (installed as pip install 'jsonschema[format])

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions