You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is your use case and why do you need this feature?
While developing a bot to extract job data from websites, I needed to handle date and time information in the requests, along with links to the job listings. I expected these common data types to have built-in serializers, akin to those for String or Int, but they were absent. Consequently, having to create serializers for these types in each project becomes a repetitive and burdensome task.
Describe the solution you'd like
Add extension serializers to java.time interfaces and classes
It's worth noting that certain java.time classes may require contextual serializers. Perhaps a ContextualSerializers factory class could be offered for scenarios where serialization remains consistent, but the input formatting varies, such as with java.time.ZonedDateTime.
In the future, it may be beneficial to consider adding extensions to StringFormat that facilitate its conversion to HttpResponse.BodyHandler, as illustrated in this example.
I think it was being discussed in #1931, see also #1806 and #507. In short, this is something that is reasonable to have, but we can't make any serializer for time.* default (because different applications need different purposes), and we currently do not have any mechanisms to globally declare serializers per application module. So the only option we do have for now is a separate library with just serializers that can be used with existing @file:UseSerializers annotations.
What is your use case and why do you need this feature?
While developing a bot to extract job data from websites, I needed to handle date and time information in the requests, along with links to the job listings. I expected these common data types to have built-in serializers, akin to those for String or Int, but they were absent. Consequently, having to create serializers for these types in each project becomes a repetitive and burdensome task.
Describe the solution you'd like
It's worth noting that certain
java.time
classes may require contextual serializers. Perhaps aContextualSerializers
factory class could be offered for scenarios where serialization remains consistent, but the input formatting varies, such as withjava.time.ZonedDateTime
.In the future, it may be beneficial to consider adding extensions to
StringFormat
that facilitate its conversion to HttpResponse.BodyHandler, as illustrated in this example.The text was updated successfully, but these errors were encountered: