I have very basic schema that behaves somehow strange.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties":
{
"$out":
{
"type": "array",
"minItems": 1,
"items": {
"oneOf": [
{ "type": "string" },
{ "$ref": "#/definitions/alias" }
]
}
}
},
"definitions":
{
"alias":
{
"properties":
{
"$source": { "type": "string" },
"$alias": { "type": "string" }
},
"required": [ "$source", "$alias" ],
"additionalProperties": false
}
}
}
If I use the following JSON to test:
{
"$out": [
"12w",
{ "$source": "WH.Code", "$alias": "WarehouseCode"}
]
}
It fails (sample) saying that string element in array is valid agains more that one schema. If I change reference to 'alias' with say just { "type": "string" } it works as expected. What am I doing wrong?
Thanks in advance.