Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-document YAML files #194

Open
reitzig opened this issue Oct 31, 2024 · 0 comments
Open

Support multi-document YAML files #194

reitzig opened this issue Oct 31, 2024 · 0 comments

Comments

@reitzig
Copy link

reitzig commented Oct 31, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant