Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed validation for no apparent reason? #357

Open
mrNevs opened this issue Dec 21, 2020 · 0 comments
Open

Failed validation for no apparent reason? #357

mrNevs opened this issue Dec 21, 2020 · 0 comments

Comments

@mrNevs
Copy link

mrNevs commented Dec 21, 2020

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant