Skip to content

mis-handling oneOf selection in blaze/valid_default & blaze/valid_examples #531

@robbat2

Description

@robbat2

Possibly related to issue #411:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "default": "unknown",
  "examples": [
    "unknown",
    "infinite",
    "PT1H",
    "P1D"
  ],
  "oneOf": [
    { "const": "unknown" },
    { "const": "infinite" },
    { "type": "string", "format": "duration" }
  ]
}
$ jsonschema lint test.schema.json
test.schema.json:3:3:
  Only set a `default` value that validates against the schema (blaze/valid_default)
    at location "/default"
    The string value was expected to validate against one and only one of the 3 given subschemas
      at instance location ""
      at evaluate path "/oneOf"
test.schema.json:5:5:
  Only include instances in the `examples` array that validate against the schema (blaze/valid_examples)
    at location "/examples/0"
    Invalid example instance at index 0
      The string value was expected to validate against one and only one of the 3 given subschemas
        at instance location ""
        at evaluate path "/oneOf"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions