[
https://issues.apache.org/jira/browse/OFBIZ-11995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17190066#comment-17190066 ]
Girish Vasmatkar commented on OFBIZ-11995:
------------------------------------------
Hi Jacques -
Sorry for being not clearer on the service element. May be an example XML will help clarify. The service element was in context to whether we need to allow mapping resources to Entities as well ..
{code:java}
<api description="Order Related API" displayName="Order API" name="OrderAPI" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="rest-api.xsd">
<resource description="" displayName="" enabled="true" name="Order Resource" path="/orders">
<operation verb="get" path="/{orderId}" description="Retrieves a specfici order">
<service name="getOrderDetail"/>
</operation>
<operation verb="post" description="Creates an order">
<service name="createOrder"/>
</operation>
<operation verb="get" description="Retrieves all orders">
<service name="getOrders"/>
</operation>
</resource>
<resource description="Order Item Related API" displayName="Order Item Related API" enabled="true" name="Order Item Resource" path="/orders/{orderId}">
<operation verb="post" description="Creates an order item" path="/items">
<service name="createOrderItem"/>
</operation>
<operation verb="delete" description="Deletes an order item." path="/{orderItemSeqId}">
<service name="deleteOrderItem"/>
</operation>
</resource>
</api>
{code}
I meant that in order to fetch the data, services should suffice instead of fetching from entities directly. So no need to have say <entity> element to allow fetching data from entity directly to cater to a request.
> Define schema for RESTFul resources mapping.
> --------------------------------------------
>
> Key: OFBIZ-11995
> URL:
https://issues.apache.org/jira/browse/OFBIZ-11995> Project: OFBiz
> Issue Type: Sub-task
> Components: ALL PLUGINS
> Affects Versions: Trunk
> Reporter: Girish Vasmatkar
> Assignee: Girish Vasmatkar
> Priority: Major
> Attachments: rest-api.xsd
>
>
> As a developer, I need to have the ability to define REST resources using XML DSL allowing to plug in OFBiz services to the resources that can serve the HTTP requests.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)