-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CsvMapper with ObjectMapper in the same Spring project #489
Comments
(1) Ok so I cannot comment on Spring side of things -- although do note there is also (2) Unfortunately there is no such mechanism. It is something I have sometimes thought about, but have no good solution or ideas. (3) Is tricky as well. I think your approach is reasonable, although the best (I think) would be to isolate configuration code in something reusable and call that on both mappers and not try to copy settings of an FasterXML/jackson-databind#3212 which would work for some cases, but I don't think it'd help here, as Given this, I think your approach is not unreasonable. |
(1) It's surprise to me that you can not comment Spring side things, Spring depend on jackson very heavily as I know. (2) Sad to heard that 😢 (3) I think you are right, but I can't do that because my ObjectMapper is from Spring auto config as you can see the ref. |
On (1)... I develop Jackson, not Spring, so I do not really know much about how it works. I do know a lot about Jackson. Not sure why this would be surprising... Unless you were thinking I added Jackson-support in Spring? I didn't, there are lots of clever folks within Spring project who did that. :) (2) Naming of annotations with (3) yeah, I can see how it is problematic as initialization/config by the framework is not something you have control over. You can try using approach you are; I am only cautioning that there may be rough edges as direct setting (overriding) of |
(1)
Yes....I thought such big level project will at least discuss with the author, instead just import it directly like us. :D (3) |
(1) (on Spring) I do interact with Spring folks, but it definitely is more about them reporting bugs; I am just an occasional Spring (Boot) user, not developer. I don't have bandwidth to dig deep into implementations of any of frameworks (same is true about Quarkus, f.ex). (3) yup! |
I am trying jackson CSV feature, but I have some question:
Seems
CsvMapper
extendsObjectMapper
.I think it's not possible define CsvMapper as Bean without touch Spring ObjectMapper bean?
CSV feature reuse many JSON annotation, is it possible have different config for CSV/JSON in the same POJO?
For example:
If I want ignore a field in CSV only, I put
@JsonIgnore
on the field.But it will affect
ObjectMapper
process that POJO too.Use the same config for both CSV and Json.
Mainly for have same behave for convert Java 8 time, locale...etc
But I don't find something like
setConfig(json.getConfig())
, so I try to config one by one by myself.Is this enough?
I don't find any issue for now though.
The text was updated successfully, but these errors were encountered: