Comments (9)
Looking into it.
from vertx-config.
@ufoscout I've tried to reproduce it in Java and in Kotlin but failed. Can you provide a reproducer?
from vertx-config.
@cescoffier
After some investigations, I found that the issue happens only when the default Json.mapper is set to the Jackson mapper for Kotlin. E.g., this causes the bug:
Json.mapper = com.fasterxml.jackson.module.kotlin.jacksonObjectMapper()
Json.prettyMapper = com.fasterxml.jackson.module.kotlin.jacksonObjectMapper()
At this point I am not sure what/where is the issue since the mapper works fine everywhere else.
from vertx-config.
@ufoscout would you mind try this on your mappers:
// custom types
module.addSerializer(JsonObject.class, new JsonObjectSerializer());
module.addSerializer(JsonArray.class, new JsonArraySerializer());
// he have 2 extensions: RFC-7493
module.addSerializer(Instant.class, new InstantSerializer());
module.addSerializer(byte[].class, new ByteArraySerializer());
and see if that fixes the problem ?
from vertx-config.
@vietj
Yes, indeed adding those serializers fixes the issue. However, they are declared as private into the Json class, so there is no way to reuse them.
Nevertheless, I found a better solution. In fact, instead of overriding the Json mappers, I can extend them by adding the KotlinModule:
Json.mapper.registerModule(KotlinModule())
Json.prettyMapper.registerModule(KotlinModule())
This is more maintainable and works as expected.
Probably this should be reported somewhere in the kotlin support documentation.
from vertx-config.
@ufoscout thanks for reporting, I think actually we will add documentation in vertx-core as this is a not only kotlin issue.
from vertx-config.
@vietj
Why do you have a custom serializer for the Instant class? Shouldn't you instead register the JavaTimeModule provided by Jackson?
from vertx-config.
@ufoscout I think @pmlopes can elaborate on it
from vertx-config.
Closing this issue, not related to vert.x config.
from vertx-config.
Related Issues (20)
- java.lang.IllegalArgumentException: unknown configuration store implementation: spring-config-server HOT 1
- Sometimes VaultConfigStoreTestBase#testWithRevokedRootToken fail HOT 2
- ConfigRetriever uses data type double for Integer env values HOT 1
- Invalid docs for ConfigRetriever HOT 2
- ConfigRetriever possibly responsible for 'Multi threaded access request' failures HOT 4
- Update to typesafe config 1.3.4
- ConfigRetriever doesn't load properties file + small typo in factory name HOT 9
- config().getString is not perfect HOT 8
- Allow hierarchical parsing for system properties
- Allow hierarchical parsing of properties files in directory config store
- JavaScript, Kotlin, Groovy and Ruby config documentation not available HOT 1
- Support for kubernetes as a vault auth backend
- Vertx 4.2.1 Redis ConfigReader issue
- support CONFIG_FORCE_ environment variables with HOCON config file format HOT 1
- Update Doc relate to additional formats or move implementations to core-lib META-INF/services HOT 2
- Feature request: Support for POST in HTTP Config Retriever
- Config retriever doesn't get config for spring-cloud-config with HTTPS HOT 4
- Cannot read config file when upgrading to 4.3.3 HOT 4
- Remove databind use vault
- Updating Snakeyaml to v2 has a breaking API 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 vertx-config.