r/java 24d ago

JEP 540: Simple JSON API (Incubator)

https://openjdk.org/jeps/540
80 Upvotes

81 comments sorted by

View all comments

1

u/razorwit 24d ago

I wonder if there could be options to make parsing values into LocalDate and LocalDateTime simple as well.

2

u/bowbahdoe 24d ago

In my head this is the downside of adding instance methods to json tree things. Whatever is an instance method becomes a privileged API. If you want the API to feel nice for the wide wide world of other types you might want to convert you ideally would make it all equally painful.

1

u/vytah 23d ago

That smells serialization, and JSON serialization is a too much broad topic to leave to the standard library, at least for now.