-
-
Notifications
You must be signed in to change notification settings - Fork 12
Generalize JSON schema handling code #14
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
Conversation
Previously, the JSON schema handling code was all under the libraryproperties package, and written specifically for use in validating library.properties against the JSON schema. However, there will be be a need to work with schemas in other contexts, most immediately for writitng the schema tests, but also likely when additional schemas are added for the other Arduino project configuration data files. So it will be helpful to have the general purpose schema handling code in a dedicated package, leaving only the library.properties-specific aspects of the code in the libraryproperties package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nitpicks.
This allows the schemas path to be specified by the caller.
Rather than determining the schemas path once at initialization and storing it in a package variable, determine it on demand when the getter function is called.
I don't foresee any need for this function outside the `schema` package, so it doesn't seem necessary to export it.
I have pushed another commit to move It turns out that I am still going to need to convert the schema file path to URI even after switching to the new JSON schema validation package. I don't foresee any need for this function outside the |
Previously, the JSON schema handling code was all under the
libraryproperties
package, and written specifically for usein validating library.properties against the JSON schema. However, there will be be a need to work with schemas in other
contexts, most immediately for writing the schema tests, but also likely when additional schemas are added for the
other Arduino project configuration data files.
So it will be helpful to have the general purpose schema handling code
in a dedicated package, leaving only the library.properties-specific aspects of the code in the
libraryproperties
package.
NOTE: the next PR will change to a different JSON schema package, which will involve changing almost all of the code in the
schema
package, as well as its API and removing theutil
package. So this PR is mostly just about moving the schema handling code to a dedicated package, as doing that in combination with the package change would not be atomic. I don't think it's necessary to spend a lot of time on a detailed analysis of the doomed code itself (which is mostly just being moved from one package to another anyway.