Skip to content

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

Closed

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

  1. Mattias-Sehlstedt commented on Sep 3, 2026

    @Mattias-Sehlstedt
    Contributor

    Looks to be tied to this, i.e., also most likely that some beans have been lost in the auto-configuration changes, similar to the other issue shared. Could you confirm that 3.0.1 was the last working version for you?

  2. sasikumar-ms7 commented on Sep 3, 2026

    @sasikumar-ms7
    Author

    There is version compatibility mismatch between spring boot 4.1.1 and springdoc 3.0.1, application fails to compile with 3.0.1

    Exact root cause in log
    Caused by: java.lang.ClassNotFoundException: org.springframework.boot.hateoas.autoconfigure.HateoasProperties

    So when I downgrade to springdoc 3.0.1, springdoc tries to wire SpringDocDataRestConfiguration -> halProvider against a class that doesn’t exist in spring boot 4.1.1, causing context startup/test failure.

  3. Mattias-Sehlstedt commented on Sep 3, 2026

    @Mattias-Sehlstedt
    Contributor

    Ok so you are basically suffering from the original issue that I shared (and hence also from the issue that remain after the first fix).

    I can start investigating it and seeing what bean configuration that is best suited for handling all different scenarios once the maintainer has merged #3329.

  4. sasikumar-ms7 commented on Sep 3, 2026

    @sasikumar-ms7
    Author

    Thanks for the prompt response and support. Is there any ETA for the fix?

  5. added a commit that references this issue on Sep 6, 2026
    81cf5b3
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