-
-
Notifications
You must be signed in to change notification settings - Fork 12
Add JSON schema for package index #183
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
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #183 +/- ##
==========================================
- Coverage 84.45% 84.37% -0.09%
==========================================
Files 43 43
Lines 3017 3078 +61
==========================================
+ Hits 2548 2597 +49
- Misses 375 381 +6
- Partials 94 100 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
silvanocerza
approved these changes
Jun 7, 2021
…finitions file Since this was previously only used for library.properties, it was in that schema file, but now it will be shared with the package index schema, and so should be in the appropriate file for that usage.
The JSON schema validation result parsing infrastructure provides general purpose capabilities for identifying the instance and schema pointers related to a validation failure. However, when a specific type of schema keyword is used in multiple places, it is convenient to create a dedicated wrapper function to facilitate that use case. Previously the "format" keyword was only used for one thing in the library.properties schemas, which made it not worth a convenience function. The package index schema uses "format" keyword also, so it now becomes worthwhile having a convenience parsing function for it.
The JSON schema validation result parsing infrastructure provides general purpose capabilities for identifying the instance and schema pointers related to a validation failure. However, when a specific type of schema keyword is used in multiple places, it is convenient to create a dedicated wrapper function to facilitate that use case. Although present in the schemas for the sake of completeness, there are no rules for checking schema validation results for the "type" keyword because the Arduino "properties" data format treats all values as strings. For this reason, there was no convenience function for this keyword. Due to using the JSON data format, which allows for any type, there will be type checking schema-based rules for the package index project type. So it now becomes worthwhile having a convenience parsing function for the "type" keyword.
…sing The JSON schema validation result parsing infrastructure provides general purpose capabilities for identifying the instance and schema pointers related to a validation failure. However, when a specific type of schema keyword is used in multiple places, it is convenient to create a dedicated wrapper function to facilitate that use case. Previously the "additionalProperties" keyword was not used in any rules, which made it not worth a convenience function. The package index schema uses the "additionalProperties" keyword, so it now becomes worthwhile having a convenience parsing function for it.
This schema defines the data structure of the Arduino package index at three compliance levels: - permissive: the minimum accepted format. This allows for a gradual deprecation following specification changes. - specification: the format as defined in the official specification - strict: best practices Helper functions for reading package indexes and validating them against the schema are added, at this point for use in the tests, but also for the schema-based rules to come.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This schema defines the data structure of the Arduino package index at three compliance levels:
Helper functions for reading package indexes and validating them against the schema are added, at this point for use in
the tests, but also for the schema-based rules to come.