Yes then it would be fine Nuwan and I'll proceed with this. On Wed, May 18, 2016 at 4:43 PM, Nuwan Pallewela <nuw...@wso2.com> wrote:
> Hi Hariprasath, > > Raw field holds a byte stream value. As the JSON Schema only have seven > primitive data types[1], I think current way of defining the type as String > is the correct way to represent it in the schema. That is because we are > not going to process this raw in the data mapper any way. We will only map > it's value into some field in the output message. > WDYT? > > [1] http://json-schema.org/latest/json-schema-core.html#anchor8 > > Thanks, > Nuwan > > On Wed, May 18, 2016 at 3:47 PM, Hariprasath Thanarajah < > haripras...@wso2.com> wrote: > >> Hi Nuwan, >> >> I have attached the file that I used to create the output schema for >> listTheHistory method for Gmail REST connector. >> >> On Wed, May 18, 2016 at 3:42 PM, Nuwan Pallewela <nuw...@wso2.com> wrote: >> >>> Hi Hariprasath, >>> >>> How did you generate the schema and what is the payload you used to >>> generate it? >>> >>> Thanks, >>> Nuwan >>> >>> On Wed, May 18, 2016 at 3:32 PM, Hariprasath Thanarajah < >>> haripras...@wso2.com> wrote: >>> >>>> Hi All, >>>> >>>> Currently I am doing the schema generation for Gmail REST connector. In >>>> most of the methods in this connector have the response part as[1], But in >>>> the JSON schema the type was generated as string[2]. >>>> >>>> Is there any way to generate as bytes or is it ok to proceed as below? >>>> >>>> [1] - { >>>> "id": string, >>>> "threadId": string, >>>> "labelIds": [ >>>> string >>>> ], >>>> "snippet": string, >>>> "historyId": unsigned long, >>>> "internalDate": long, >>>> "payload": { >>>> "partId": string, >>>> "mimeType": string, >>>> "filename": string, >>>> "headers": [ >>>> { >>>> "name": string, >>>> "value": string >>>> } >>>> ], >>>> "body": users.messages.attachments Resource, >>>> "parts": [ >>>> (MessagePart) >>>> ] >>>> }, >>>> "sizeEstimate": integer, >>>> "raw": bytes >>>> } >>>> >>>> [2] - >>>> {"id":"http:\/\/wso2jsonschema.org","title":"root","$schema":"http:\/\/ >>>> json-schema.org >>>> \/draft-04\/schema#","properties":{"history":{"id":"http:\/\/ >>>> wso2jsonschema.org\/history","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org\/history\/0","properties":{"id":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/id","type":"number"},"labelsRemoved":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0","properties":{"message":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message","properties":{ >>>> "raw":{"id":"http:\/\/wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/raw","type":"string" >>>> },"id":{"id":"http:\/\/wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/id","type":"string"},"labelIds":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/labelIds","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/labelIds\/0","type":"string"}],"type":"array"},"threadId":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/threadId","type":"string"},"historyId":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/historyId","type":"string"},"payload":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload","properties":{"headers":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/headers","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/headers\/0","type":"object"}],"type":"array"},"body":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/body","properties":{"attachmentId":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/body\/attachmentId","type":"string"},"data":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/body\/data","type":"string"},"size":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/body\/size","type":"string"}},"type":"object"},"filename":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/filename","type":"string"},"parts":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0","properties":{"headers":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/headers","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/headers\/0","properties":{"name":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/headers\/0\/name","type":"string"},"value":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/headers\/0\/value","type":"string"}},"type":"object"}],"type":"array"},"filename":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/filename","type":"string"},"partId":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/partId","type":"string"},"mimeType":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/parts\/0\/mimeType","type":"string"}},"type":"object"}],"type":"array"},"partId":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/partId","type":"string"},"mimeType":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/payload\/mimeType","type":"string"}},"type":"object"},"sizeEstimate":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/sizeEstimate","type":"number"},"snippet":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/snippet","type":"string"},"internalDate":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/message\/internalDate","type":"string"}},"type":"object"},"labelIds":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/labelIds","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsRemoved\/0\/labelIds\/0","type":"string"}],"type":"array"}},"type":"object"}],"type":"array"},"messagesDeleted":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/messagesDeleted","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/messagesDeleted\/0","type":"object"}],"type":"array"},"messagesAdded":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/messagesAdded","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/messagesAdded\/0","type":"object"}],"type":"array"},"labelsAdded":{"id":"http:\/\/ >>>> wso2jsonschema.org\/history\/0\/labelsAdded","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/labelsAdded\/0","type":"object"}],"type":"array"},"messages":{"id":"http:\/\/ >>>> wso2jsonschema.org\/history\/0\/messages","items":[{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/history\/0\/messages\/0","type":"object"}],"type":"array"}},"type":"object"}],"type":"array"},"historyId":{"id":"http:\/\/ >>>> wso2jsonschema.org >>>> \/historyId","type":"string"},"nextPageToken":{"id":"http:\/\/ >>>> wso2jsonschema.org\/nextPageToken","type":"string"}},"type":"object"} >>>> >>>> -- >>>> >>>> >>>> *Thank you and Regards**Hariprasath Thanarajah* >>>> Associate Software Engineer | WSO2 >>>> E: haripras...@wso2.com >>>> M: +94752806528, 0777216903 >>>> >>>> >>> >>> >>> -- >>> ---------------------------------------------------------- >>> >>> *Nuwan Chamara Pallewela* >>> >>> >>> *Software Engineer* >>> >>> *WSO2, Inc. *http://wso2.com >>> *lean . enterprise . middleware* >>> >>> Email *nuw...@wso2.com <nuw...@wso2.com>* >>> Mobile *+94719079739 <%2B94719079739>@* >>> >>> >>> >> >> >> -- >> >> >> *Thank you and Regards**Hariprasath Thanarajah* >> Associate Software Engineer | WSO2 >> E: haripras...@wso2.com >> M: +94752806528, 0777216903 >> >> > > > -- > ---------------------------------------------------------- > > *Nuwan Chamara Pallewela* > > > *Software Engineer* > > *WSO2, Inc. *http://wso2.com > *lean . enterprise . middleware* > > Email *nuw...@wso2.com <nuw...@wso2.com>* > Mobile *+94719079739 <%2B94719079739>@* > > > -- *Thank you and Regards**Hariprasath Thanarajah* Associate Software Engineer | WSO2 E: haripras...@wso2.com M: +94752806528, 0777216903
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev