fix(gradle-plugin): add .convention() defaults to Property<T> fields in ResolveTask#5065
Open
lfgcampos wants to merge 3 commits intoswagger-api:masterfrom
Open
fix(gradle-plugin): add .convention() defaults to Property<T> fields in ResolveTask#5065lfgcampos wants to merge 3 commits intoswagger-api:masterfrom
lfgcampos wants to merge 3 commits intoswagger-api:masterfrom
Conversation
341d8a5 to
84d78b1
Compare
84d78b1 to
3ee8ec3
Compare
Contributor
|
Hi @lfgcampos! Thanks for pointing this issue out and putting your effort to resolve it.
|
ewaostrowska
reviewed
Apr 3, 2026
Contributor
Author
hi @ewaostrowska, thanks for the comments and review!
Also updated the description with a lot more info 🤞 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Thank you for contributing to swagger-core!
Please fill out the following information to help us review your PR efficiently.
Closes #5136
Description
In Gradle 9, calling
Property<T>.get()on a property that has neither a set value nor a convention throws at runtime:ResolveTask.resolve()calls.get()unconditionally onprettyPrint,readAllResources,sortOutput,alwaysResolveAppPath,skipResolveAppPath, andencoding. None had a.convention(...)default, so they throw when not explicitly set by the caller.Fix: add
.convention(false)to the five boolean fields and.convention(StandardCharsets.UTF_8.name())to encoding. Callers that set these explicitly are unaffected.outputFileNameProperty<String>"openapi".get()outputFormatProperty<Format>Format.JSON.get()prettyPrintProperty<Boolean>falseSwaggerPluginreadAllResourcesProperty<Boolean>falseSwaggerPluginencodingProperty<String>Charset.defaultCharset().name()SwaggerPluginsortOutputProperty<Boolean>falseSwaggerPluginalwaysResolveAppPathProperty<Boolean>falseSwaggerPluginskipResolveAppPathProperty<Boolean>falseSwaggerPluginskipProperty<Boolean>false.getOrElse(), added for consistencyopenAPI31Property<Boolean>falseSwaggerPluginconvertToOpenAPI31Property<Boolean>false.get()at line 578 had noisPresent()guardType of Change
Checklist
Screenshots / Additional Context