Skip to content

Validation error with nested oneOf #105

Description

@sfeitosa

We are developing a tool to apply differential test on json-schema libraries.

We found a subtle error happening only with the LUA's jsonschema library.

We used the following schema:

{
  "type": "object",
  "properties": {
    "resources": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "params": {
                "type": "object",
                "additionalProperties": {
                  "oneOf": [
                    { "type": "array" },
                    { "type": "object" },
                    { "type": "string" }
                  ]
                }
              }
            }
          }
        ]
      }
    }
  }
}

And the following document:

{
  "resources": {
    "myBicepWithInvalidParams": {
      "params": {
        "param1": []
      }
    }
  }
}

With these, it was generated the following error message:

Invalid doc for schema aspire property "resources"
validation failed: failed to validate additional
property myBicepWithInvalidParams: value should match
only one schema, but matches none

Activity

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

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