Hi Sohani,

Normally we are getting null value for optional parameter in the API
response, suppose if we get the actual value for that json object , does
this schema handle that case?





*Thank youVivekananthan Sivanayagam*

*Associate Software Engineer | WSO2*

*E:[email protected] <e%[email protected]>*
*M:+94752786138*

On Wed, May 18, 2016 at 11:19 AM, Sohani Weerasinghe <[email protected]>
wrote:

> Hi All,
>
> If a json payload has null values as shown below, how are we going to
> represent this in the json schema?
>
> {
>   "root": {
> "tasklist_id": "12345",
> "test"=null
> }
> }
>
> If we are serializing that value, then the generated schema and the tree
> view will be as follows
>
> {
>   "$schema" : "http://json-schema.org/draft-04/schema#";,
>   "id" : "http://wso2jsonschema.org";,
>   "title" : "root",
>   "type" : "object",
>   "properties" : {
>     *"test" : {*
> *      "id" : "http://wso2jsonschema.org/test
> <http://wso2jsonschema.org/test>",*
> *      "type" : "null"*
> *    },*
>     "tasklist_id" : {
>       "id" : "http://wso2jsonschema.org/tasklist_id";,
>       "type" : "string"
>     }
>   }
> }
>
>
> ​
>
> Appreciate your input on this
>
> 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
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to