[jira] [Commented] (OFBIZ-11902) Nested attributes for Collection Types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-11902) Nested attributes for Collection Types

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-11902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17182481#comment-17182481 ]

ASF subversion and git services commented on OFBIZ-11902:
---------------------------------------------------------

Commit fdb67aee728a86d4d196ff915fb433029e6d6e22 in ofbiz-framework's branch refs/heads/trunk from girishvasmatkar
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=fdb67ae ]

WIP: Implemented: Added support for defining nested attributes.(OFBIZ-11902) (#231)

* Added nested attr definition and code to handle nested attributes

* Checkstyle error fix

* Fixed indentation and tabs issues

> 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
>            Priority: Minor
>             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 -
>   
> {code:java}
> <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> 
> {code}
>  
>  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)