Hi,
On Thu, Apr 3, 2014 at 6:05 AM, Jasintha Dasanayake <jasin...@wso2.com>wrote: > > > > On Wed, Apr 2, 2014 at 11:35 PM, Sohani Weerasinghe <soh...@wso2.com>wrote: > >> Hi, >> >> If I want to create an Avro Schema from XML or XSD which contains >> nillable value as shown below how can I represent it in the Avro Schema ? >> >> xml : <result xsi:nil="true" ></result> >> >> xsd : <xs:element name="result" type="xs:string" nillable="true"/> >> >> In Avro Schema we can have unions (optional fields) as shown below. >> >> {"name": "result", "type": ["int", "null"]} which means result can be >> either an int or null. >> > > This says , ["int", "null"] declares a schema which may be either a int or > null, > /Jasintha > AFAIK, there is no nillable or optional kind of specifier in Avro, using 'unions' is only possible way, I don't see this as an issue since you may handle this in avro serialization / de-serialization level. Thanks, Melan > > > >> >> Since this is not the way of representing nillables, Can someone provide >> a solution to represent nillables in Avro Schema. >> >> >> Thanks, >> Sohani >> >> Sohani Weerasinghe >> Software Engineer >> WSO2, Inc: http://wso2.com >> >> Mobile : +94 716439774 >> Blog :http://christinetechtips.blogspot.com/ >> Twitter : https://twitter.com/sohanichristine >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > > *Jasintha Dasanayake * > > *Software EngineerWSO2 Inc. | http://wso2.com <http://wso2.com/> lean . > enterprise . middleware* > > > *mobile :- 0711368118* > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Melan Nimesh* Software Engineer; WSO2 Inc.; http://wso2.org E-mail: melan AT wso2.com; Mobile: +94 77 631 6759
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev