Repository navigation
Embedded properties missing from schema in 3.1.0 with JPA and spring-boot-data-rest #3332
Description
Activity
Could be a duplicate of #3328 (as in the same cause but another symptom)?
Well, I'm not sure. I have initially seen the exception described in #3328, too, but could get rid of it by setting
useHalAsDefaultJsonMediaTypetofalse:@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
useHalAsDefaultJsonMediaTypetofalse:@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
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.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).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.
Reacted by Oliver BeckerIt 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.- added a commit that references this issue
on Sep 6, 2026
Describe the bug
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:
Springdoc 3.0.2 works as expected and generates
With Springdoc 3.1.0 both
nameproperty andNameobject schema are missing.(Note: Springdoc 3.0.3 doesn't work because of #3263)
To Reproduce
See https://github.com/obecker/springdoc-issue-demo
Run the
mainfunction inSpringdocIssueDemoApplicationand open http://localhost:8080/swagger-ui/index.htmlDowngrade the springdoc version in
build.gradle.ktsto see the old behavior.