Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do not require JsonSubType annotation for sealed classes #2696

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

sahil-ramagiri
Copy link
Contributor

Description of Changes

  1. SpringDocSealedClassModule.java
    • Provides swagger and jackson with the ability to introspect annotations and resolve subclasses from the permits list of sealed classes.
    • Ensures that subclasses are correctly identified without the need for JsonSubType annotations.
  2. SpringDocConfiguration.java
    • Registers the new SpringDocSealedClassModule with objectmapper.
  3. API Tests 224, 225
    • Includes polymorphic deserialization tests to verify functionality without JsonSubType annotations.

Important Note

@bnasslahsen
Copy link
Collaborator

@sahil-ramagiri,

Your PR is still in draft mode.
Are you willing to finish it, or we need to close it ?

@sahil-ramagiri
Copy link
Contributor Author

sahil-ramagiri commented Sep 24, 2024

@sahil-ramagiri,

Your PR is still in draft mode. Are you willing to finish it, or we need to close it ?

@bnasslahsen This is dependent on this other issue in swagger-core. I am trying to get their attention but failing to do so. What do you suggest?

swagger-api/swagger-core#4744
swagger-api/swagger-core#4728

@bnasslahsen
Copy link
Collaborator

@sahil-ramagiri,

Just try to ping them again, no worries

@bnasslahsen bnasslahsen changed the title Do not require JsonSubType annotation for sealed classes. Do not require JsonSubType annotation for sealed classes Oct 5, 2024
@bnasslahsen
Copy link
Collaborator

i see

@sahil-ramagiri sahil-ramagiri marked this pull request as ready for review January 17, 2025 22:55
@sahil-ramagiri
Copy link
Contributor Author

@bnasslahsen The latest release of swagger-core includes my fixes. This PR is finally ready to be merged. Please review.

@bnasslahsen bnasslahsen merged commit 8f98a39 into springdoc:main Feb 16, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants