Hi Malaka, On Tue, Jun 7, 2016 at 10:45 AM, Malaka Silva <[email protected]> wrote:
> Hi Sohani, > > I guess we are dealing with optional input/output here. So in that case > are we showing those in a different color or anyway to distinguish? > > On execution side this needs to be handled from data mapper mediator. > This is handled by the mapping configuration generation in data mapper editor so that data mapper engine may have minimum changes. > > On Tue, Jun 7, 2016 at 9:21 AM, Sohani Weerasinghe <[email protected]> > wrote: > >> Hi All, >> >> We are in a process of implementing the $subject and please find the >> implementation details. >> >> *Input*: >> >> <h:person xmlns:h="http://www.w3.org/TR/html4/"> >> <firstName>sample</firstName> >> <phone primary="false">0112655655<ext>01</ext></phone> >> <phone primary="false">0112655655<ext>01</ext></phone> >> </h:person> >> >> After loading the above payload, the generated schema will be as follows >> >> { >> "$schema" : "http://json-schema.org/draft-04/schema#", >> *"nullable" : "false"*, >> "id" : "http://wso2jsonschema.org", >> "title" : "h:person", >> "type" : "object", >> "properties" : { >> "firstName" : { >> *"nullable" : "false",* >> "id" : "http://wso2jsonschema.org/firstName", >> "type" : "string" >> }, >> *"nullable" : "false"*, >> "phone" : { >> "id" : "http://wso2jsonschema.org/phone", >> "type" : "array", >> "items" : [ { >> "attributes" : { >> "primary" : { >> * "nullable" : "false"*, >> "id" : "http://wso2jsonschema.org/phone/0/primary", >> "type" : "boolean" >> } >> }, >> "id" : "http://wso2jsonschema.org/phone/0", >> "type" : "object", >> "value" : { >> "type" : "number" >> }, >> "properties" : { >> "ext" : { >> * "nullable" : "false",* >> "id" : "http://wso2jsonschema.org/phone/0/ext", >> "type" : "number" >> } >> } >> } ] >> } >> }, >> "namespaces" : [ { >> "prefix" : "h", >> "url" : "http://www.w3.org/TR/html4/" >> } ] >> } >> >> Then, user can right click on the node and click on 'Enable Nullable' and >> make the object or array or element, etc nullable. >> >> >> The schema will be as follows >> >> { >> "$schema" : "http://json-schema.org/draft-04/schema#", >> * "nullable" : "true",* >> "id" : "http://wso2jsonschema.org", >> "title" : "h:person", >> "type" : "object", >> "properties" : { >> "firstName" : { >> "nullable" : "false", >> "id" : "http://wso2jsonschema.org/firstName", >> "type" : "string" >> }, >> "nullable" : "false", >> "phone" : { >> "id" : "http://wso2jsonschema.org/phone", >> "type" : "array", >> "items" : [ { >> "attributes" : { >> "primary" : { >> "nullable" : "false", >> "id" : "http://wso2jsonschema.org/phone/0/primary", >> "type" : "boolean" >> } >> }, >> "id" : "http://wso2jsonschema.org/phone/0", >> "type" : "object", >> "value" : { >> "type" : "number" >> }, >> "properties" : { >> "ext" : { >> "nullable" : "false", >> "id" : "http://wso2jsonschema.org/phone/0/ext", >> "type" : "number" >> } >> } >> } ] >> } >> }, >> "namespaces" : [ { >> "prefix" : "h", >> "url" : "http://www.w3.org/TR/html4/" >> } ] >> } >> >> If a user wants to disable it then, user can right click on the node and >> click on 'Disable Nullable' >> >> >> >> After enabling, we thought of changing the icon of the tree node so that >> user can easily identify whether a particular node is a nullable or not. >> >> Thanks, >> Sohani >> Sohani Weerasinghe >> Senior Software Engineer >> WSO2, Inc: http://wso2.com >> >> Mobile : +94 716439774 >> Blog :http://christinetechtips.blogspot.com/ >> Twitter : https://twitter.com/hanichristine >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > > Best Regards, > > Malaka Silva > Senior Technical Lead > M: +94 777 219 791 > Tel : 94 11 214 5345 > Fax :94 11 2145300 > Skype : malaka.sampath.silva > LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 > Blog : http://mrmalakasilva.blogspot.com/ > > WSO2, Inc. > lean . enterprise . middleware > http://www.wso2.com/ > http://www.wso2.com/about/team/malaka-silva/ > <http://wso2.com/about/team/malaka-silva/> > https://store.wso2.com/store/ > > Save a tree -Conserve nature & Save the world for your future. Print this > email only if it is absolutely necessary. > Thanks, Nuwan -- ---------------------------------------------------------- *Nuwan Chamara Pallewela* *Software Engineer* *WSO2, Inc. *http://wso2.com *lean . enterprise . middleware* Email *[email protected] <[email protected]>* Mobile *+94719079739 <%2B94719079739>@*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
