-
Notifications
You must be signed in to change notification settings - Fork 65
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
Is the ReadMe upto date ? #24
Comments
@praveen2710 Me and a colleague just talked about 1): schemer.validate({…}).to_a
# =>
# [{"data"=>"string",
# "data_pointer"=>"/0/id",
# "root_schema"=>
# {"items"=>
# {"properties"=>
# {"id"=>{"format"=>"int64", "type"=>"integer"},
# "name"=>{"type"=>"string"},
# "tag"=>{"type"=>"string"}},
# "required"=>["id", "name"]},
# "type"=>"array"},
# "schema"=>{"format"=>"int64", "type"=>"integer"},
# "schema_pointer"=>"/items/properties/id",
# "type"=>"integer"}] |
@ahx – can you please be any more specific about how that translates into a meaningful error message? I'm validating a large data object with an equally large schema; the object is missing a required field, and what I get back is:
Nowhere do I see any indication of what field is missing. I'm completely baffled by what to do with this result to turn it into anything useful to a human. Thanks for your insight. |
This is definitely the biggest problem we've had with the gem too. json_schemer/lib/json_schemer/schema/base.rb Line 456 in ea03fd5
I think I read somewhere that the author stopped refactoring that part waiting for the json schema RFC to define how to display errors, but the fact is, at this point it's very, very limited. Maybe I'll submit a PR with some improvements if the author is ok with it. |
You are right, I was hoping that the output would help understanding the error, but I don't understand how to parse it 😕 |
Hey y'all. Thanks for the interest. There's an open issue for improving error messages: #1. I was waiting for the JSON Schema spec to document some output guidelines, which they did: json-schema-org/json-schema-spec#679. I worked on implementing them, but ran into some ambiguities that slowed me down. The current plan is to go with their "basic" output format, which is similar to what's already being generated. It doesn't really help the To answer your original question @praveen2710, the readme does not document all features. If you (or anyone else) is interested in working on docs, that would be great.
No
Yes,
I'm not sure what you mean. Can you provide any more detail? You should be able to pass in any portion of you data. |
I released some error improvements in 0.2.0. Thanks @Draiken! Closing this. Feel free to ask more questions if you need clarification @praveen2710. |
I am using https://github.com/ruby-json-schema/json-schema as of now and as far as I can tell it not being maintained anymore. I was looking for similar feature but with better support and came across this one.
From what I can see in issue's it seems to be this gem can do a lot more than the Readme provides . Can the ReadMe be updated please ?
Things I want to know.
1)Is there a way to see errors on which there was a failure.examples in readMe would be great
2)Is there a way to customize the error message returned from json schema (ajv-errors)
3)Is there a way to fail on first validation issue vs make a list of all validation issue's (validate and fully_valdate in json shema)
4)Is there a way to access a portion of json schema (i.e my json data only consists on one property in json schema) eg: $ref = /path/to/json#properties/columns
I am new to this whole ruby gem community thing so apologies if I looked rude or something
The text was updated successfully, but these errors were encountered: