Skip to content

Posting text/uri-list to the wrong location results in a 500 [DATAREST-818] #1194

Open

Description

@spring-projects-issues

Christian Bongiorno opened DATAREST-818 and commented

When submitting a text/uri-list to add to a collection of relationships (as per the link above),

a 4xx error is more appropriate.

This error was my fault, definitely. But the 500 error set me scratching my head for a while. It was totally a client side problem


Affects: 2.4.4 (Gosling SR4)

Reference URL: http://stackoverflow.com/questions/36994490/adding-a-resource-to-a-collection-using-spring-data-rest

Activity

  1. BabalolaBrainiac commented on May 17, 2026

    @BabalolaBrainiac

    Hi, I'd like to work on this. The 500 occurs because UriListHttpMessageConverter matches text/uri-list requests but returns a CollectionModel instead of the target domain type. When PersistentEntityResourceHandlerMethodArgumentResolver tries to bind that to the entity, it fails downstream. I'll add a type check after reading the body to throw HttpMessageNotReadableException (mapped to 400) instead. PR coming shortly.

  2. added 3 commits that reference this issue on May 17, 2026
    8cd6da9
    a6390d9
    8c56fec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions