fix: restore OSGi Import-Package completeness in swagger-core - #5290
Closed
vpelikh wants to merge 157 commits into
Closed
fix: restore OSGi Import-Package completeness in swagger-core#5290vpelikh wants to merge 157 commits into
vpelikh wants to merge 157 commits into
Conversation
…s2:2.2.47-SNAPSHOT, change version to 2.2.51-SNAPSHOT
changes: - update maven-compiler-plugin to latest 3.14.1 - update maven-javadoc-plugin to latest 3.12.0 - update jacoco-maven-plugin to latest 0.8.14 - set maven.compiler.release to 17 - set source to 17 and update link to javadoc for maven-javadoc-plugin configuration - set java-version to 17 in github workflows - set java version to 17 in swagger-gradle-plugin - update gradle version to 9.5.1 in swagger-gradle-plugin
- Switch to single-workflow release triggered by tag - Support milestone, rc, and final releases from SNAPSHOT - Remove 1.5 branch workflows and dependabot entry - Update all Python scripts for vpelikh/swagger-core - Add compute-release-version.sh and prepare-release-commit.sh - Remove prepare-release.sh, pre-release.sh, post-release.sh
Handle the case where lastRelease.py returns "0.0.0" (no prior releases) by skipping the API call for the last release date and using a fallback epoch date instead. This prevents a 404 error when generating release notes for the first release in a repository.
#9) The blanket sed substitution was incorrectly overwriting the maven-compiler-plugin version (3.14.1) with the release version (3.0.0-M1), causing a build failure. The module inherits the project version from the parent, so the explicit replacement is unnecessary and has been removed.
Use distinct sed patterns for double-quoted and single-quoted dependency strings so that only the version substring is replaced, preserving the rest of the line. This prevents compilation errors in both SwaggerPlugin.java and SwaggerResolveTest.java.
The script uses json.dumps() to serialize the payload but was missing the `import json` statement, causing a NameError during the release workflow.
…version (#12) - Set fetch-depth: 0 in checkout step so that git tags are available and the next milestone/RC number is correctly computed. - Add a check in compute-release-version.sh to abort if a release tag already exists, avoiding accidental duplicate deployments to Maven Central.
- Generate javadocs for swagger-annotations module only using `mvn -pl modules/swagger-annotations javadoc:javadoc`, avoiding missing dependency issues in other modules. - Update prepare-javadocs.sh to copy from the correct apidocs path. - Remove unused GitHub App token step and explicit GITHUB_TOKEN, as the default workflow token is sufficient for all operations.
Use target/reports/apidocs as source directory, matching the actual output of maven-javadoc-plugin in this project.
- Delete wiki checkout and update steps from release workflow - Copy javadocs to a "latest" folder in gh-pages for a stable URL pointing to the most recent release
For milestones and RCs, base the release notes on the latest release of any kind. For final releases, use the last stable release to aggregate all changes since the previous GA version.
…agger module setup (#19) - Expose public constructor in ModelResolver to allow fine-grained ObjectMapper reuse - Prevent unintended side effects when sharing ObjectMapper instances with external configuration
Replace conditional addAll() pattern with simple setExamples() to ensure idempotent behavior when processing both @example and @examples annotations. Before this change, when a schema had both example="value" and examples={"value1","value2"} annotations, the resulting JSON could contain duplicated entries due to the addAll() being called multiple times. This fix makes the example resolution deterministic regardless of how many times the resolver processes the same schema annotation.
- Ensure lastRelease.py returns the latest release of any type (not just stable) when called without arguments. - In prepare-release-commit.sh, use the latest release as baseline for milestones and RCs, and the last stable release for final releases.
…tion and WRAPPER_OBJECT support (#25) - Introduce resolveSubtypes() to detect @JsonSubTypes and @Schema(subTypes), deduplicate subtypes to handle Jackson 3 AnnotationIntrospectorPair duplicates, resolve subtype schemas with allOf composition, and add oneOf to parent - Fix resolveWrapping() to keep oneOf when adding WRAPPER_OBJECT properties - Use jsonView-suffixed names in oneOf $ref entries when @JSONVIEW is active - Add SwaggerAnnotationIntrospector @JsonSubTypes support - Update and add tests for subtype resolution, jsonView, wrapper object, and OAS 3.1 contentSchema coexistence
Replace Set.class.equals(cls) with Set.class.isAssignableFrom(cls) so that types like LinkedHashSet, HashSet, and TreeSet are correctly identified as Set types for uniqueItems schema generation. Previously only exact Set.class matches were caught, plus direct interface checks via getInterfaces() which miss inherited Set implementations. Add IsSetTypeTest with 7 test cases covering null, Set interface, HashSet, LinkedHashSet, TreeSet, non-Set collections, and non-collection types.
…hSet, LinkedHashSet, TreeSet, non-Set collections, and non-collection types. (#27)
…#32) Bumps [org.javassist:javassist](https://github.com/jboss-javassist/javassist) from 3.30.2-GA to 3.31.0-GA. - [Release notes](https://github.com/jboss-javassist/javassist/releases) - [Changelog](https://github.com/jboss-javassist/javassist/blob/master/Changes.md) - [Commits](https://github.com/jboss-javassist/javassist/commits) --- updated-dependencies: - dependency-name: org.javassist:javassist dependency-version: 3.31.0-GA dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#28) Bumps [com.github.jknack:handlebars](https://github.com/jknack/handlebars.java) from 4.4.0 to 4.5.1. - [Release notes](https://github.com/jknack/handlebars.java/releases) - [Commits](jknack/handlebars.java@v4.4.0...v4.5.1) --- updated-dependencies: - dependency-name: com.github.jknack:handlebars dependency-version: 4.5.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [joda-time:joda-time](https://github.com/JodaOrg/joda-time) from 2.14.2 to 2.14.3. - [Release notes](https://github.com/JodaOrg/joda-time/releases) - [Changelog](https://github.com/JodaOrg/joda-time/blob/main/RELEASE-NOTES.txt) - [Commits](JodaOrg/joda-time@v2.14.2...v2.14.3) --- updated-dependencies: - dependency-name: joda-time:joda-time dependency-version: 2.14.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.184 to 4.8.186. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](classgraph/classgraph@classgraph-4.8.184...classgraph-4.8.186) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-version: 4.8.186 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `logback-version` from 1.6.0 to 1.6.1. Updates `ch.qos.logback:logback-classic` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](qos-ch/logback@v_1.6.0...v_1.6.1) Updates `ch.qos.logback:logback-core` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](qos-ch/logback@v_1.6.0...v_1.6.1) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-version: 1.6.1 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: ch.qos.logback:logback-core dependency-version: 1.6.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…139) Replace the boolean kotlinAvailable flag with a direct reference to the kotlin.Metadata annotation class. This allows both the existing blanket isKotlinPresent() check and a new isKotlinClass(Class<?>) method that inspects whether a specific class carries the @kotlin.Metadata annotation. This is needed by downstream consumers (e.g. springdoc-openapi) to distinguish Kotlin-compiled DTOs from Java DTOs when Kotlin is on the classpath. Add kotlin-maven-plugin and kotlin-stdlib 2.4.0 test dependencies and a real Kotlin test fixture compiled by the Kotlin compiler. Signed-off-by: Vasily Pelikh <2010720+vpelikh@users.noreply.github.com>
…ger-api#5192) * Apply PropertyNamingStrategy to get/is-prefixed property names The "avoid clobbering get/is names" hack in ModelResolver replaced the Jackson-resolved property name with the raw member name for any member whose name starts with a get/is prefix followed by a lower-case letter. When a custom PropertyNamingStrategy (e.g. SNAKE_CASE) was configured, this clobbered the translated name: record components such as issuanceDate were emitted as "issuanceDate" instead of "issuance_date", while sibling fields like familyName were correctly translated. Only apply the hack when no PropertyNamingStrategy is configured, so the strategy is honored uniformly. The original swagger-api#415 (Scala is_persistent) and swagger-api#2635 (JAXB-renamed is-prefixed fields) behavior is preserved, as neither configures a naming strategy. Reported in springdoc/springdoc-openapi#3293. Signed-off-by: seonwoo_jung <79202163+seonwooj0810@users.noreply.github.com> * fix: preserve Jackson-resolved property names when naming is supplied via class-level or mix-in @JsonNaming
# Conflicts: # modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java # modules/swagger-jakarta-rest/src/test/java/io/swagger/v3/java17/resolving/RecordPropertyNamingStrategyTest.java
….1 (#142) Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.22.0 to 1.22.1. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](apache/commons-codec@rel/commons-codec-1.22.0...rel/commons-codec-1.22.1) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-version: 1.22.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `kotlin.version` from 2.4.0 to 2.4.10. Updates `org.jetbrains.kotlin:kotlin-stdlib` from 2.4.0 to 2.4.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.4.0...v2.4.10) Updates `org.jetbrains.kotlin:kotlin-maven-plugin` from 2.4.0 to 2.4.10 --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-maven-plugin dependency-version: 2.4.10 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-version: 2.4.10 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps org.eclipse.jetty.ee11:jetty-ee11-maven-plugin from 12.1.11 to 12.1.12. --- updated-dependencies: - dependency-name: org.eclipse.jetty.ee11:jetty-ee11-maven-plugin dependency-version: 12.1.12 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.owasp:dependency-check-maven](https://github.com/dependency-check/DependencyCheck) from 12.2.2 to 13.0.0. - [Release notes](https://github.com/dependency-check/DependencyCheck/releases) - [Changelog](https://github.com/dependency-check/DependencyCheck/blob/main/CHANGELOG.md) - [Commits](dependency-check/DependencyCheck@v12.2.2...v13.0.0) --- updated-dependencies: - dependency-name: org.owasp:dependency-check-maven dependency-version: 13.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps org.snakeyaml:snakeyaml-engine from 3.0.1 to 3.1. --- updated-dependencies: - dependency-name: org.snakeyaml:snakeyaml-engine dependency-version: '3.1' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.checkerframework:checker-qual](https://github.com/typetools/checker-framework) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/typetools/checker-framework/releases) - [Changelog](https://github.com/typetools/checker-framework/blob/master/docs/CHANGELOG.md) - [Commits](typetools/checker-framework@checker-framework-4.2.1...checker-framework-4.2.2) --- updated-dependencies: - dependency-name: org.checkerframework:checker-qual dependency-version: 4.2.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps org.snakeyaml:snakeyaml-engine from 3.1 to 3.1.1. --- updated-dependencies: - dependency-name: org.snakeyaml:snakeyaml-engine dependency-version: 3.1.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.186 to 4.8.187. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](classgraph/classgraph@classgraph-4.8.186...classgraph-4.8.187) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-version: 4.8.187 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Conflicts: # README.md # modules/swagger-annotations/pom.xml # modules/swagger-bom-integration-test/pom.xml # modules/swagger-bom/pom.xml # modules/swagger-core/pom.xml # modules/swagger-core/src/main/java/io/swagger/v3/core/util/Json.java # modules/swagger-core/src/main/java/io/swagger/v3/core/util/Json31.java # modules/swagger-core/src/main/java/io/swagger/v3/core/util/Yaml.java # modules/swagger-core/src/main/java/io/swagger/v3/core/util/Yaml31.java # modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/SwaggerTestBase.java # modules/swagger-core/src/test/java/io/swagger/v3/core/serialization/JsonSerializationTest.java # modules/swagger-eclipse-transformer-maven-plugin/pom.xml # modules/swagger-gradle-plugin/README.md # modules/swagger-gradle-plugin/gradle.properties # modules/swagger-integration/pom.xml # modules/swagger-jakarta-rest-servlet-initializer/pom.xml # modules/swagger-jakarta-rest/pom.xml # modules/swagger-jakarta-rest/src/main/java/io/swagger/v3/jakartarest/integration/OpenApiServlet.java # modules/swagger-jakarta-rest/src/main/java/io/swagger/v3/jakartarest/integration/SwaggerLoader.java # modules/swagger-jakarta-rest/src/main/java/io/swagger/v3/jakartarest/integration/resources/BaseOpenApiResource.java # modules/swagger-jakarta-rest/src/test/java/io/swagger/v3/jakartarest/BootstrapServlet.java # modules/swagger-jakarta-rest/src/test/java/io/swagger/v3/jakartarest/integration/SortedOutputTest.java # modules/swagger-java17-support/pom.xml # modules/swagger-java17-support/src/test/java/io/swagger/v3/java17/resolving/SwaggerTestBase.java # modules/swagger-jaxrs2-servlet-initializer-v2/pom.xml # modules/swagger-maven-plugin/README.md # modules/swagger-maven-plugin/pom.xml # modules/swagger-models/pom.xml # modules/swagger-models/src/test/java/io/swagger/test/SimpleBuilderTest.java # modules/swagger-project-jakarta/modules/swagger-annotations-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-core-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-integration-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-jaxrs2-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-jaxrs2-servlet-initializer-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-jaxrs2-servlet-initializer-v2-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-maven-plugin-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-models-jakarta/pom.xml # modules/swagger-project-jakarta/pom.xml # pom.xml
Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.187 to 4.8.189. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](classgraph/classgraph@classgraph-4.8.187...classgraph-4.8.189) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-version: 4.8.189 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: do not discard a caller-supplied AccessorNamingStrategy
AbstractModelConverter rebuilt every ObjectMapper handed to it with
.accessorNaming(new DefaultAccessorNamingStrategy.Provider()
.withFirstCharAcceptance(true, true))
unconditionally, so any accessor naming the caller had configured was silently
replaced. Since ModelResolver derives schema property names through this mapper,
there was no way to influence that naming from the outside short of replacing
the resolver entirely.
That matters for languages whose accessors do not follow the Java bean
convention. A Kotlin `val isFoo: Boolean` compiles to `isFoo()`, whose
bean-stripped implicit name `foo` does not match the `isFoo` contributed by the
constructor parameter, so the schema ends up carrying both. A caller can teach
Jackson about that with an AccessorNamingStrategy, but the strategy never
survived into the resolver.
Swagger's own provider is now applied only when the mapper still carries
Jackson's stock provider, i.e. when the caller expressed no preference. Mappers
built by ObjectMapperFactory already carry exactly that provider, so the default
behaviour is unchanged; a custom provider, including a subclass of
DefaultAccessorNamingStrategy.Provider, is left alone.
Verified against the full swagger-core TestNG suite: 771 tests, 0 failures.
The added testCallerSuppliedAccessorNamingIsHonored fails without this change.
* Reword code comments around the caller-supplied strategy regression
The Kotlin isFoo/foo duplicate-property split described in the original
comments does not reproduce on Jackson 3 + jackson-module-kotlin 3.x, so
drop the Kotlin rationale and describe the actual failure mode: a
caller-configured AccessorNamingStrategy is honoured at serialization
time but was discarded for schema resolution, letting schema property
names diverge from the JSON the mapper produces.
---------
Co-authored-by: Vasily Pelikh <vasily.pelikh@gmail.com>
Bumps `logback-version` from 1.6.1 to 1.6.2. Updates `ch.qos.logback:logback-classic` from 1.6.1 to 1.6.2 - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](qos-ch/logback@v_1.6.1...v_1.6.2) Updates `ch.qos.logback:logback-core` from 1.6.1 to 1.6.2 - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](qos-ch/logback@v_1.6.1...v_1.6.2) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-version: 1.6.2 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: ch.qos.logback:logback-core dependency-version: 1.6.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.189 to 4.8.192. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](classgraph/classgraph@classgraph-4.8.189...classgraph-4.8.192) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-version: 4.8.192 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `logback-version` from 1.6.2 to 1.6.3. Updates `ch.qos.logback:logback-classic` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](qos-ch/logback@v_1.6.2...v_1.6.3) Updates `ch.qos.logback:logback-core` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](qos-ch/logback@v_1.6.2...v_1.6.3) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-version: 1.6.3 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: ch.qos.logback:logback-core dependency-version: 1.6.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `jackson-version` from 3.2.1 to 3.2.2. Updates `tools.jackson.dataformat:jackson-dataformat-yaml` from 3.2.1 to 3.2.2 - [Commits](FasterXML/jackson-dataformats-text@jackson-dataformats-text-3.2.1...jackson-dataformats-text-3.2.2) Updates `tools.jackson.core:jackson-databind` from 3.2.1 to 3.2.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `tools.jackson.core:jackson-core` from 3.2.1 to 3.2.2 - [Commits](FasterXML/jackson-core@jackson-core-3.2.1...jackson-core-3.2.2) Updates `tools.jackson.jakarta.rs:jackson-jakarta-rs-json-provider` from 3.2.1 to 3.2.2 Updates `tools.jackson.jakarta.rs:jackson-jakarta-rs-base` from 3.2.1 to 3.2.2 - [Commits](FasterXML/jackson-jakarta-rs-providers@jackson-jakarta-rs-providers-3.2.1...jackson-jakarta-rs-providers-3.2.2) Updates `tools.jackson.module:jackson-module-jakarta-xmlbind-annotations` from 3.2.1 to 3.2.2 - [Commits](FasterXML/jackson-modules-base@jackson-modules-base-3.2.1...jackson-modules-base-3.2.2) --- updated-dependencies: - dependency-name: tools.jackson.core:jackson-core dependency-version: 3.2.2 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: tools.jackson.core:jackson-databind dependency-version: 3.2.2 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: tools.jackson.dataformat:jackson-dataformat-yaml dependency-version: 3.2.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: tools.jackson.jakarta.rs:jackson-jakarta-rs-base dependency-version: 3.2.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: tools.jackson.jakarta.rs:jackson-jakarta-rs-json-provider dependency-version: 3.2.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: tools.jackson.module:jackson-module-jakarta-xmlbind-annotations dependency-version: 3.2.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…6-08-19 # Conflicts: # CI/prepare-release.sh # README.md # modules/swagger-annotations/pom.xml # modules/swagger-bom-integration-test/pom.xml # modules/swagger-bom/pom.xml # modules/swagger-core/pom.xml # modules/swagger-eclipse-transformer-maven-plugin/pom.xml # modules/swagger-gradle-plugin/README.md # modules/swagger-gradle-plugin/gradle.properties # modules/swagger-integration/pom.xml # modules/swagger-jakarta-rest-servlet-initializer/pom.xml # modules/swagger-jakarta-rest/pom.xml # modules/swagger-java17-support/pom.xml # modules/swagger-jaxrs2-servlet-initializer-v2/pom.xml # modules/swagger-maven-plugin/README.md # modules/swagger-maven-plugin/pom.xml # modules/swagger-models/pom.xml # modules/swagger-project-jakarta/modules/swagger-annotations-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-core-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-integration-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-jaxrs2-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-jaxrs2-servlet-initializer-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-jaxrs2-servlet-initializer-v2-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-maven-plugin-jakarta/pom.xml # modules/swagger-project-jakarta/modules/swagger-models-jakarta/pom.xml # modules/swagger-project-jakarta/pom.xml # pom.xml
The swagger-core module's bnd Import-Package instruction used line continuation backslashes only on the first line. bnd therefore parsed the second and third clauses as separate (unknown) instructions and silently dropped them, collapsing the generated manifest to a single 'jakarta.validation.constraints' import. In OSGi the bundle referenced many packages it never imported, so it failed with NoClassDefFoundError on first use. Fix the line continuations so the trailing '*' wildcard expands, and add OsgiManifestTest which uses bnd's own Analyzer to recompute the packages referenced by the module's bytecode and assert every external package is present in the generated Import-Package header.
vpelikh
force-pushed
the
fix/issue-156-osgi-import-package
branch
from
August 20, 2026 12:47
a54715b to
1e56771
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Problem
The
swagger-coremodule's generated OSGi bundle manifest declared a singleImport-Packageclause while its bytecode references many more. In OSGi a bundle can only load classes from packages it declares, so the module failed withNoClassDefFoundErroron first use.Root cause
The bnd
Import-Packageinstruction inmodules/swagger-core/pom.xmlused a line-continuation backslash on only the first line:In bnd's instruction syntax, only a line ending in
\continues to the next line. bnd therefore merged the first two lines into a single clause (jakarta.validation.constraints) and treated the remaining lines as separate unknown instructions, silently dropping them together with the trailing*wildcard. The generatedImport-Packageheader collapsed to one package.The sibling module
swagger-jakarta-restwas unaffected because it inherits the parent build's bnd configuration.Change
Added the missing
\continuations so the trailing*wildcard again expands to every referenced package:Tests
Added
OsgiManifestTestwhich uses bnd's own analysis libraries rather than a hand-rolled parser:aQute.bnd.osgi.Analyzerrecomputes, from the module's bytecode, the set of external packages it references.aQute.bnd.header.Parametersrobustly parses the generatedImport-Packageheader (correctly handling commas inside quoted version ranges).The test asserts that every externally-referenced package is present in the generated manifest's
Import-Packageheader, guarding against this class of regression. It passes with the fix and fails precisely when the bug is reintroduced.Notes
master(upstream swagger-api/swagger-core)fix/issue-156-osgi-import-package