swagger-annotations api dependency conflicts with swagger-annotations-jakarta
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- kotlin
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với openai-java-core/build.gradle.kts và kiểm tra cách swagger-annotations được cung cấp, sau đó xem xét tích hợp schema cho đầu ra có cấu trúc và metadata về dependency của nó. Xác nhận thay đổi dựa trên dependency graph đã được công bố để những consumer sử dụng swagger-annotations-jakarta không bị buộc phải nhận artifact hướng đến javax, đồng thời các schema annotation đã được ghi lại vẫn được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
openai-java-core declares:
api("io.swagger.core.v3:swagger-annotations:2.2.31")
(openai-java-core/build.gradle.kts)
This pulls the javax-oriented Swagger annotations artifact onto every consumer classpath as a hard dependency.
Many Jakarta EE / Spring Boot 3 applications already depend on io.swagger.core.v3:swagger-annotations-jakarta (e.g. via springdoc-openapi). Those two artifacts are mutually exclusive: they share the package io.swagger.v3.oas.annotations, so having both on the classpath causes duplicate-class / split-package conflicts.
Why this is surprising
The SDK itself does not need these annotations at compile time for its own types. Structured Outputs uses com.github.victools:jsonschema-module-swagger-2, which already declares swagger-annotations as provided. The annotations are only needed when consumers annotate their schema classes with @Schema / @ArraySchema (as documented in the README).
Re-exporting them as api is convenient, but it forces one of two incompatible coordinates onto ecosystems that already chose the other.
Workaround
Exclude the transitive dependency and keep the jakarta artifact:
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<exclusions>
<exclusion>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
implementation("com.openai:openai-java:…") {
exclude(group = "io.swagger.core.v3", module = "swagger-annotations")
}
Environment
- Consumer using
swagger-annotations-jakarta(Spring Boot 3 / springdoc) - openai-java bringing
swagger-annotationsviaopenai-java-core
- Ngôn ngữ chính
- Kotlin
- Star
- 1.5k
- Fork
- 264
- Merge trung bình
- 13 giờ 31 phút
- Pull request đã merge (30 ngày)
- 89
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openai/openai-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/openai-java#890 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/openai-java#886 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openai/openai-java#802 · 2 bình luận · 3 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openai/openai-java#755 · 1 bình luận ·
-
bug sdk
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openai/openai-java#652 · 2 bình luận ·
Tất cả issue của openai/openai-java
Issue tương tự
-
[Bug] 统计页面无法重置token和汇率 Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
AAswordman/Operit#1265 · 3 bình luận ·
-
The extension stopped working. Đang mởSource is down
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
keiyoushi/extensions-source#19317 ·
-
Tambahkan bahasa Indonesia Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
acristescu/OnlineGo#216 ·
-
Remove custom segment colors Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
libre-tube/LibreTube#8803 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100