You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Tom (Jira)" <ji...@apache.org> on 2023/07/20 14:48:00 UTC
[jira] [Comment Edited] (AVRO-3805) Unable to generate AVRO classes with Java source generated from OpenAPI Yaml file
[ https://issues.apache.org/jira/browse/AVRO-3805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17745115#comment-17745115 ]
Tom edited comment on AVRO-3805 at 7/20/23 2:47 PM:
----------------------------------------------------
It worked after adding the imports explicitly
was (Author: JIRAUSER284556):
I got compilation error after using the imports
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] target/generated-sources/openapi/src/gen/java/main/model/DocumentInfo.java:[209,7] no suitable constructor found for SpecificRecordBuilderBase(org.apache.avro.Schema,org.apache.avro.specific.SpecificData)
constructor org.apache.avro.specific.SpecificRecordBuilderBase.SpecificRecordBuilderBase(org.apache.avro.Schema) is not applicable
(actual and formal argument lists differ in length)
constructor org.apache.avro.specific.SpecificRecordBuilderBase.SpecificRecordBuilderBase(org.apache.avro.specific.SpecificRecordBuilderBase<model.DocumentInfo>) is not applicable
(actual and formal argument lists differ in length)
constructor org.apache.avro.specific.SpecificRecordBuilderBase.SpecificRecordBuilderBase(model.DocumentInfo) is not applicable
(actual and formal argument lists differ in length)
> Unable to generate AVRO classes with Java source generated from OpenAPI Yaml file
> ---------------------------------------------------------------------------------
>
> Key: AVRO-3805
> URL: https://issues.apache.org/jira/browse/AVRO-3805
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.11.2
> Reporter: Tom
> Priority: Minor
> Attachments: demo.zip
>
>
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)