Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

swagger-annotations api dependency conflicts with swagger-annotations-jakarta

Aperta
#796 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
kotlin
Ambito
build-system

Direzione di ricerca

Inizia da openai-java-core/build.gradle.kts e verifica come viene esposto swagger-annotations, quindi esamina l’integrazione dello schema per l’output strutturato e i relativi metadati delle dipendenze. Conferma la modifica rispetto al grafo delle dipendenze pubblicato, in modo che i consumer che usano swagger-annotations-jakarta non siano costretti a ricevere l’artefatto orientato a javax, mantenendo al contempo il supporto per le annotazioni dello schema documentate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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-annotations via openai-java-core
Lingua principale
Kotlin
Stelle
1.5k
Fork
264
Merge medio
13h 31m
PR unite (30g)
89

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/openai-java

Tutte le issue di openai/openai-java

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.