[jbosstools-issues] [JBoss JIRA] (JBIDE-18710) Invalid generated code in JAX-RS Endpoint
Xavier Coulon (JIRA)
issues at jboss.org
Fri Nov 21 05:10:39 EST 2014
[ https://issues.jboss.org/browse/JBIDE-18710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021857#comment-13021857 ]
Xavier Coulon commented on JBIDE-18710:
---------------------------------------
[~maxandersen]: with the current JAX-RS Wizard, in the case of the create() method, we generate something like this:
{code}
@RequestScoped
@Path("/pojoes")
public class PojoEndpoint {
@POST
@Consumes({ "application/xml", "application/json" })
public Response create(final Pojo pojo) {
//TODO: process the given pojo
return Response.created(UriBuilder.fromResource(Pojo.class).path(String.valueOf(pojo.getId())).build()).build();
}
}
{code}
but if the {{Pojo}} class has not {{getId()}} method, the generate source code cannot be compiled.
My question is, should we remove the method body template and just do something like
{{code}}
// TODO process the given pojo
return null;
{{code}}
instead, and let the user deal with the {{Response}} object creation ?
WDYT ?
> Invalid generated code in JAX-RS Endpoint
> -----------------------------------------
>
> Key: JBIDE-18710
> URL: https://issues.jboss.org/browse/JBIDE-18710
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: webservices
> Affects Versions: 4.2.0.Final
> Reporter: Xavier Coulon
> Assignee: Xavier Coulon
> Fix For: 4.2.1.Final, 4.3.0.Alpha1
>
>
> The generated code in the 'create' method contains something like this:
> {code}
> return Response.created(
> UriBuilder.fromResource(Session.class)
> .path(String.valueOf(session.getId())).build()).build();
> {code}
> but the {{Session.class}} should be {{SessionEndpoint.class}} since it must be the resource class annotated with {{@Path}}
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
More information about the jbosstools-issues
mailing list