Skip to content

Fix jackson version doc - #5353

Closed
daniel-kmiecik wants to merge 27 commits into
masterfrom
fix-jackson-version-doc
Closed

daniel-kmiecik wants to merge 27 commits into
masterfrom
fix-jackson-version-doc

Conversation

@daniel-kmiecik

@daniel-kmiecik daniel-kmiecik commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request

Thank you for contributing to swagger-core!

Please fill out the following information to help us review your PR efficiently.


Description

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

Screenshots / Additional Context

daniel-kmiecik and others added 27 commits September 11, 2026 14:43
---------

Signed-off-by: Vasily Pelikh <2010720+vpelikh@users.noreply.github.com>
Co-authored-by: Vasily Pelikh <2010720+vpelikh@users.noreply.github.com>
* chore: remove unused modules after migration to Jakarta

* chore: remove references to `javax` namespace and update examples/documentation for Jakarta transition
Signed-off-by: Vasily Pelikh <vasily.pelikh@gmail.com>
Signed-off-by: Vasily Pelikh <vasily.pelikh@gmail.com>
…ame resolution (#5321)

Signed-off-by: Vasily Pelikh <vasily.pelikh@gmail.com>
Co-authored-by: Daniel Kmiecik <daniel.kmiecik@smartbear.com>
Co-authored-by: Daniel Kmiecik <daniel.kmiecik@smartbear.com>
…ers (#5324)

Co-authored-by: Daniel Kmiecik <daniel.kmiecik@smartbear.com>
Signed-off-by: Vasily Pelikh <vasily.pelikh@gmail.com>
Co-authored-by: Daniel Kmiecik <daniel.kmiecik@smartbear.com>
* chore(ci): add dependabot entries for 3.0.0 and align CodeQL checkout action

* chore(deps): bump minor/patch dependency versions for 3.0.0

* chore(build): clean up build configuration and update build plugins

* test(deps): move to rest-assured 6 and stop leaking javassist from swagger-rest

* test(deps): bump Guava to 33.7.2-jre and joda-convert to 3.0.1

* refactor(maven-plugin): drop runtime plexus-utils dependency

* Remove unused org.joda.joda-convert dependency

* Fix mvn site and Gradle plugin deprecations
* fix: deduplicate subtypes before composing oneOf

Identical @JsonSubTypes entries (and Jackson's AnnotationIntrospectorPair) can
report the same subtype more than once. Once a polymorphic parent is composed
into a oneOf (see #5320), each duplicate entry becomes a
repeated $ref in the composed schema, e.g. two $refs to the same subtype.

resolveSubtypes() now drops duplicate subtypes via a new removeDuplicateSubTypes()
helper, preserving declaration order.

* Dedupe by class, not by NamedType

---------

Co-authored-by: Ewa Ostrowska <ewa.ostrowska@smartbear.com>
* feat: optionally compose @JsonSubTypes parents into oneOf

Adds an opt-in (json-subtypes-oneof system property / ModelResolver.jsonSubTypesOneOf)
that composes a @JsonSubTypes or @Schema(subTypes) parent into a self-referencing
oneOf: the parent gets a oneOf to its subtypes while the subtypes keep allOf to the
parent.

The cyclic allOf <-> oneOf shape is off by default because swagger-ui,
openapi-generator and others dislike it, so the default output is unchanged from
3.0.0. When enabled, resolveSubtypes() replaces the parent model with a
ComposedSchema whose oneOf references the resolved subtypes (using the resolved
@JsonView-aware names) and re-reads the parent from the context; an explicit
@Schema(oneOf) wins over the automatic composition to avoid a recursive
allOf <-> oneOf.

resolveSubtypes() is now protected instead of private, providing an extension
point for downstream ModelResolver subclasses that need to customize or disable
subtype resolution (see #5030).

* make oneOf use only resolved subtypes, clean up and additional tests

* change back resolveSubtypes to private, skip `composeParentAsOneOf` when `@Schema(oneOf)` is present instead of returning early

---------

Co-authored-by: Ewa Ostrowska <ewa.ostrowska@smartbear.com>
* fix: keep oneOf when WRAPPER_OBJECT wrapping is applied

ModelResolver.resolveWrapping() nested the whole model inside a new wrapper
schema that only copied the name and properties, so a model carrying a oneOf
(from @Schema(oneOf) or @JsonSubTypes) lost its composition and became a plain
object schema with a single property.

When the model already has a non-empty oneOf, add the wrapper property
directly to the model and return it, preserving the composition. Behavior is
unchanged for models without oneOf.

Adds WrapperObjectOneOfTest, which fails before the fix (ObjectSchema with no
oneOf) and passes after it.

* remove empty object placeholder, add tests

---------

Co-authored-by: Ewa Ostrowska <ewa.ostrowska@smartbear.com>
@daniel-kmiecik
daniel-kmiecik deleted the fix-jackson-version-doc branch October 19, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants