[
https://issues.jboss.org/browse/FORGE-2177?page=com.atlassian.jira.plugin...
]
Antonio Goncalves updated FORGE-2177:
-------------------------------------
Description:
It would be good to have a command to create a REST endpoint. A command like this :
{code}
rest-new-endpoint --named MyEndpoint
{code}
Would generate
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Changing the path would be :
{code}
rest-new-endpoint --named MyEndPoint --path endpoint
{code}
This would generate :
{code}
@Path("/endpoint")
public class CustomerEndpoint
{
}
{code}
The command also allows to generate several default methods (get, post, put, delete) with
default mime type and so on :
{code}
rest-new-endpoint --named MyEndPoin --methods GET POST DELETE
{code}
This would generate :
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Also, a REST configuration class needs to be creates, such as :
{code}
@ApplicationPath("/rest")
public class RestApplication extends Application
{
@GET
@Produces({"application/xml", "application/json"})
public Response doGet()
{
return Response.noContent().build();
}
}
{code}
was:
It would be good to have a command to create a REST endpoint. A command like this :
{code}
rest-new-endpoint --named MyEndpoint
{code}
Would generate
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Changing the path would be :
{code}
rest-new-endpoint --named MyEndPoint --path endpoint
{code}
This would generate :
{code}
@Path("/endpoint")
public class CustomerEndpoint
{
}
{code}
The command also allows to generate several default methods (get, post, put, delete) with
default mime type and so on :
{code}
rest-new-endpoint --named MyEndPoin --methods GET POST DELETE
{code}
This would generate :
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Also, a REST configuration class needs to be creates, such as :
{code}
@ApplicationPath("/rest")
public class RestApplication extends Application
{
@GET
@Produces({"application/xml", "application/json"})
public Response doGet()
{
return Response.ok(entity).build();
}
}
{code}
Being able to create a new REST endpoint
----------------------------------------
Key: FORGE-2177
URL:
https://issues.jboss.org/browse/FORGE-2177
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.13.0.Final
Reporter: Antonio Goncalves
Labels: Starter
Fix For: 2.x Future
It would be good to have a command to create a REST endpoint. A command like this :
{code}
rest-new-endpoint --named MyEndpoint
{code}
Would generate
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Changing the path would be :
{code}
rest-new-endpoint --named MyEndPoint --path endpoint
{code}
This would generate :
{code}
@Path("/endpoint")
public class CustomerEndpoint
{
}
{code}
The command also allows to generate several default methods (get, post, put, delete) with
default mime type and so on :
{code}
rest-new-endpoint --named MyEndPoin --methods GET POST DELETE
{code}
This would generate :
{code}
@Path("/myEndpoint")
public class CustomerEndpoint
{
}
{code}
Also, a REST configuration class needs to be creates, such as :
{code}
@ApplicationPath("/rest")
public class RestApplication extends Application
{
@GET
@Produces({"application/xml", "application/json"})
public Response doGet()
{
return Response.noContent().build();
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)