Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-3386

check whether the field exists or not in #jsonpath evaluation

    XMLWordPrintable

    Details

    • Story Points:
      1
    • Rank (Obsolete):
      9223372036854775807

      Description

      I am parsing Json(source) into CSV in Transform function
      All of my Json records may not have all the fields.
      Some records have only Field1,field2.. some other records have all 3 fields.
      if the specific field is not exists in specific record, that record got rejected.(by saying field is not exist)
      Could you please let me know how to check the field exists or not.
      Here my expression part of the stream
      transform --expression=#jsonPath(payload,'$.field1').concat('|').concat(#jsonPath(payload,'$.field2')).concat('|').concat(#jsonPath(payload,'$.field3'))

      My Spring XD version is 1-0-0-m7

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            a_ayyaps Ayyappan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: