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

Unable to generate AVRO classes with Java source generated from OpenAPI Yaml file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 1.11.2
    • None
    • java

    Description

      I was unable to generate AVRO classes when using OpenAPI yaml file to generate the source code for avro-maven-plugin

      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  9.450 s
      [INFO] Finished at: 2023-07-19T14:16:26-04:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.avro:avro-maven-plugin:1.11.2:schema (default) on project demo: Execution default of goal org.apache.avro:avro-maven-plugin:1.11.2:schema failed: Undefined name: "model.DocumentInfo" -> 

      This occurs when an array is specified In the OpenAPI yaml file as a property of an object, for example
      documents:
      type: array
      items:
      $ref: '#/components/schemas/DocumentInfo'
       
      If that was commented out, then proper AVRO classes will be generated.

      Attachments

        1. demo.zip
          82 kB
          Tom
        2. only_one.png
          68 kB
          Tom

        Issue Links

          Activity

            People

              clesaec Christophe Le Saec
              tom2011 Tom
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m