question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Spring generator uses old Swagger dependency

See original GitHub issue
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.*

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

25reactions
petervandenbroekcommented, Mar 18, 2020

Any idea on when this will be fixed?

Currently, generating code from an OAP3 spec leaves you no other option than to expose a Swagger 2 spec.

0reactions
cbornetcommented, Jul 21, 2020

Currently, generating code from an OAP3 spec leaves you no other option than to expose a Swagger 2 spec.

This is not due to the annotations. You can perfectly generate an OAS3 from old swagger annotations. The fact that a Swagger2 spec is exposed comes from the lib used to generate it (probably springfox v2 ?). You can upgrade to Springfox v3 which supports generating OAS3 specs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug in OpenAPI generator? Wrong format for the example ...
I would like have a example like in my yaml file. In YYYY-MM-DD format. I'm using: <dependency> <groupId>io.springfox</groupId> ...
Read more >
Spring Boot - Enabling Swagger2 - Tutorialspoint
To enable the Swagger2 in Spring Boot application, you need to add the following dependencies in our build configurations file. <dependency> <groupId>io.
Read more >
Swagger: API Documentation & Design Tools for Teams
Simplify API development for users, teams, and enterprises with our open source and professional toolset. Find out how Swagger can help you and...
Read more >
Generate client code from Spring Boot using Maven
Alternatively, you may find use in combining the GenerateSwagger test class from my previous article on the subject with either the Swagger Codegen...
Read more >
F.A.Q - Springdoc-openapi
For example, lets assume you want load the swagger-ui in spring-mvc application: You mainly, need to add the springdoc-openapi module. <dependency> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found