This is an automated email from the ASF dual-hosted git repository.

engelen pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new a0842c139f Fix Swagger annotation warnings in geode-dunit compilation 
(#7948)
a0842c139f is described below

commit a0842c139f75182f6a6ec3e5fdabca38fae17f66
Author: Jinwoo Hwang <[email protected]>
AuthorDate: Mon Oct 27 11:07:12 2025 -0400

    Fix Swagger annotation warnings in geode-dunit compilation (#7948)
    
    Add io.swagger.core.v3:swagger-annotations dependency to geode-dunit's
    compile classpath to resolve compilation warnings about missing
    AccessMode enum constant.
    
    Problem:
    The geode-dunit module's compilation was generating warnings:
      warning: unknown enum constant AccessMode.READ_ONLY
      reason: class file for 
io.swagger.v3.oas.annotations.media.Schema$AccessMode
      not found
    
    Root Cause:
    The geode-dunit code references Swagger/OpenAPI annotations (such as
    @Schema with AccessMode) through transitive dependencies from geode-core
    and geode-gfsh, both of which have swagger-annotations as implementation
    dependencies. However, the Swagger annotations API was not explicitly
    declared as a compile-time dependency for geode-dunit. This caused the
    Java annotation processor to be unable to resolve the AccessMode enum
    during compilation.
    
    Solution:
    Added 'io.swagger.core.v3:swagger-annotations' to compileOnly
    configuration in geode-dunit/build.gradle. This ensures the Swagger
    annotations API is available during compilation, allowing the annotation
    processor to properly resolve Swagger/OpenAPI annotations.
    
    The compileOnly scope is appropriate here since:
    - Swagger annotations API is only needed at compile time for annotation
      processing
    - Runtime implementation is provided by transitive dependencies from
      geode-core and geode-gfsh
    - Keeps the classpath minimal and avoids duplicate dependencies
    - Consistent with patterns in geode-management and geode-deployment-legacy
    
    Testing:
    Verified with: ./gradlew :geode-dunit:compileJava
    Build completes successfully without Swagger annotation warnings.
    
    Related modules using similar pattern:
    - geode-core: has swagger-annotations in implementation scope
    - geode-gfsh: has swagger-annotations in implementation scope
    - geode-management: has swagger-annotations in testCompileOnly scope
    - geode-deployment-legacy: has swagger-annotations in compileOnly scope
    - geode-assembly: has swagger-annotations in various test scopes
---
 geode-dunit/build.gradle | 1 +
 1 file changed, 1 insertion(+)

diff --git a/geode-dunit/build.gradle b/geode-dunit/build.gradle
index 50ddbfc59d..06ae5cc865 100755
--- a/geode-dunit/build.gradle
+++ b/geode-dunit/build.gradle
@@ -22,6 +22,7 @@ plugins {
 
 dependencies {
   api(platform(project(':boms:geode-all-bom')))
+  compileOnly('io.swagger.core.v3:swagger-annotations')
   implementation(project(':geode-logging'))
   implementation(project(':geode-serialization'))
   implementation(project(':geode-membership'))

Reply via email to