-
Notifications
You must be signed in to change notification settings - Fork 10
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
Cannot self-validate the schema #2
Comments
This library is in accordance with JSON Schema 2nd Draft ( http://groups.google.com/group/json-schema/web/json-schema-proposal---second-draft ), excepting Extending and Referencing / unique property. Thanks for your report. |
Are you planning to update to draft 3, which replaces the "optional" attribute with "required" attribute (and makes optional the default)? |
I would like to implement draft 3 JSON Schema in the future. thx. |
If interested, I have a fairly stable draft-3 compliant Ruby json schema validator at https://github.com/hoxworth/json-schema. The validator also supports draft-1 and draft-2, and will be tracking any future updates to the JSON Schema spec. |
Oh! Thanks!!! Your implementation is great! Do you think about the 3rd draft complicated attributes like "regexp" in "format", "$ref" with the external URL(http://...)? |
The $ref attribute is definitely handled and resolves against absolute and relative URIs. The library will load external 'http' and 'file' URI schemes if the URI is not explicitly defined in the schema, and will treat all other URIs as internal references. As for format, the library does not explicitly enforce that the instance value matches the constraints of a format. The draft spec explicitly states that validators are not required to enforce these rules and that the 'format' attribute is to be used mostly as an inference tool by consumers of data that adhere to a JSON schema. There are probably a few more things that need to be ironed out in this library; however it is pretty simple to add / remove features and declare new schemas. I will be moving the library into its first major release once the JSON schema is finalized past the draft stage and proper testing has been performed. |
Oh thanks!
Oh! I overlooked. I misunderstood that JSON Schema spec requires completely implementation of "format". |
The spec says that the schema is self validating, but when I try using your library, I get this error:
The text was updated successfully, but these errors were encountered: