Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog     :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine


On Mon, May 5, 2014 at 2:09 PM, Gayan Yalpathwala <[email protected]> wrote:

> Hi,
>
> Current implementation of visual DataMapper always expects schemas with a
> root record (Type). This basically should be a named record so that it
> could be visually represented in the tree structure. A sample is given
> below.
>
> {
>    "name":"sfRecords",
>    "type":"record",
>    "fields":[
>       {
>          "name":"sfRecord",
>          "type":{
>             "type":"array",
>             "items":{
>                "name":"sfRecord",
>                "type":"record",
>                "fields":[
>                   {
>                      "name":"Opportunity_Name",
>                      "type":"string"
>                   },
>                   {
>                      "name":"Account_Name",
>                      "type":"string"
>                   },
>                   {
>                      "name":"Amount",
>                      "type":"string"
>                   }
>                ]
>             }
>          }
>       }
>    ]
> }
>
> ​
> A problem occurs when a JSON data-set is converted to avro schema using
> the given option. JSON can exist without a named root node therefore such
> input cannot be represented visually.
>
> Eg:-
>
>  {
>    "expand":"schema,names",
>    "startAt":0,
>    "maxResults":50,
>    "total":6,
>    "issues":[
>       {
>          "id":"10230",
>          "self":"http://kelpie9:8081/rest/api/2/issue/BULK-62";,
>          "key":"BULK-62"
>       },
>       {
>          "id":"10004",
>          "self":"http://kelpie9:8081/rest/api/2/issue/BULK-47";,
>          "key":"BULK-47"
>       }
>    ]
> }
>
> What will be the approach for handling inputs like this? IMO, we can
> introduce a default root node to both input and output tree structures, so
> that any forthcoming elements can be listed below that regardless of their
> type (either Type, List or Attribute).
>

+1 for introducing a default root node and remove it at runtime.

>
> Thanks,
>
>
> --
> *Gayan Kaushalya Yalpathwala*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 71 8682704 <http://asia14.wso2con.com/>
>
>  <http://asia14.wso2con.com/>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to