Unable to bind a model with LocalDate property
See original GitHub issueIf a model has a property LocalDate
(Noda Time), Bind<T>
silently creates a new instance of T
with all properties initialized with their default values.
Reproduced with DefaultJsonModelBinder
, but not NewtonsoftJsonModelBinder
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Unable to LocalDate Property on ModelBind with Json.Net ...
I have a model class with a single property in it. The property is of type "LocalDate". No matter, what I do the...
Read more >Fail to binding LocalDate without @ModelAttribute
I added @DateTimeFormat for binding String argument to LocalDate, but without @ModelAttribute the variable startDate did not binded and was null ...
Read more >Property Binding in Spring Boot 2.0
Since the first release of Spring Boot, it has been possible to bind properties to classes by using the @ConfigurationProperties annotation.
Read more >How to persist LocalDate and LocalDateTime with JPA 2.1
The LocalDate and LocalDateTime classes are not supported by JPA and Hibernate. This can be changed by implementing an attribute converter for them....
Read more >Working with Date Parameters in Spring
In this short tutorial, we'll learn how to accept Date, LocalDate, and LocalDateTime parameters in Spring REST requests, both at the request ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ritasker Thank you very much for your help! You are right.
For some reason even just switching to Carter’s
NewtonsoftJsonResponseNegotiator
andNewtonsoftJsonModelBinder
was enough:Thanks, that link led me down the right path. The
JsonOptions
used when deserialising request contents can now be configured to work for NodaTime types like this:This blog post deserves a link and a quote: