On Fri, Jul 3, 2020 at 4:25 PM Rahul Kumar <[email protected]> wrote:
> Hi geeks,
> I have a Yaml like below as below:
> ---
> # mY yaml variable
> var1: ok
>
> I dont want to ignore comments while serialization and i wanted to take
> them into account ? How can i do that ?
> My code is like below (which ignores call comments)
>
> ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
>
> Object user = mapper.readValue(yamlfile,new TypeReference<Map<String,
> String>>() {});
>
>
> I want to use this feature to read some meta data written on top of Yaml
> variables in the form of comments ? Does jackson allows this ?
>
>
>
There is no way to currently add comments with Jackson YAML generator.
Comments are ignored when reading content (I think SnakeYAML automatically
discards them) and there is no current mechanism to inject them on
serialization side.
-+ Tatu +-
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/CAGrxA241dJ7Oex5P86ddG-AeX_oY6h5sYLCxNYSK3LpEb3shCg%40mail.gmail.com.