[ 
https://issues.apache.org/jira/browse/NIFI-1893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15509923#comment-15509923
 ] 

ASF GitHub Bot commented on NIFI-1893:
--------------------------------------

Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1037#discussion_r79830777
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml ---
    @@ -249,6 +249,11 @@ language governing permissions and limitations under 
the License. -->
                 <artifactId>super-csv</artifactId>
                 <version>2.4.0</version>
             </dependency>
    +        <dependency>
    +            <groupId>org.everit.json</groupId>
    +            <artifactId>org.everit.json.schema</artifactId>
    +            <version>1.4.0</version>
    +        </dependency>
    --- End diff --
    
    In the pom file, you also have to add the json files you added for testing 
purpose in order to exclude those files during the rat check (licensing 
aspects). You can check that everything is fine by running a mvn clean install 
with the profile contrib-check:
    ````
    mvn clean install -Pcontrib-check
    ````
    Side note: from where are coming the json files your are using for tests? 
(just to be sure there is no issue)


> Add processor for validating JSON
> ---------------------------------
>
>                 Key: NIFI-1893
>                 URL: https://issues.apache.org/jira/browse/NIFI-1893
>             Project: Apache NiFi
>          Issue Type: New Feature
>            Reporter: Matt Burgess
>
> NiFi has a ValidateXml processor to validate incoming XML files against a 
> schema. It would be good to have one to validate JSON files as well.
> For example, an input JSON of:
> {
>   name: "Test",
>   timestamp: 1463499695,
>   tags: {
>        "host": "Test_1",
>        "ip" : "1.1.1.1"
>   },
>   fields: {
>     "cpu": 10.2,
>     "load": 15.6
>   }
> }
> Could be validated successfully against the following "schema":
> {
>   "type": "object",
>   "required": ["name", "tags", "timestamp", "fields"],
>   "properties": {
>     "name": {"type": "string"},
>     "timestamp": {"type": "integer"},
>     "tags": {"type": "object", "items": {"type": "string"}},
>     "fields": { "type": "object"}
>   }
> }
> There is at least one ASF-friendly library that could be used for 
> implementation: https://github.com/everit-org/json-schema



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to