Skip to content

clean up misc from retro-review of #101 #105

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 6 commits into from
Jun 8, 2025
Merged

clean up misc from retro-review of #101 #105

merged 6 commits into from
Jun 8, 2025

Conversation

asmello
Copy link
Collaborator

@asmello asmello commented Feb 17, 2025

I changed my mind on removing serde as a default feature. It is a heavy dependency to bring by default, but it's easy enough to disable the default features, and I do see the "common" use case for jsonptr involving serde_json. Also I guess Diagnose makes sense when you consider that the error it converts isn't yet a Report, even though it implements Diagnostic. Perhaps it's Diagnostic that requires reconsidering.

Changes I'm pushing forward:

  • make diagnostic::Label::new private
  • add docs do validate_bytes
  • remove NoLeadingSlash struct
  • update delete.rs docs
  • deprecate ResolveError

Left for standalone PRs:

  • Migrate index::ParseIndexError and token::EncodingError to the new error system.
  • Seal Diagnose

@asmello asmello requested a review from chanced February 17, 2025 20:36
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.9%. Comparing base (29840e7) to head (865aee2).
Report is 1 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/delete.rs 99.4% <ø> (ø)
src/diagnostic.rs 77.9% <ø> (ø)
src/pointer.rs 96.0% <ø> (+0.4%) ⬆️
src/resolve.rs 93.6% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asmello
Copy link
Collaborator Author

asmello commented Feb 17, 2025

This is technically breaking, as reported by the semver check, but nobody would be using the removed type because it's useless / not referenced anywhere.

@asmello asmello mentioned this pull request Feb 17, 2025
@chanced
Copy link
Owner

chanced commented Feb 25, 2025

make diagnostic::Label::new private

This one needs to be public in order for users to implement Diagnostic properly. Users can bring their own errors for Assign and Resolve but they have to implement Diagnostic.

remove NoLeadingSlash struct

Ugh, thank you. Sorry I left that in.

@asmello
Copy link
Collaborator Author

asmello commented Feb 26, 2025

This one needs to be public in order for users to implement Diagnostic properly. Users can bring their own errors for Assign and Resolve but they have to implement Diagnostic.

Ah, interesting, but do we expect users to implement Diagnostic themselves?

@chanced
Copy link
Owner

chanced commented Mar 2, 2025

I dont necessarily expect it - I doubt anyone is implementing Assign and Resolve for custom languages or data structures - but it is possible and in an effort to facilitate that, the traits were designed so that implementations bring their own error types for resolve::Resolve and assign::Assign.

@asmello
Copy link
Collaborator Author

asmello commented Mar 2, 2025

You know what, you're completely right. I lost track of what those traits were for, it does make sense that people can use jsonptr with their own types. Although, now that I think about it, it also only makes sense for JSON-like data structures.

I'll update this PR and remove that change. Thanks!

@chanced
Copy link
Owner

chanced commented Jun 3, 2025

it also only makes sense for JSON-like data structures.

So YAML's integer based maps were what I had in mind when I created it. I didn't look to see whether or not serde_yaml supported the structure but figured if a crate ever came along that did, they'd need their own error.

In retrospect, it was likely overkill and have made the errors themselves a bigger pain than needed.

@asmello
Copy link
Collaborator Author

asmello commented Jun 8, 2025

Since you haven't explicitly nacked, and other than the deprecation this is mostly docs changes, I'm going to proceed with merging. 👍

@asmello asmello merged commit d5136ef into main Jun 8, 2025
18 of 19 checks passed
@asmello asmello deleted the cleanup branch June 8, 2025 18:35
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.

3 participants