FasterXML / FasterXML/jackson-databind

JSON5: Provide a way to read/write a comment using `JsonNode`

Open
#5,377 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.7k
Forks
1.5k
Avg merge
3d 6h
Merged PRs (30d)
28

Description

I'd like to parse JSON5 containing comments. `JsonReadFeature#ALLOW_JAVA_COMMENTS` ignores comments when deserializing a JSON into a `JsonNode`.
https://github.com/FasterXML/jackson-core/blob/0fbb52961c5092d7d1f8e8f620b719f9eff48fcd/src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java#L2521-L2523
As a result, we lose the comment information and cannot read/recover the original content from the parsed `JsonNode`.
A commentable `JsonNode` is useful so as to retrieve the original comment and serialize the JsonNode to JSON5 format.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.