]
Daniel Cunha updated FORGE-1275:
--------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request:
@PUT method shouldn't have a @Path
----------------------------------
Key: FORGE-1275
URL:
https://issues.jboss.org/browse/FORGE-1275
Project: Forge
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Scaffold
Affects Versions: 1.4.2.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
Hi,
In the REST scaffolding, the generate {{update}} method looks like this :
{code}
@PUT
@Path("/{id:[0-9][0-9]*}")
@Consumes("application/xml")
public Response update(Book entity) {
em.merge(entity);
return Response.noContent().build();
}
{code}
The method has a {{@Path}} annotation with an id and therefore cannot be invoked (without
the id that is not used in the method). So it should simply be :
{code}
@PUT
@Consumes("application/xml")
public Response update(Book entity) {
em.merge(entity);
return Response.noContent().build();
}
{code}