Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-1248

Cannot sort by property marked with JsonProperty.Access.READ_ONLY

    XMLWordPrintable

    Details

      Description

      If an entity field is marked read-only, sorting does not work.

      For example:

      public class User {
         ...
         @JsonProperty(access = JsonProperty.Access.READ_ONLY)
         private String name;
      }
      

      then api call

      .../api/users?sort=name,desc

      does not sort by name.

      Removing the annotation makes sorting work again.

      This problem has also been mentioned in a comment under DATAREST-976, but with an embedded property. It happens for non-embedded properties as well.

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            nsomlai@gmail.com Norbert Somlai
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: