nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (NIFI-4269) GetMongo should be able to provide pure JSON as well as "extended JSON"
Date Tue, 22 Aug 2017 14:02:00 GMT


ASF GitHub Bot commented on NIFI-4269:

Github user mattyb149 commented on a diff in the pull request:
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/
    @@ -120,12 +123,30 @@ public ValidationResult validate(final String subject, final String
value, final
    +    static final String JSON_TYPE_EXTENDED = "Extended";
    +    static final String JSON_TYPE_NORMAL   = "Normal";
    +    static final AllowableValue JSON_EXTENDED = new AllowableValue(JSON_TYPE_EXTENDED,
"Extended JSON",
    +            "Use MongoDB's \"extended JSON\". This is the JSON generated with toJson()
on a MongoDB Document from the Java driver");
    +    static final AllowableValue JSON_NORMAL = new AllowableValue(JSON_TYPE_NORMAL, "Normal
    +            "Use Jackson to convert the MongoDB Document into a representation that uses
only standard JSON");
    +    static final PropertyDescriptor JSON_TYPE = new PropertyDescriptor.Builder()
    +            .allowableValues(JSON_EXTENDED, JSON_NORMAL)
    +            .defaultValue(JSON_TYPE_EXTENDED)
    +            .displayName("JSON Type")
    +            .name("json-type")
    +            .description("By default, MongoDB's Java driver returns \"extended JSON\".
Some of the features of this variant of JSON" +
    +            " may cause problems for other JSON parsers that expect only standard JSON
types and conventions. This configuration setting " +
    +            " controls whether to use extended JSON or provide a clean view that conforms
to standard JSON.")
    +            .expressionLanguageSupported(false)
    +            .build();
    --- End diff --
    Another nitpick :)  Although there are only two allowable values and the default is one
of them, for consistency this field should be required(true).
    Also do you think it would be helpful to add some/all of this description to the processor's
CapabilityDescription too? That description is pretty thin, and this is a nice added feature
so might be good to draw more attention to it :)

> GetMongo should be able to provide pure JSON as well as "extended JSON"
> -----------------------------------------------------------------------
>                 Key: NIFI-4269
>                 URL:
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Mike Thomsen
> GetMongo currently only supports "extended JSON." That results in ugly JSON like this:
> {
>     "timestamp": {
>         "$date": LONG_TIMESTAMP
>     }
> }
> instead of something cleaner like this:
> {
>     "timestamp": "2017-08-07T00:00:00Z"
> }
> GetMongo should be refactored to support both modes of JSON serialization.

This message was sent by Atlassian JIRA

View raw message