Re: [Dev] XML attribute representation of JSON Schema
Thanks Maheeka for the response Regards, Sohani Sohani Weerasinghe Software Engineer WSO2, Inc: http://wso2.com Mobile : +94 716439774 Blog :http://christinetechtips.blogspot.com/ Twitter : https://twitter.com/sohanichristine On Tue, Mar 29, 2016 at 9:44 AM, Maheeka Jayasuriya wrote: > Hi Sohani, > > As per previous discussion, instead of properties array with attributes > supported with @ prefix, we use an attributes array in the schema. > > For example : > > Current definition : > > "address": { > "id": "http://jsonschema.net/employee/0/address";, > "type": "object", > "properties": { > "city": { > "id": "http://jsonschema.net/employee/0/address/city";, > "type": "string" > }, > "@no": { > "id": "http://jsonschema.net/employee/0/address/no";, > "type": "string" > }, > "road": { > "id": "http://jsonschema.net/employee/0/address/road";, > "type": "string" > } > } > } > > With attributes array : > > "address": { > "id": "http://jsonschema.net/employee/0/address";, > "type": "object", > "attributes": { > "no": { > "id": "http://jsonschema.net/employee/0/address/no";, > "type": "string" > } > }, > "properties": { > "city": { > "id": "http://jsonschema.net/employee/0/address/city";, > "type": "string" > }, >"road": { > "id": "http://jsonschema.net/employee/0/address/road";, > "type": "string" > } > } > } > > Two reasons to suggest this : > > 1. We do not have to use a prefix to define attributes and they can be > easily distinguished from other fields since they are defined separate from > other fields (properties) > 2. In the case of a primitive type with attributes, we can still preserve > the type as string and have attributes instead of using properties (since > properties are only valid in json schema for object type) > > > Thanks, > Maheeka > > Maheeka Jayasuriya > Software Engineer > Mobile : +9450661 > > On Tue, Mar 29, 2016 at 8:41 AM, Sohani Weerasinghe > wrote: > >> Hi All, >> >> Currently we are representing the attributes using @prefix in JSON >> Schema. Can someone please specify the expected representation using the >> "attributes" field. >> >> 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
Re: [Dev] XML attribute representation of JSON Schema
Hi Sohani, As per previous discussion, instead of properties array with attributes supported with @ prefix, we use an attributes array in the schema. For example : Current definition : "address": { "id": "http://jsonschema.net/employee/0/address";, "type": "object", "properties": { "city": { "id": "http://jsonschema.net/employee/0/address/city";, "type": "string" }, "@no": { "id": "http://jsonschema.net/employee/0/address/no";, "type": "string" }, "road": { "id": "http://jsonschema.net/employee/0/address/road";, "type": "string" } } } With attributes array : "address": { "id": "http://jsonschema.net/employee/0/address";, "type": "object", "attributes": { "no": { "id": "http://jsonschema.net/employee/0/address/no";, "type": "string" } }, "properties": { "city": { "id": "http://jsonschema.net/employee/0/address/city";, "type": "string" }, "road": { "id": "http://jsonschema.net/employee/0/address/road";, "type": "string" } } } Two reasons to suggest this : 1. We do not have to use a prefix to define attributes and they can be easily distinguished from other fields since they are defined separate from other fields (properties) 2. In the case of a primitive type with attributes, we can still preserve the type as string and have attributes instead of using properties (since properties are only valid in json schema for object type) Thanks, Maheeka Maheeka Jayasuriya Software Engineer Mobile : +9450661 On Tue, Mar 29, 2016 at 8:41 AM, Sohani Weerasinghe wrote: > Hi All, > > Currently we are representing the attributes using @prefix in JSON Schema. > Can someone please specify the expected representation using the > "attributes" field. > > 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
[Dev] XML attribute representation of JSON Schema
Hi All, Currently we are representing the attributes using @prefix in JSON Schema. Can someone please specify the expected representation using the "attributes" field. 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