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

Update swagger-2.yml - Change attribute description to title #15

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

amanda-matteucci
Copy link
Contributor

Change attribute "description" to "title"

What's changed?

Change attribute "description" to "title" when migrating from ApiModel to io.swagger.v3.oas.annotations.media.Schema

What's your motivation?

I ran this recipe and it changed "value" to "description" but didn't change what was currently "description" to anything. After some digging, I found that its counterpart would be "title"

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Change attribute "description" to "title"
Meant for the change to be for ApiModel, not ApiParam
@amanda-matteucci amanda-matteucci marked this pull request as ready for review September 24, 2024 20:42
@timtebeek
Copy link
Contributor

Thanks a lot for the quick fix here @amanda-matteucci ; Would you mind sharing that link you found that identifies title as the counterpart to description? That might help contextualize the change for others to come. :)

@timtebeek timtebeek self-requested a review September 24, 2024 20:53
@timtebeek timtebeek merged commit e8cc01c into openrewrite:main Sep 24, 2024
2 checks passed
@timtebeek
Copy link
Contributor

Your change just missed the release we did two hours ago: https://github.com/openrewrite/rewrite-openapi/releases/tag/v0.7.0
Until the next release in two weeks it'll be available from our snapshot repository as 0.8.0-SNAPSHOT. Hope that helps!

@amanda-matteucci
Copy link
Contributor Author

Thanks a lot for the quick fix here @amanda-matteucci ; Would you mind sharing that link you found that identifies title as the counterpart to description? That might help contextualize the change for others to come. :)

https://docs.swagger.io/swagger-core/v2.0.0-RC3/apidocs/io/swagger/v3/oas/annotations/media/Schema.html#title-- Here you go! It doesn't say it is explicitly the counterpart but I noticed how "description" was used in our team's code before and the documentation for describing "title" seemed to fit.

timtebeek added a commit that referenced this pull request Nov 2, 2024
@timtebeek
Copy link
Contributor

This change has been reverted as it was reported as problematic in #19 . If you'd like anything similar to be added lets add a unit test first to verify the behavior.

@b-abel
Copy link

b-abel commented Nov 4, 2024

That makes a lot of sense to me. It is worth to keep in mind that the recipe is (transitively) included in the recipes for the Spring Boot 3.x migrations which are very popular which means that many uses are affected by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants