I’m still hitting a NullPointerException while generating /v3/api-docs for a Spring Boot 4 app using Spring Data REST repositories, even though another issue (#3328) indicates this should not occur with 3.0.2.
The issue occurs when documenting Spring Data REST repositories exposed via @RepositoryRestResource (HAL responses with embedded/links).
Spring boot: 4.1.1
Spring doc: Tested on 3.1.0 and 3.0.2 and both gives same error
Spring data rest enabled (@RepositoryRestResource in multiple repositories)
Request to /v3/api-docs returns HTTP 500.
Stack trace points to org.springdoc.core.utils.SpringDocDataRestUtils.updateResponseSchemaEmbedded(...)
Exception:
java.lang.NullPointerException: Cannot invoke "java.util.Map.get(Object)" because the return value of "io.swagger.v3.oas.models.media.Schema.getProperties()" is null
at org.springdoc.core.utils.SpringDocDataRestUtils.updateResponseSchemaEmbedded(SpringDocDataRestUtils.java:297)
- Also observed same error at line 302 when forcing OpenAPI 3.0 mode
- Disabling springdoc Data REST integration avoids the crash:
springdoc.data-rest.enabled: false
This is a workaround, but it removes Data REST docs.
Can you confirm whether this is:
- a different unhandled null-schema case in SpringDocDataRestUtils for Data REST/HAL embedded schemas?
I’m still hitting a NullPointerException while generating /v3/api-docs for a Spring Boot 4 app using Spring Data REST repositories, even though another issue (#3328) indicates this should not occur with 3.0.2.
The issue occurs when documenting Spring Data REST repositories exposed via @RepositoryRestResource (HAL responses with embedded/links).
Spring boot: 4.1.1
Spring doc: Tested on 3.1.0 and 3.0.2 and both gives same error
Spring data rest enabled (@RepositoryRestResource in multiple repositories)
Request to /v3/api-docs returns HTTP 500.
Stack trace points to org.springdoc.core.utils.SpringDocDataRestUtils.updateResponseSchemaEmbedded(...)
Exception:
java.lang.NullPointerException: Cannot invoke "java.util.Map.get(Object)" because the return value of "io.swagger.v3.oas.models.media.Schema.getProperties()" is null
at org.springdoc.core.utils.SpringDocDataRestUtils.updateResponseSchemaEmbedded(SpringDocDataRestUtils.java:297)
springdoc.data-rest.enabled: false
This is a workaround, but it removes Data REST docs.
Can you confirm whether this is: