OpenAPITools / OpenAPITools/openapi-generator

[BUG] Spring generator uses old Swagger dependency

Open
#4,245 5 comments 5 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

Description

I'm using openapi-generator-maven-plugin 4.1.3 and the spring generator uses an old swagger dependency.

expected:

		<dependency>
			<groupId>io.swagger.core.v3</groupId>
			<artifactId>swagger-annotations</artifactId>
			<version>2.0.10</version>
		</dependency>

actual:

		<dependency>
			<groupId>io.swagger</groupId>
			<artifactId>swagger-annotations</artifactId>
			<version>1.5.23</version>
		</dependency>

And the generated code uses import io.swagger.annotations.*
instead of import io.swagger.v3.oas.annotations.*

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 from the Spring generator entry point and inspect where its Maven dependency and generated Swagger imports are defined. Compare the generated output with the expected io.swagger.core.v3 dependency and io.swagger.v3.oas.annotations imports, then run the relevant generator tests if available. Done means Spring output uses Swagger annotations 2.0.10 consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi, spring
Domain
api, backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.