Thanks Tatu !
So in that case , is it possible to write custom yaml deserializer in
jackson (to read the comments) just like we write custom Json deserializer ?
like
public class CustomDeserializer  extends JsonDeserializer<SortedMap<String,
Object>> {}

On Sat, 4 Jul 2020 at 05:28, Tatu Saloranta <[email protected]> wrote:

> 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
> <https://groups.google.com/d/msgid/jackson-user/CAGrxA241dJ7Oex5P86ddG-AeX_oY6h5sYLCxNYSK3LpEb3shCg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAGH8rExm%3D8NwEsGNXVaU0bysTYOHtjrFQJ8%3DD390icQ0Ao5yPw%40mail.gmail.com.

Reply via email to