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

Annotation @Parameter does not have property title #19

Closed
b-abel opened this issue Nov 1, 2024 · 3 comments
Closed

Annotation @Parameter does not have property title #19

b-abel opened this issue Nov 1, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@b-abel
Copy link

b-abel commented Nov 1, 2024

What version of OpenRewrite are you using?

I am using

  • Maven plugin v5.43.3

How are you running OpenRewrite?

I am using the Maven command line, and my project is a single module project.

 mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-openapi:RELEASE -Drewrite.activeRecipes=org.openrewrite.openapi.swagger.SwaggerToOpenAPI -Drewrite.exportDatatables=true

What is the smallest, simplest way to reproduce the problem?

Have a project with Spring Boot 3.3 and dependency springdoc-openapi-starter-webmvc-ui in version 2.6.0 and a controller method annotated with @Parameter(description = ""). The recipe will replace description by title. This does not compile because the interface io.swagger.v3.oas.annotations.Parameter does not have a property title in the library swagger-annotations-jakarta (version 2.2.22).

What did you expect to see?

I expect that it does not change the existing code and leaves it like this:

public ResponseEntity<MyDto> sayHello(
            @Parameter(description = "The name of the greeter", required = true, example = "John Doe") @PathVariable String name
    ) { }

What did you see instead?

public ResponseEntity<MyDto> sayHello(
            @Parameter(title = "The name of the greeter", required = true, example = "John Doe") @PathVariable String name
    ) { }

Can you give me any hints in which version of OpenApi/Springdoc it is supposed to work?

@b-abel b-abel added the bug Something isn't working label Nov 1, 2024
@timtebeek
Copy link
Contributor

hi @b-abel ; I indeed do not see such an attribute on the latest version of the Parameter annotation on:
https://javadoc.io/doc/io.swagger.core.v3/swagger-annotations/latest/io/swagger/v3/oas/annotations/Parameter.html

That change was introduced by @amanda-matteucci in

Perhaps it should have been Schema that should have been changed there? Based on this comment:

I'd welcome a PR that makes that quick change, provided you both agree on the right path forward. :)

@timtebeek timtebeek moved this to Backlog in OpenRewrite Nov 1, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenRewrite Nov 2, 2024
@timtebeek timtebeek self-assigned this Nov 2, 2024
timtebeek added a commit that referenced this issue Nov 2, 2024
@santoshdahal12
Copy link

We might also need to update rewrite-spring to have this version ??

@timtebeek
Copy link
Contributor

We might also need to update rewrite-spring to have this version ??

Hi @santoshdahal12 ; rewrite-spring depends on rewrite-openapi, so this change should also be applied there already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants