[ 
https://issues.apache.org/jira/browse/AVRO-3601?focusedWorklogId=800260&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-800260
 ]

ASF GitHub Bot logged work on AVRO-3601:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Aug/22 10:19
            Start Date: 12/Aug/22 10:19
    Worklog Time Spent: 10m 
      Work Description: KalleOlaviNiemitalo commented on code in PR #1826:
URL: https://github.com/apache/avro/pull/1826#discussion_r944321962


##########
lang/c++/test/unittest.cc:
##########
@@ -452,7 +457,14 @@ struct TestSchema {
                                             customAttributes);
         std::string expectedJsonWithCustomAttribute =
         "{\"type\": \"record\", \"name\": \"Test\",\"fields\": "
-        "[{\"name\": \"f1\", \"type\": \"long\",\"extra field\": \"1\"}]}";
+        "[{\"name\": \"f1\", \"type\": \"long\", "
+        "\"arrayField\": \"[1]\", "
+        "\"booleanField\": \"true\", "
+        "\"mapField\": \"{\\\"key1\\\":\\\"value1\\\", 
\\\"key2\\\":\\\"value2\\\"}\", "
+        "\"nullField\": \"null\", "
+        "\"numberField\": \"1.23\", "
+        "\"stringField\": \"\\\"field value with \\\"double quotes\\\"\\\"\""

Review Comment:
   As in <https://github.com/apache/avro/pull/1821#discussion_r943586881>, I 
think this should be
   
   ```suggestion
           "[{\"name\": \"f1\", \"type\": \"long\", "
           "\"arrayField\": [1], "
           "\"booleanField\": true, "
           "\"mapField\": {\"key1\":\"value1\", \"key2\":\"value2\"}, "
           "\"nullField\": null, "
           "\"numberField\": 1.23, "
           "\"stringField\": \"field value with \\\"double quotes\\\"\""
   ```
   
   i.e. CustomAttributes.printJson should assume that the `std::string` values 
are already in JSON format, and write them out without adding any quotation 
marks around them or backslashes within them.  Likewise, callers of 
CustomAttributes::addAttribute (especially in Compiler.cc) should provide a 
JSON-format `std::string`.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 800260)
    Time Spent: 3h 10m  (was: 3h)

> C++ API header contains breaking include
> ----------------------------------------
>
>                 Key: AVRO-3601
>                 URL: https://issues.apache.org/jira/browse/AVRO-3601
>             Project: Apache Avro
>          Issue Type: Bug
>            Reporter: Mike Ruffing
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Problem file/line: 
> https://github.com/apache/avro/blob/master/lang/c%2B%2B/api/CustomFields.hh#L24
> Steps to reproduce:
>  * Download AVRO version 1.11.1
>  * Execute {{./build.sh install}} (from the {{lang/c++ directory}})
>  * Navigate to the installed {{include}} directory
>  * Verify this file (and path) {{"../impl/json/JsonDom.hh"}} does NOT exists 
> in the installed {{include}} directory
> Relates to: https://issues.apache.org/jira/browse/AVRO-3547



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to