Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Spring generator uses old Swagger dependency #4245

Open
dkirrane opened this issue Oct 23, 2019 · 5 comments
Open

[BUG] Spring generator uses old Swagger dependency #4245

dkirrane opened this issue Oct 23, 2019 · 5 comments

Comments

@dkirrane
Copy link

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.*

@dkirrane dkirrane changed the title [BUG] Spring generator uses old SpringFox & Swagger dependencies [BUG] Spring generator uses old Swagger dependencies Oct 23, 2019
@dkirrane dkirrane changed the title [BUG] Spring generator uses old Swagger dependencies [BUG] Spring generator uses old Swagger dependency Oct 23, 2019
@wing328
Copy link
Member

wing328 commented Nov 4, 2019

@dkirrane yes, we've not yet updated the annotation with io.swagger.v3.oas.annotations

Is that something you can help us with a PR?

@N4zroth
Copy link

N4zroth commented Dec 10, 2019

Would you want to still have the possibility to generate 'old' code, or do you want to replace it with the newer version?
Additionally, springfox isn't really maintained anymore, so a transistion to e. g. springdoc would make sense.

@wing328
Copy link
Member

wing328 commented Dec 10, 2019

My take is to replace it with the newer version. If users want the older version, they can use an old version of OpenAPI Generator for that.

alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 20, 2020
changed dependecies from io.swagger to io.swagger.core.v3
changed imports for annotations for api
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 20, 2020
updated annotations for simple request
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 20, 2020
updated annotations and properties for @ApiResponse part of methods
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 20, 2020
deleted old imports
added imports and new annotations to api,pojo and controller
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 20, 2020
updated samples for using new version of swagger models
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 22, 2020
updated samples and tests
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 22, 2020
updated dependencies for examples
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Feb 27, 2020
updated templates and code for samples in java and spring libs
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 6, 2020
updated samples client for java libraries and spring-cloud for swagger-annotations with version 2.1.1
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 6, 2020
updated server samples for java libs and spring cloud
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 6, 2020
updated dependencies to swagger-annotations(2.1.1) in pom mustache of java libs
updated annotations according to swagger-annotations 2.1.1 in pojo, and api mustache of java libs
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 8, 2020
changed mustaches in spring libs to use it with io.swagger.core.v3 in version 2.1.1
deleted import of old ApiModel and ApiModelProperty in spring libs, io.swagger.core.v3 in version 2.1.1 will be used instead
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 8, 2020
updated spring samples for client and server to use swagger-annotations 2.1.1
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 8, 2020
handling security with io.swagger.core.v3 in version 2.1.1
fixed comment
alexsuperdev added a commit to alexsuperdev/openapi-generator that referenced this issue Mar 8, 2020
updated spring samples handling security for client and server to use swagger-annotations 2.1.1
@petervandenbroek
Copy link

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.

@cbornet
Copy link
Member

cbornet commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants