Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

json updates to 6 files in public/schemas#88

Merged
wanderingstan merged 2 commits intoOriginProtocol:masterfrom
nsimon:master
Mar 2, 2018
Merged

json updates to 6 files in public/schemas#88
wanderingstan merged 2 commits intoOriginProtocol:masterfrom
nsimon:master

Conversation

@nsimon
Copy link
Contributor

@nsimon nsimon commented Feb 23, 2018

  1. Updated $schema":"http://json-schema.org/draft-04/schema#" to
    "$schema":"http://json-schema.org/draft-06/schema#"

  2. Changed types on all min/max field values from string to integer.

Original draft-04 was throwing an error in my linux Firefox (v58.0.2) dev console:
"Error: no schema with key or ref".

I changed the source json $schema values to use draft-06, and then saw a more useful error message. Can't recall the exact error syntax, but it referred to all of the min/max fields being invalid string types, which I then fixed to be integers. That solved the issue.

I suspect the original draft-04 schemas were working in other os/browser environments, due to a less stringent JVM running in those browsers. Perhaps the linux Firefox JVM was less forgiving?

Neil

@nsimon
Copy link
Contributor Author

nsimon commented Feb 23, 2018

More (possibly helpful) info.

"Error: no schema with key or ref" -- was thrown when I clicked the Continue button to add an item.

@ryana
Copy link
Contributor

ryana commented Feb 25, 2018

Hey @wanderingstan just FYI I helped Neil put this PR together. I'm not sure on the content of this PR. It seems right on the surface but I don't know enough about the JSON schema stuff just yet to be sure. I mostly just wanted to help Neil to go through the process of submitting a PR. Let us both know what you think when you get around to it.

@tyleryasaka
Copy link
Contributor

To shed some more light on why this error was happening, FWIW:

If you look at our package-lock.json, you'll see that we have a couple packages that have the ajv package as a dependency. ethereumjs-testrpc has version 5.5.2 as a dependency, and react-jsonschema-form and fsevents have version 4.11.8 as a dependency. I think due to this ambiguity different versions were getting loaded in different environments (which is why only some people had this issue). If version 5 was loaded, this causes an error (see the note in ajv's readme). That note has instructions to support draft-04 schemas, but unfortunately there's no way to do that with our usage through react-jsonschema-form at the moment (see this PR).

All that to say, this fix looks good. 😃

@nsimon
Copy link
Contributor Author

nsimon commented Feb 27, 2018

Thanks. and great explanation Tyler! I also saw the ajv version discrepancies (in package-lock.json). It stood out to me, but I didn't really know what to make of it.

@wanderingstan wanderingstan merged commit 141a9b7 into OriginProtocol:master Mar 2, 2018
@wanderingstan
Copy link
Contributor

Thanks for this, @nsimon !

@nsimon
Copy link
Contributor Author

nsimon commented Mar 2, 2018

Hey @wanderingstan glad I could help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants