Hello all,
  I thought I would run this by you before I created a Jira ticket.

The processor attributesToJSON does not create a JSON document with key/values 
in the same order as provided in the processor's configuration.

Example:
  AttributesList: computationName,computationType,strategyName

Output:
{
  " strategyName" : "blue",
  " computationType" : "21DC8X32",
  " computationName" : "453d6c4f-fdd-e611-80c9-0050233e88"
}

This behavior is coming from the datatype used in the attributesToJSON 
processor:

    protected Map<String, String> buildAttributesMapForFlowFile(FlowFile ff, 
String atrList,
                                                                boolean 
includeCoreAttributes,
                                                                boolean 
nullValForEmptyString) {

        Map<String, String> atsToWrite = new HashMap<>();

        . . .
    }

Using another datatype that preserved order would correct this behavior.  The 
JSON specification does mention that the object list is order independent.  
This does not necessarily mean we should cause the disorder though.

Should we create a JIRA ticket and solution for this?

Thanks,
Paul Gibeault

Reply via email to