Comments (7)
Yes, that seems wrong.
from jackson-modules-java8.
Unfortunately I can not reproduce this against 2.9.2
. But I vaguely remember something like this, which was due to refactoring of type id handling in 2.9. So one thing to check is to make 100% sure that dependencies for jackson-core
(especially) and jackson-databind
are 2.9.2 and not, say, 2.9.0.
(jackson-annotations
is fine to be 2.9.0 -- this jar never changes in patches).
from jackson-modules-java8.
I made a test project for it https://github.com/unintended/localdatetest
All the dependencies are 2.9.2, but it still fails:
$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building localdate-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ localdate-test ---
[INFO] com.jackson.test:localdate-test:jar:1.0-SNAPSHOT
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.2:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.2:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.2:compile
[INFO] \- junit:junit:jar:4.12:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.990 s
[INFO] Finished at: 2017-12-07T11:59:41+03:00
[INFO] Final Memory: 14M/309M
[INFO] ------------------------------------------------------------------------
The strange thing is that in console log it's logged as double and triple brackets:
testLocalDateSerialization(com.jackson.test.ObjectMapperTest) Time elapsed: 0.299 sec <<< FAILURE!
org.junit.ComparisonFailure: expected:<...va.time.LocalDate":[[2017,12,5]]}}> but was:<...va.time.LocalDate":[[[2017,12,5]]]}}>
In IDEA still:
org.junit.ComparisonFailure:
Expected :{"localDate":[2017,12,5],"object":{"java.time.LocalDate":[2017,12,5]}}
Actual :{"localDate":[2017,12,5],"object":{"java.time.LocalDate":[[2017,12,5]]}}
from jackson-modules-java8.
2.8.10 works well btw
from jackson-modules-java8.
Hmmh. Well that is odd. Will try to see if I can reproduce it locally then.
As I said, problem itself does sound familiar, I just do not remember where. Another thing that is different is inclusion of parameter names module, but I don't think that should matter here.
from jackson-modules-java8.
It’s just a copy-paste from my main project, so I forgot to remove parameter module from dependencies, but during experiments I tried to remove it, and it didn’t make any difference.
from jackson-modules-java8.
Oh lol. My test failed to fail because it wasn't being run. Once that is resolved it fails as expected.
And I think I can see why now; it is not overriding default polymorphic type handling from base implementation, which assumers scalar representation.
from jackson-modules-java8.
Related Issues (20)
- `LocalDateTime` serialization issue with custom-configured `LocalDateTimeSerializer` HOT 12
- InstantDeserializer fails to parse negative numeric timestamp strings for pre-1970 values. HOT 2
- Custom java time module ignored after upgrade to 2.16 HOT 3
- `Optional` deserialization, serialization ignore `contentConverter` HOT 1
- NPE when serializing a `LocalDate` or `LocalDateTime` using `AsDeductionTypeSerializer` HOT 9
- OffsetTimeSerializer not writing seconds for time object like 15:30:00Z (where seconds is 00) HOT 2
- Implicit name provided by `ParameterNamesModule` overridden by "incomplete" `@JsonProperty` HOT 1
- I don't deserialize java 8 date/time type `java.time.Instant` HOT 2
- ZonedDateTime not serialised as UTC by default HOT 1
- Instants get not deserialized as expected sometimes HOT 2
- Only `DateTimeFormatter.ISO_OFFSET_DATE_TIME` accepted by `ZonedDateTimeKeyDeserializer` HOT 1
- Can't deserialize OffsetDateTime.MIN: Invalid value for EpochDay
- Date and time serialization are very inconsistent HOT 3
- Absent nested optional shennanigans HOT 1
- The serialization of an object of type LocalDate did not record its type HOT 2
- Q on Serializing java.time dates w/o nano parts HOT 2
- Add javaTimeModule.addDeserializer(String.class,...) Error parsing generated later HOT 4
- java.lang.NoSuchFieldError: READ_DATE_TIMESTAMPS_AS_NANOSECONDS after update to 2.16 or 2.17 HOT 3
- Parameter names: Class with a single-parameter implicit constructor fails deserialization, works if more (unused) parameters are added HOT 3
- Inconsistent BeanPropertyDefinition#couldDeserialize and actual deserialization behavior HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-modules-java8.