Skip to content

KAFKA-19792: Gradle build fails after Swagger patch version update#20711

Merged
chia7712 merged 2 commits intoapache:trunkfrom
brandboat:KAFKA-19792
Oct 18, 2025
Merged

KAFKA-19792: Gradle build fails after Swagger patch version update#20711
chia7712 merged 2 commits intoapache:trunkfrom
brandboat:KAFKA-19792

Conversation

@brandboat
Copy link
Member

@brandboat brandboat commented Oct 16, 2025

Since version 2.2.27, the Swagger Gradle Plugin introduced lazy
configuration using Gradle's Property<T> API (see
swagger-api/swagger-core@583c21b)

With lazy configuration, properties are not evaluated until task
execution. However, access a property must have a value set. Attempting
to query a property without a value throws:

Cannot query the value of property 'xyz' because it has no value
available

And in genConnectOpenAPIDocs, we manually create a ResolveTask
instance which is responsible for setting default values for these
properties.

This patch explicitly sets these required properties to match their
default values from the Swagger Gradle Plugin conventions defined in
SwaggerPlugin.java

  • set alwaysResolveAppPath to false: default is false
  • set skipResolveAppPath to false: default is false
  • set readAllResources to true: default is true
  • set encoding to UTF-8: default is UTF-8

This ensures the manually created ResolveTask has all required
property values, preventing the "Cannot query the value of property"
error.

Reviewers: Dejan Stojadinović dejan2609@users.noreply.github.com,
Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions bot added build Gradle build or GitHub Actions small Small PRs labels Oct 16, 2025
@brandboat
Copy link
Member Author

brandboat commented Oct 16, 2025

Test step to verify this pr make no changes to the genConnectOpenAPIDocs output.

# checkout to trunk
rm -rf ./docs/generated/
./gradlew clean releaseTarGz
cp ./docs/generated/connect_rest.yaml /tmp/connect_rest.yaml.before

# checkout to this pr branch
rm -rf ./docs/generated/
./gradlew clean releaseTarGz
cp ./docs/generated/connect_rest.yaml /tmp/connect_rest.yaml.after

# no output, means nothing changes
diff /tmp/connect_rest.yaml.before /tmp/connect_rest.yaml.after

@brandboat brandboat marked this pull request as draft October 16, 2025 04:27
@brandboat brandboat marked this pull request as ready for review October 16, 2025 04:55
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Oct 16, 2025
@brandboat
Copy link
Member Author

gentle ping @chia7712, @dejan2609, would you mind take a look when you are available? Thank you!

@dejan2609
Copy link
Contributor

@brandboat one non-binding LGTM ✅ from my side !

@chia7712 chia7712 merged commit 1660289 into apache:trunk Oct 18, 2025
23 checks passed
@brandboat brandboat deleted the KAFKA-19792 branch October 18, 2025 15:43
JimmyWang6 pushed a commit to JimmyWang6/jimmy-KAFKA-14048 that referenced this pull request Oct 19, 2025
…ache#20711)

Since version **2.2.27**, the Swagger Gradle Plugin introduced lazy
configuration using Gradle's `Property<T>` API (see

swagger-api/swagger-core@583c21b)

With lazy configuration, properties are not evaluated until task
execution. However, access a property must have a value set. Attempting
to query a property without a value throws:
```
Cannot query the value of property 'xyz' because it has no value
available
```

And in `genConnectOpenAPIDocs`, we manually create a `ResolveTask`
instance which is responsible for setting default values for these
properties.

This patch explicitly sets these required properties to match their
default values from the Swagger Gradle Plugin conventions defined in

[SwaggerPlugin.java](https://github.com/swagger-api/swagger-core/blob/v2.2.39/modules/swagger-gradle-plugin/src/main/java/io/swagger/v3/plugins/gradle/SwaggerPlugin.java#L25-L38)
- set alwaysResolveAppPath to false: default is false
- set skipResolveAppPath to false: default is false
- set readAllResources to true: default is true
- set encoding to UTF-8: default is UTF-8

This ensures the manually created `ResolveTask` has all required
property values, preventing the "Cannot query the value of property"
error.

Reviewers: Dejan Stojadinović <dejan2609@users.noreply.github.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
eduwercamacaro pushed a commit to littlehorse-enterprises/kafka that referenced this pull request Nov 12, 2025
…ache#20711)

Since version **2.2.27**, the Swagger Gradle Plugin introduced lazy
configuration using Gradle's `Property<T>` API (see

swagger-api/swagger-core@583c21b)

