Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2134

Cannot define optional field tags in Avro schema

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.8.1
    • None
    • java
    • None

    Description

      We are designing an Avro schema for kafka event payload and trying to use that for validating event message with Avro schema by posting to Kafka rest proxy.

      The avro schema has some fields which are defined with union encoding having null values   

      {\"name\": \"address\", \"type\": ,[\"null\",\"string\"], default:null}

      Our clients want to send event message data to kafka broker for some complex data types optionally i.e. without JSON key/value even though it is specified in Avro schema or few of the primitive data types as optional within complex data type.

      Is there an avro version which can skip the validation for no field data sent in event message or payload for field specified in Avro schema?

       The error message we see as follows:

      "error_code": 42203,

      "message": "Conversion of JSON to Avro failed: Failed to convert JSON to Avro: Expected start-union. Got END_OBJECT"

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            gogiraghu raghugogi

            Dates

              Created:
              Updated:

              Slack

                Issue deployment