Reputation: 173
I have list of objects, out of which one object is null. When I am trying to serialize the below data, I am getting
null of string of array of union of
[object1, object2, object3, null, object4]
Schema Definition
{
"name": "myList",
"type": [
"null",
{
"type": "array",
"items": "string"
}
],
"default": null
}
How do we allow or ignore the null in the list/array and avoid the error ? TIA
Upvotes: 0
Views: 903
Reputation: 7638
Maybe you need to also add null
as a possible value in the array?
{
"name": "myList",
"type": [
"null",
{
"type": "array",
"items": [
"null",
"string"
]
}
],
"default": null
}
Upvotes: 0