[
https://issues.apache.org/jira/browse/LOG4J2-3104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17359763#comment-17359763
]
Avinash Tripathy commented on LOG4J2-3104:
------------------------------------------
Sorry, Now I have attached the result also.
Please check the additionalData attribute.
> '{}' is not able to be appended with the empty attribute in json.
> -----------------------------------------------------------------
>
> Key: LOG4J2-3104
> URL: https://issues.apache.org/jira/browse/LOG4J2-3104
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.11.2
> Reporter: Avinash Tripathy
> Priority: Major
>
> {code:java}
> <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
> <dependency>
> <groupId>org.apache.logging.log4j</groupId>
> <artifactId>log4j-api</artifactId>
> <version>2.11.2</version>
> </dependency>{code}
>
> *sample code:*
>
>
> {code:java}
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> public class Log4jIssue {
> private static final Logger LOGGER =
> LogManager.getLogger(Log4jIssue.class);
> public static void main(String[] args) throws Exception {
> String inputJson =
> "{\"metadata\":{\"Id\":\"191812\",\"operation\":\"UPDATE\",\"reason\":null}" +
>
> ",\"data\":{\"producerType\":null,\"producerName\":\"Test\",\"village\":null,\"additionalData\":{},"
> +
>
> "\"producerMiddleName\":\"\",\"producerLastName\":\"K\",\"producerGender\":\"FEMALE\",\"producerSalutation\":null}}";
> LOGGER.info("inputJson : {}", inputJson);
> }
> }
> {code}
>
> *result*
>
> {code:java}
> {
> "metadata": {
> "Id": "191812",
> "operation": "UPDATE",
> "reason": null
> },
> "data": {
> "producerType": null,
> "producerName": "Test",
> "village": null,
> "additionalData": {
> "metadata": {
> "Id": "191812",
> "operation": "UPDATE",
> "reason": null
> },
> "data": {
> "producerType": null,
> "producerName": "Test",
> "village": null,
> "additionalData": {
>
> },
> "producerMiddleName": "",
> "producerLastName": "K",
> "producerGender": "FEMALE",
> "producerSalutation": null
> }
> },
> "producerMiddleName": "",
> "producerLastName": "K",
> "producerGender": "FEMALE",
> "producerSalutation": null
> }
> }
> {code}
>
>
> *Issue*: additionalData attribute is getting modified with complete json
> instead of empty.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)