-
-
Notifications
You must be signed in to change notification settings - Fork 523
oneOf schema not generated > 2.3.0 #2575
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
Comments
Ran into the same problem, created a reproduction repository for this issue. Issue seems to happen due After a little debugging I found out the response schema class 2.3.0 is Edit: It looks like @mschout already created a fix for this: #2577. Tested it with my repository and seems to solves the issue. |
We ran into a similar (maybe the same?) issue when trying to use polymorphic types, like: @JsonTypeInfo(use = NAME, include = PROPERTY, property = DISCRIMINATOR_PROPERTY)
@JsonSubTypes(
Type(value = Activate::class, name = ACTIVATE)
)
@Schema(
subTypes = [Activate::class],
oneOf = [Activate::class],
discriminatorProperty = DISCRIMINATOR_PROPERTY,
discriminatorMapping = [
DiscriminatorMapping(value = ACTIVATE, schema = Activate::class)
]
)
sealed interface PolymorphicEvent {
@Schema(requiredProperties = [DISCRIMINATOR_PROPERTY])
@SchemaProperty(name = DISCRIMINATOR_PROPERTY, schema = Schema(allowableValues = [ACTIVATE]))
data object Activate : PolymorphicEvent
companion object {
const val DISCRIMINATOR_PROPERTY = "type"
const val ACTIVATE = "ACTIVATE"
}
} Defining this in 2.3.0 would work, but totally broke our Schema view in SwaggerUI after 2.5.0, where the |
should be fixed with #2577 |
We have a Exception handler which can handle oneOf subclasses of a exception. But since springdoc version > 2.3.0 we have the problem, that this schemas no longer be generated.
In the swagger-ui we see then this error
I didn't found anything related in the release notes of 2.4.0, are we missing something?
The text was updated successfully, but these errors were encountered: