Skip to content

Incorrect validation #832

@smilesrg

Description

@smilesrg

I'm using schema provided below to validate content {"number":null,"country":{},"bank":{}}, content is valid but should not be.

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "number": {
      "type": "object"
    },
    "scheme": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "brand": {
      "type": "string"
    },
    "country": {
      "type": "object",
      "properties": {
        "numeric": {
          "type": "string"
        },
        "alpha2": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "emoji": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "latitude": {
          "type": "integer"
        },
        "longitude": {
          "type": "integer"
        }
      },
      "required": [
        "numeric",
        "alpha2",
        "name",
        "emoji",
        "currency",
        "latitude",
        "longitude"
      ]
    },
    "bank": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    }
  },
  "required": [
    "number",
    "scheme",
    "type",
    "brand",
    "country",
    "bank"
  ]
}

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