2

I am using grails 3 rest-api profile. I created generated simple domain class

@Resource(readOnly = false, formats = ['json', 'xml'])
class User {
    String name
    String address
    Date dateOfBirth
}

while http://localhost:8080/user/ will give me back json list of users, if I try http://localhost:8080/user/1 if gives back :

{"message":"Not Found","error":404}

what gives ?

1977
  • 2,580
  • 6
  • 26
  • 37

2 Answers2

3

actually I since found out that the url exposed is /user/show/1

since RestResource automatically exposes a controller based on grails.rest.RestfulController you can look in that class for the full list of methods

1977
  • 2,580
  • 6
  • 26
  • 37
0

seems to be a bug. If you specify a uri it works:

@Resource(uri='/user/', readOnly = false, formats = ['json', 'xml'])
class User {
    String name
    String address
    Date dateOfBirth
}
rdmueller
  • 10,742
  • 10
  • 69
  • 126