Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-1893

Add processor for validating JSON

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • 1.19.0
    • None
    • None

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mattyb149 Matt Burgess
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: