mafintosh / is-my-json-valid

A JSONSchema validator that uses code generation to be extremely fast
MIT License
965 stars 111 forks source link

Can't see errors with referenced schemas #22

Open blakeembrey opened 9 years ago

blakeembrey commented 9 years ago

I'm working with a complex JSON schema but it's impossible to know what isn't validating since I just get referenced schema does not match with https://github.com/mulesoft-labs/raml-object-standard/blob/master/schema.json#L8-L46. It should be valid since it's passing using other validation libraries.

fride commented 9 years ago

I do have the exact same error message, without a line number. ;)

imjul1an commented 9 years ago

Hi guys,

I have a little bit different issue with external schema validation:

whenever I use external schema referenced in the main schema(i.e. $ref: '#ext') I do not get any errors at all, what is most important I'm gettin success validation result.

here is the code: https://gist.github.com/julianusti/6fb4d2d4e41f2c5f9e68

adrai commented 9 years ago

any news?

ramiel commented 9 years ago

Same here. No information on referenced schemas.

ahmadnassri commented 9 years ago

would certainly be useful to get info on the referenced schema ... :+1:

OllieJennings commented 9 years ago

+1, getting errors with reference schemas, no idea why its not working

chrahunt commented 9 years ago

@julianusti the last line of the schema you linked has an error. The name of the referenced schema #ext has to be the key for the object that you're passing in for schemas. This should work for you:

var validate = validator(schema, {
  schemas: {
    ext: ext
  },
  verbose: true,
  greedy: true
});
alandotcom commented 9 years ago

What's the status on this and the referenced PRs?

tauren commented 9 years ago

:+1: This bit me too

daniloarcidiacono commented 6 years ago

+1

pankleks commented 5 years ago

Hello, any update on this, any error I get from schema validation says: referenced schema does not match