With lazy configuration, properties are not evaluated until task
execution. However, access a property must have a value set. Attempting
to query a property without a value throws:
```
Cannot query the value of property 'xyz' because it has no value
available
```

And in `genConnectOpenAPIDocs`, we manually create a `ResolveTask`
instance which is responsible for setting default values for these
properties.

This patch explicitly sets these required properties to match their
default values from the Swagger Gradle Plugin conventions defined in

[SwaggerPlugin.java](https://github.com/swagger-api/swagger-core/blob/v2.2.39/modules/swagger-gradle-plugin/src/main/java/io/swagger/v3/plugins/gradle/SwaggerPlugin.java#L25-L38)
- set alwaysResolveAppPath to false: default is false
- set skipResolveAppPath to false: default is false
- set readAllResources to true: default is true
- set encoding to UTF-8: default is UTF-8

This ensures the manually created `ResolveTask` has all required
property values, preventing the "Cannot query the value of property"
error.

Reviewers: Dejan Stojadinović <dejan2609@users.noreply.github.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
TaiJuWu pushed a commit to TaiJuWu/kafka that referenced this pull request Dec 3, 2025
…ache#20711)

Since version **2.2.27**, the Swagger Gradle Plugin introduced lazy
configuration using Gradle's `Property<T>` API (see

swagger-api/swagger-core@583c21b)

With lazy configuration, properties are not evaluated until task
execution. However, access a property must have a value set. Attempting
to query a property without a value throws:
```
Cannot query the value of property 'xyz' because it has no value
available
```

And in `genConnectOpenAPIDocs`, we manually create a `ResolveTask`
instance which is responsible for setting default values for these
properties.

This patch explicitly sets these required properties to match their
default values from the Swagger Gradle Plugin conventions defined in

[SwaggerPlugin.java](https://github.com/swagger-api/swagger-core/blob/v2.2.39/modules/swagger-gradle-plugin/src/main/java/io/swagger/v3/plugins/gradle/SwaggerPlugin.java#L25-L38)
- set alwaysResolveAppPath to false: default is false
- set skipResolveAppPath to false: default is false
- set readAllResources to true: default is true
- set encoding to UTF-8: default is UTF-8

This ensures the manually created `ResolveTask` has all required
property values, preventing the "Cannot query the value of property"
error.

Reviewers: Dejan Stojadinović <dejan2609@users.noreply.github.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
shashankhs11 pushed a commit to shashankhs11/kafka that referenced this pull request Dec 15, 2025
…ache#20711)

Since version **2.2.27**, the Swagger Gradle Plugin introduced lazy
configuration using Gradle's `Property<T>` API (see

swagger-api/swagger-core@583c21b)

With lazy configuration, properties are not evaluated until task
execution. However, access a property must have a value set. Attempting
to query a property without a value throws:
```
Cannot query the value of property 'xyz' because it has no value
available
```

And in `genConnectOpenAPIDocs`, we manually create a `ResolveTask`
instance which is responsible for setting default values for these
properties.

This patch explicitly sets these required properties to match their
default values from the Swagger Gradle Plugin conventions defined in

[SwaggerPlugin.java](https://github.com/swagger-api/swagger-core/blob/v2.2.39/modules/swagger-gradle-plugin/src/main/java/io/swagger/v3/plugins/gradle/SwaggerPlugin.java#L25-L38)
- set alwaysResolveAppPath to false: default is false
- set skipResolveAppPath to false: default is false
- set readAllResources to true: default is true
- set encoding to UTF-8: default is UTF-8

This ensures the manually created `ResolveTask` has all required
property values, preventing the "Cannot query the value of property"
error.

Reviewers: Dejan Stojadinović <dejan2609@users.noreply.github.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions dependencies Pull requests that update a dependency file small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants