Adyen / Adyen/adyen-java-api-library

Make Swagger annotation dependencies optional

Open Beginner friendly
#2,028 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

do not stale
Dominant language
Java
Stars
148
Forks
158
Avg merge
3d 3h
Merged PRs (30d)
10

Description

The SDK declares both Swagger v1 (io.swagger:swagger-annotations) and Swagger v3 (io.swagger.core.v3:swagger-annotations) as mandatory transitive dependencies. They annotate generated model metadata but are not required for API calls, serialization, webhook verification, or other SDK runtime behavior.

This causes avoidable conflicts for consumers that use a different Swagger namespace. A Spring Boot 4 application using springdoc Jakarta receives swagger-annotations-jakarta while Adyen adds the non-Jakarta v3 artifact containing the same annotation class names. In our packaged application this produced 62 duplicate-class collisions until both Adyen annotation artifacts were explicitly excluded.

The SDK compiles against the annotations, so marking them Maven-optional preserves SDK compilation and makes them available to consumers that explicitly want to reflect on Adyen model documentation. Ordinary consumers no longer receive two documentation-only artifacts.

Proposed change: add <optional>true</optional> to both Swagger annotation dependencies.

Verification performed:

  • Full Adyen test suite on JDK 26: 617 tests, 0 failures/errors, 4 skips.
  • Consumer Kotlin compilation with both dependencies excluded: Adyen payment/webhook and terminal modules compile successfully.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Maven dependency declarations for io.swagger:swagger-annotations and io.swagger.core.v3:swagger-annotations. Mark both dependencies optional, then run the full Adyen test suite and verify that the payment/webhook and terminal modules compile for a Kotlin consumer with both annotation dependencies excluded.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.