Girish Vasmatkar created OFBIZ-11902:
----------------------------------------
Summary: Nested attributes for Collection Types
Key: OFBIZ-11902
URL: https://issues.apache.org/jira/browse/OFBIZ-11902
Project: OFBiz
Issue Type: Improvement
Components: ALL APPLICATIONS
Affects Versions: Trunk
Reporter: Girish Vasmatkar
Assignee: Girish Vasmatkar
Fix For: Upcoming Branch
While working on OpenApi integration as well as GraphQL implementation, I faced
issues on how to automatically document request/response JSON structure for
service attributes that were of Collection types (Map, List etc).
For simple types, it is just plain easy but when it comes to Map/Lists, you
have to know what exactly is inside them to be able to convey properly in the
OpenApi schema.
I was thinking to may be try to introduce nested attributes in service
definition such that if the attribute type is Map/List, you can actually
specify what goes inside that attribute -
<attribute name=_"header"_ type=_"Map"_ mode=_"IN"_ optional=_"true"_ >
<attribute name=_"xy"_ type=_"Integer"_ default-value=_"0"_ />
<attribute name=_"xyz"_ type=_"String"_ default-value=_"test"_/>
</attribute>
With this change, it becomes possible to generate the schema for the service
attribute, Where as if we don't have this option, we can't possibly indicate
what the structure of the "header" key is going to be if it was represented in
JSON format.
Of course, this change will only help documentation and GraphQL implementation
and that there is very little case for it to benefit a general OFBiz service
call.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)