Skip to content

Add tests for invalid and uncommon filter literal values#89

Merged
gregsdennis merged 2 commits into
jsonpath-standard:mainfrom
Marcono1234:filter-values
Aug 3, 2024
Merged

Add tests for invalid and uncommon filter literal values#89
gregsdennis merged 2 commits into
jsonpath-standard:mainfrom
Marcono1234:filter-values

Conversation

@Marcono1234

@Marcono1234 Marcono1234 commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

Generally for number literals since JSONPath uses the same syntax as JSON, test values from regular JSON libraries or JSON test suites could be used, for example https://github.com/nst/JSONTestSuite.

So if you have anything else in mind which should be covered, please let me know or feel free to add it yourself.

@gregsdennis gregsdennis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think it needs a few more cases.

Thanks for the work.

Comment thread tests/filter.json
Comment thread tests/filter.json
Comment thread tests/filter.json

@gregsdennis gregsdennis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some remarks.

@f3ath f3ath left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Revealed a few issues in my implementation.

@gregsdennis gregsdennis merged commit a52c6cc into jsonpath-standard:main Aug 3, 2024
@Marcono1234 Marcono1234 deleted the filter-values branch August 3, 2024 20:40
@He-Pin

He-Pin commented Dec 15, 2024

Copy link
Copy Markdown

Why treat +1 as an invalidate , I think we can just create it as valid.

@Marcono1234

Copy link
Copy Markdown
Contributor Author

Why treat +1 as an invalidate , I think we can just create it as valid.

Similar to #90 (comment), because that is how it is defined in the JSONPath standard: A leading + is not allowed for number literals in filter selectors, see https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1-10.

(This is also consistent with how JSON numbers are defined in the JSON specification.)

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

Successfully merging this pull request may close these issues.

4 participants