From issues-return-34933-apmail-nifi-issues-archive=nifi.apache.org@nifi.apache.org Tue Aug 22 14:02:05 2017 Return-Path: X-Original-To: apmail-nifi-issues-archive@minotaur.apache.org Delivered-To: apmail-nifi-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1B1E1AF7D for ; Tue, 22 Aug 2017 14:02:05 +0000 (UTC) Received: (qmail 98003 invoked by uid 500); 22 Aug 2017 14:02:05 -0000 Delivered-To: apmail-nifi-issues-archive@nifi.apache.org Received: (qmail 97901 invoked by uid 500); 22 Aug 2017 14:02:05 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 97816 invoked by uid 99); 22 Aug 2017 14:02:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Aug 2017 14:02:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E18361A03EB for ; Tue, 22 Aug 2017 14:02:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id rORxjkYvy4EU for ; Tue, 22 Aug 2017 14:02:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E61B05FCBA for ; Tue, 22 Aug 2017 14:02:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1C84EE01D8 for ; Tue, 22 Aug 2017 14:02:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 35B0625386 for ; Tue, 22 Aug 2017 14:02:00 +0000 (UTC) Date: Tue, 22 Aug 2017 14:02:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@nifi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NIFI-4269) GetMongo should be able to provide pure JSON as well as "extended JSON" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NIFI-4269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16136828#comment-16136828 ] ASF GitHub Bot commented on NIFI-4269: -------------------------------------- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2063#discussion_r134486575 --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java --- @@ -120,12 +123,30 @@ public ValidationResult validate(final String subject, final String value, final .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) .build(); + 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 JSON", + "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: https://issues.apache.org/jira/browse/NIFI-4269 > 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 (v6.4.14#64029)