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

questionable schema #4

Open
patefacio opened this issue Sep 16, 2013 · 3 comments
Open

questionable schema #4

patefacio opened this issue Sep 16, 2013 · 3 comments

Comments

@patefacio
Copy link
Contributor

Maybe my parser is not correct, but to get my code to parse some of the schema I had to make a few changes, shown below. I honestly did not try to understand the details of these schema, but was just trying to grab some valid schema on the net to pass through a visualizer I'm working on. These schema and a couple more can be viewed at: https://github.com/patefacio/json_schema/tree/master/dot_samples/schemaout

Hopefully these changes are helpful, but I'm not sure.

diff dot_samples/original/avro-schema.json dot_samples/schemas/avro-schema.json 
32,33c32,33
<                 "name": { "$ref": "#/definitions/nameOrNamespace" },
<                 "nameOrNamespace": { "$ref": "#/definitions/namespace" },

---
>                 "name": { "$ref": "#/definitions/name" },
>                 "nameOrNamespace": { "$ref": "#/definitions/nameOrNamespace" },
48,49c48,49
<                 "name": { "$ref": "#/definitions/nameOrNamespace" },
<                 "nameOrNamespace": { "$ref": "#/definitions/namespace" },

---
>                 "name": { "$ref": "#/definitions/name" },
>                 "nameOrNamespace": { "$ref": "#/definitions/nameOrNamespace" },
101,102c101,102
<                 "name": { "$ref": "#/definitions/nameOrNamespace" },
<                 "nameOrNamespace": { "$ref": "#/definitions/namespace" },

---
>                 "name": { "$ref": "#/definitions/name" },
>                 "nameOrNamespace": { "$ref": "#/definitions/nameOrNamespace" },
110a111,115
>         "name": {
>             "description": "what a name can be",
>             "type": "string",
>             "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
>         },
bash-3.2$ diff dot_samples/original/json-home.json dot_samples/schemas/json-home.json 
95c95
<                     "uniqueItems": "true",

---
>                     "uniqueItems": true,
102c102
<                     "uniqueItems": "true",

---
>                     "uniqueItems": true,
114c114
<                     "uniqueItems": "true",

---
>                     "uniqueItems": true,
bash-3.2$ diff dot_samples/original/crs.json dot_samples/schemas/crs.json 
32c32
<         "linkObject": {

---
>         "linkedObject": {
47c47
<         "linkedCRS": {

---
>         "linkedCrs": {
@fge
Copy link
Owner

fge commented Sep 24, 2013

These are a lot of schemas in the link you posted. Can you point out a specific example?

@patefacio
Copy link
Contributor Author

There are three that I modified with the diff shown in the message:

crs.json: pretty obvious issues - simple misspellings
json-home.json: I think the uniqueItems needed to be a bool not string rep of bool
avro-schema.json: I don't know if I understand the schema, but I think it is invalid - so I took a stab at fixing

@fge
Copy link
Owner

fge commented Sep 24, 2013

Uhm, OK. I have quite some difficulty understanding non "unified" diffs. You are quite right about crs.json and json-home.json. Would you mind making a pull request separating the changes from both aforementioned schemas and the changes to avro-schema.json? In the latter, I'd appreciate a detailed commit message and links to the avro schema spec to understand what is wrong.

Thanks!

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

No branches or pull requests

2 participants