Comments (4)
Jackson does not consider Maps POJOs, so this is not expected to work the way described.
But there is SerializationFeature.WRITE_NULL_MAP_VALUES
, which should work.
Can you see whether disabling that feature works? (and if not, maybe update problem description).
from jackson-module-scala.
Hi @cowtowncoder
Thanks for your reply, it works!
from jackson-module-scala.
It isnt working for me :(
mapper.setDateFormat(new SimpleDateFormat(DATE_FORMAT));
mapper.setSerializationInclusion(Include.NON_EMPTY);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
from jackson-module-scala.
NON_NULL
check will not work, since "Optionals" (Scala's, JDK8's) are not considered null
, but rather "absent".
Furthermore, however, handling as Bean/POJO/POSO property differs from inclusion in Map.
So this:
FasterXML/jackson-databind#818
would need to be implemented to support filtering out of Option
from Maps, as well as some code changes in Scala map serializers (since they are not java.util.Map
s).
If functionality is desired, I would suggest filing a new issue, as NON_NULL
will not work so description here is bit off.
from jackson-module-scala.
Related Issues (20)
- support deserializing Scala Iterators HOT 1
- Release 2.15.2 HOT 2
- Dependency on .class and .tasty files causes footprint bloat for GraalVM NativeImage HOT 5
- Failure to deserialise scala Map when default typing is activated HOT 10
- DefaultScalaModule breaks deserialization of java classes HOT 13
- 2.16 jackson-databind deserialization changes have broken support for the scala.util.Either class HOT 1
- Collection of case classes deserialized as Collection of Map2 HOT 4
- Release 2.15.3 HOT 4
- Release 2.16.0-rc1 HOT 1
- error when deserializing yaml HOT 2
- Release 2.16.0 HOT 2
- release jackson-module-scala v2.12 for Scala 2.10 HOT 2
- Release 2.16.1 HOT 1
- Update `2.17` branch to `2.17.0-rc1-SNAPSHOT` HOT 2
- Release 2.15.4 HOT 1
- Release 2.17.0-rc1 HOT 1
- Release 2.16.2 HOT 2
- Release 2.17.0 HOT 2
- Performance regression with 2.17.x HOT 32
- Update 2.17 release note wiki with Scala module 2.17 fixes HOT 4
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-module-scala.