Skip to content
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

Fix #116: add read/write support for java.nio.file.Path #117

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

cowtowncoder
Copy link
Member

No description provided.

@cowtowncoder cowtowncoder merged commit 11d0611 into 2.17 Feb 17, 2024
4 checks passed
@cowtowncoder cowtowncoder deleted the tatu/2.17/116-support-path-type branch February 17, 2024 04:20
@jhonnen
Copy link

jhonnen commented Feb 17, 2024

Should a Path really be serialised as an URI? I would have assumed you could interchange Path and File while reading and writing the same JSON string.

@cowtowncoder
Copy link
Member Author

@jhonnen I was looking at what Jackson databind does and followed that. But I am open to counter arguments -- and PRs would be welcome for changed behavior (and tests).
We can easily change it now before this gets released in 2.17.

@jhonnen
Copy link

jhonnen commented Feb 19, 2024

Following Jackson databind is a good point. I just think it's confusing that

{ "x": "/some/path" }

can only be deserialized as File but not as Path.

@cowtowncoder
Copy link
Member Author

@jhonnen As I said, I am totally open to alternative handling, since I do not actually have use for this myself.
So if you feel different handling makes sense, I would really appreciate a PR for improvement (just so I do not misunderstand some point; unit test showing exactly expected behavior).

And in fact use of Path.toString() would sort of go with least-surprise approach (even if less stable for round-tripping).

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.

2 participants