Description
I'm using the following v4 schema for validation:
{ "$schema": "http://json-schema.org/draft-04/schema", "type": "array", "title": "", "description": "The stream specific schemas", "additionalItems": false, "items": { "anyOf": [ { "type": "object", "title": "", "description": "The stream specific schemas", "default": {}, "required": [], "additionalproperties": false, "properties": { "logged_in": { "type": "string", "description": "Is user logged in" }, "connection": { "type": "string", "description": "In Home or Out of Home Connection" }, "parental_controls": { "type": "string", "description": "Parental Controls Enabled" }, "screen_reader": { "type": "string", "description": "Accessibility device connected" }, "switch_accessibility": { "type": "string", "description": "Accessibility device connected" }, "university": { "type": "string", "description": "Name of university" }, "x1_user_type": { "type": "string", "description": "Type of xfinity user as defined in the token" }, "ooh_filter_enabled": { "type": "string", "description": "Status of the Out of Home filter" }, "ssid": { "type": "string", "description": "WiFi Name" }, "account_status": { "type": "string", "description": "Account status if active yet (for new customers)" }, "analytics_group": { "type": "string", "description": "Defined in features call, we assign a user to a group" }, "remote_playback_device_connected": { "type": "string", "description": "Secondary playback device connected" }, "connection_type": { "description": "Data connection type of the current user, enum value: 'None', 'WiFi', 'Cellular', 'Ethernet'", "type": "string", "enum": [ "None", "WiFi", "Cellular", "Ethernet" ] }, "version": { "description": "Platform Specific - COAM", "type": "string" } } } ] } }
and my json is
[ { } ]
that validates fine using online validators but in my app it's throwing the following error:
fatal: invalid JSON Schema, cannot continue
Syntax errors:
[ {
"level" : "warning",
"schema" : {
"loadingURI" : "#",
"pointer" : "/items/anyOf/0"
},
"domain" : "syntax",
"message" : "the following keywords are unknown and will be ignored: [additionalproperties]",
"ignored" : [ "additionalproperties" ]
}, {
"level" : "error",
"message" : "array must have at least one element",
"domain" : "syntax",
"schema" : {
"loadingURI" : "#",
"pointer" : "/items/anyOf/0"
},
"keyword" : "required"
} ]
level: "fatal"