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

Dependencies don't seem to work correctly #117

Closed
ahawkins opened this issue Sep 1, 2014 · 0 comments · Fixed by #145
Closed

Dependencies don't seem to work correctly #117

ahawkins opened this issue Sep 1, 2014 · 0 comments · Fixed by #145

Comments

@ahawkins
Copy link

ahawkins commented Sep 1, 2014

Hey, thanks a bunch for this project. It's been very helpful at my company. I attempted to do some schemas using dependencies. I followed this example. The current version of json-schema dsays invalid data is valid.

Given this schema:

{
  "type": "object",

  "properties": {
    "name": { "type": "string" },
    "credit_card": { "type": "number" }
  },

  "required": ["name"],

  "dependencies": {
    "credit_card": {
      "properties": {
        "billing_address": { "type": "string" }
      },
      "required": ["billing_address"]
    }
  }
}

And this data valid data

{
  "name": "John Doe",
  "credit_card": 5555555555555555,
  "billing_address": "555 Debtor's Lane"
}

And this invalid data

{
  "name": "John Doe",
  "credit_card": 5555555555555555
}

JSON incorrectly reports the invalid as valid.

@pd pd closed this as completed in #145 Oct 26, 2014
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

Successfully merging a pull request may close this issue.

1 participant