OpenAPITools / OpenAPITools/openapi-generator

[BUG] OpenFeign client generator error

Open
#16,625 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Hi, Im using the openapi-generator-maven-plugin 7.0.0 with the next execution to generate a OpenFeign client:

				<execution>
					<id>buildSpringClient0</id>
					<goals>
						<goal>generate</goal>
					</goals>
					<configuration>
						<inputSpec>${project.basedir}/src/main/resources/openapi-client-0.yaml</inputSpec>
						<generatorName>spring</generatorName>
						<apiPackage>com.pichincha.clients0.client</apiPackage>
						<modelPackage>com.pichincha.clients0.client.models</modelPackage>
						<library>spring-cloud</library>
						<configOptions>
							<useSpringBoot3>true</useSpringBoot3>
							<useResponseEntity>false</useResponseEntity>
							<useJakartaEe>true</useJakartaEe>
							<openApiNullable>false</openApiNullable>
							<generateForOpenFeign>false</generateForOpenFeign>
							<sourceFolder>src/main/java</sourceFolder>
							<configPackage>com.myOrg.clients0.config</configPackage>
						</configOptions>
					</configuration>
				</execution>

But, when I do a mvn clean install or mvn compile the execution show me the next error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project my-proyect-name: Compilation failure
[ERROR] /C:/Users/my_user/Documents/my_proyect/my-proyect-name/target/generated-sources/openapi/src/main/java/com/myOrg/clients0/config/ClientConfiguration.java:[15,4] cannot find symbol
[ERROR] symbol: class ConditionalOnProperty
[ERROR] location: class com.myOrg.clients0.config.ClientConfiguration

Im using java 17 and spring 3

openapi-generator version

7.0.0

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Maven compile failure with the reported openapi-generator 7.0.0 configuration and inspect target/generated-sources/openapi/src/main/java/com/myOrg/clients0/config/ClientConfiguration.java, especially the missing ConditionalOnProperty symbol. Compare the generated Spring client configuration with the project dependencies; done means mvn clean install or mvn compile completes without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.