Skip to content

Support multi-document YAML files #194

@reitzig

Description

@reitzig

Consider this schema:

{
  "$id": "https://json.schemastore.org/catalog-info.json",
  "$schema": "http://json-schema.org/draft-07/schema",
  "type" : "object",
  "properties" : {
    "a": {
      "type" : "string",
      "pattern" : "^[a-z]{3}$"
    }
  },
  "required" : ["a"]
}

And this input YAML file:

a: abc
---
a: de

Expected:

instance example.yaml: failed
jsonschema validation failed with 'file:///home/raphael/code/aoksystems/oc-shared-tools/json-schema-validator/test/example.schema.json#'
- at '/a': 'de' does not match pattern '^[a-z]{3}$'

(The output would probably have to be extended with some indication which of the included documents failed.)

Actual:

instance example.yaml: ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions