Hi All

Continuing the efforts done on OFBIZ-11328, I have now added an XML based
REST DSL that facilitates declarative resource bindings to OFBiz services
(for now only OFBiz service).  Various commits are pushed under OFBIZ-11995.
It attempts to allow each component to define their own set of APIs that
eventually end up being in a single runtime. At the moment, a single
OpenAPI spec (JSON and YAML) is generated clubbing together APIs defined in
all components. I wish to provide separate OpenAPI for each component
considering the combined spec becomes too huge.

I have also developed a demo component under my forked plug-in to give you
an idea of how the resources can be defined and mapped to OFBiz services.
Pl take a look at -
https://github.com/girishvasmatkar/ofbiz-plugins/tree/trunk/rest-impl-demo

In the demo, I have configured some resources like below -

POST  /rest*/*products (Create a new product)
GET /rest/products/{productId} (Get product)
POST /rest/products/features (Create a new feature)
POST /rest/products/{productId}/features (Apply feature to product)
GET /rest/products/{productId}/features/{featureId}

POST /rest/categories (Create a new category)
GET /rest/categories (Get all categories)

Schema file can be defined under
<component-root>/api/<component-name>.rest.xml

For now, JSON is supported and I intend to bring in XML in the mix as well
based on the Content-Type header.
There may be some refinement needed and some extra use cases that may not
work, so please feel free to let me know how it goes and any changes you
would like to make and I will try to accomodate.

Best,
Girish
HotWax Systems

Reply via email to