Skip to content

Allow full JSON pointers in schema validation result parsing functions #186

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 1 commit into from
Jun 11, 2021
Merged

Allow full JSON pointers in schema validation result parsing functions #186

merged 1 commit into from
Jun 11, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 10, 2021

When used with the "properties" data format, and most especially with the flat format of the library.properties file that was an initial focus of the project's development, JSON pointers are not a terribly intuitive way to refer to a data path.

In this context, it seemed sensible to pre-fill the root prefix on the instance pointer argument of the JSON schema validation result parsing functions. However, now that those functions are being used with the JSON formatted package index data file, the requirement to omit this prefix from the JSON pointers is very confusing.

Since the argument is already a regex, it's simple to allow both styles of instance data path references.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 10, 2021
@per1234 per1234 requested review from silvanocerza and umbynos June 10, 2021 21:59
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2021

Codecov Report

Merging #186 (25abd26) into main (3427584) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #186   +/-   ##
=======================================
  Coverage   84.45%   84.45%           
=======================================
  Files          43       43           
  Lines        3082     3082           
=======================================
  Hits         2603     2603           
  Misses        380      380           
  Partials       99       99           
Flag Coverage Δ
unit 84.45% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/rule/schema/parsevalidationresult.go 93.25% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3427584...25abd26. Read the comment docs.

When used with the "properties" data format, and most especially with the flat format of the library.properties file that
was an initial focus of the project's development, JSON pointers are not a terribly intuitive way to refer to a data path.

In this context, it seemed sensible to pre-fill the root prefix on the instance pointer argument of the JSON schema
validation result parsing functions. However, now that those functions are being used with the JSON formatted package
index data file, the requirement to omit this prefix from the JSON pointers is very confusing.

Since the argument is already a regex, it's simple to allow both styles of instance data path references.
@per1234 per1234 merged commit 7dc9eae into arduino:main Jun 11, 2021
@per1234 per1234 deleted the full-json-pointers branch June 11, 2021 07:19
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants