You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Embedded properties missing from schema in 3.1.0 with JPA and spring-boot-data-rest #3332
We are running a Kotlin application with spring-boot-starter-data-rest and spring-boot-starter-data-jpa.
Spring Boot version 4.1.0
Springdoc version 3.1.0
Some entity classes have embedded properties. These properties are missing in the corresponding Open API schema definitions.
Example:
@Entity
class Person {
@Id
var id: Long? = null
@Embedded
var name: Name? = null
}
@Embeddable
class Name {
var firstName: String? = null
var lastName: String? = null
}
Well, I'm not sure. I have initially seen the exception described in #3328, too, but could get rid of it by setting useHalAsDefaultJsonMediaType to false:
@Configuration
class SpringRestConfiguration : RepositoryRestConfigurer {
override fun configureRepositoryRestConfiguration(config: RepositoryRestConfiguration, cors: CorsRegistry) {
config.useHalAsDefaultJsonMediaType(false)
}
}
Well, I'm not sure. I have initially seen the exception described in #3328, too, but could get rid of it by setting useHalAsDefaultJsonMediaType to false:
@Configuration
class SpringRestConfiguration : RepositoryRestConfigurer {
override fun configureRepositoryRestConfiguration(config: RepositoryRestConfiguration, cors: CorsRegistry) {
config.useHalAsDefaultJsonMediaType(false)
}
}
It could be that your configuration makes the processing not reach the unexpected nullpointer, but that it rather instead drops the embedded processors entirely and proceeds as if they were not even there in any sense (while the entire configuration is actually designed around them having to be there).
Is it possible to get HateoasProperties on the classpath easily without issue in your test application? That would be the easiest way to verify, since if it exists then the application correctly loads the needed configurations from SpringDocHateoasConfiguration.
Hey @Mattias-Sehlstedt, I have added org.springframework.boot:spring-boot-starter-hateoas as new dependency and removed the mentioned class SpringRestConfiguration altogether (obecker/springdoc-issue-demo@244766b). Now #3328 is still not present (so adding the dependency resolves it), but also the embedded property is still missing (i.e. this issue here is still present).
It looks to be a regression from b6e5212 and how it interprets nullability. If you are not relying on KotlinNullablePropertyCustomizer to produce something important in your specification, then I believe disabling that should be a functioning fallback.
Since the currently injected magic has the same affect as upgrading swagger-core (see change to test app25 NullKeyController), I will wait until the bump is merged before making a more formal fix and maybe some targeted kotlin spring-rest regression test.
Activity
Mattias-Sehlstedt commentedon Aug 18, 2026
Could be a duplicate of #3328 (as in the same cause but another symptom)?
obecker commentedon Aug 18, 2026
Well, I'm not sure. I have initially seen the exception described in #3328, too, but could get rid of it by setting
useHalAsDefaultJsonMediaTypetofalse:Mattias-Sehlstedt commentedon Aug 18, 2026
It could be that your configuration makes the processing not reach the unexpected nullpointer, but that it rather instead drops the embedded processors entirely and proceeds as if they were not even there in any sense (while the entire configuration is actually designed around them having to be there).
Is it possible to get
HateoasPropertieson the classpath easily without issue in your test application? That would be the easiest way to verify, since if it exists then the application correctly loads the needed configurations fromSpringDocHateoasConfiguration.obecker commentedon Aug 19, 2026
Hey @Mattias-Sehlstedt, I have added
org.springframework.boot:spring-boot-starter-hateoasas new dependency and removed the mentioned classSpringRestConfigurationaltogether (obecker/springdoc-issue-demo@244766b). Now #3328 is still not present (so adding the dependency resolves it), but also the embedded property is still missing (i.e. this issue here is still present).Mattias-Sehlstedt commentedon Aug 19, 2026
Thanks for testing. In that case I will see if I get time to do some testing locally and see what the cause might be.
Mattias-Sehlstedt commentedon Aug 22, 2026
It looks to be a regression from b6e5212 and how it interprets nullability. If you are not relying on
KotlinNullablePropertyCustomizerto produce something important in your specification, then I believe disabling that should be a functioning fallback.Since the currently injected magic has the same affect as upgrading swagger-core (see change to test app25
NullKeyController), I will wait until the bump is merged before making a more formal fix and maybe some targeted kotlin spring-rest regression test.test: cover Spring Data REST with Kotlin entities