Skip to content

NPE in SpringDocDataRestUtils.updateResponseSchemaEmbedded with Spring Data REST (still reproducible, including 3.0.2) #3337

Description

@sasikumar-ms7

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:

  1. a different unhandled null-schema case in SpringDocDataRestUtils for Data REST/HAL embedded schemas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions