-
Notifications
You must be signed in to change notification settings - Fork 421
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
Crash with "in <string>' requires string as left operand, not int" #1508
Comments
To fix this issue, start by reproducing in a test (in
Introspect the validation |
Sorry for my english. Could you help me to configure and run tests correctly. My system info: Arch Linux After all tutorials reading, I use in virtual environment(after
Also, when I run make test, some of them crashes too with similar errors. I was watching through issues, but didn't find anything. What is wrong? |
Did you try what folks suggest on the InternetZ for the |
I have tried to delete all .pyc files and no changes. But on Xubuntu(from VirtualBox) this error doesn't exist. and if I run test with |
@leplatrem I'm trying to reproduce this issue and it looks like the schema is incomplete (minVersion and maxVersion use $ref). I'm not an expert in jsonschema, so I might be wrong. |
You're right! Sorry! The full JSON schema would be this one. You can use to try to reproduce the issue and we can simplify it afterwards :) {
"definitions": {
"minVersion": {
"type": "string",
"title": "Min version",
"description": "The mininum version."
},
"maxVersion": {
"type": "string",
"title": "Max version",
"description": "The maximum version."
}
},
"title": "Add-on",
"description": "Add-on",
"type": "object",
"additionalProperties": false,
"required": [
"guid"
],
"default": {
"guid": "",
"prefs": [
],
"versionRange": [
{
"minVersion": "0",
"maxVersion": "*",
"severity": 1
}
]
},
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"description": "blocking rule is enabled.",
"default": true
},
"guid": {
"type": "string",
"title": "Add-on id",
"description": "The add-on unique identifier or a regular expression.",
"minLength": 1,
"default": ""
},
"os": {
"type": "string",
"title": "OS",
"description": "The comma-separated operating system identifiers, eg. Darwin,Linux",
"pattern": "^[^,]*(,[^,]+)*$"
},
"prefs": {
"type": "array",
"title": "Preferences",
"description": "The list of impacted preferences.",
"uniqueItems": true,
"default": [
],
"items": {
"title": "Preference name",
"description": "The browser preference name, eg. browser.startup.homepage",
"type": "string",
"minLength": 1,
"default": ""
}
},
"versionRange": {
"type": "array",
"title": "Versions",
"description": "The list of impacted versions.",
"items": {
"type": "object",
"title": "Version range",
"description": "Version range",
"additionalProperties": false,
"required": [
"minVersion",
"maxVersion",
"severity"
],
"default": {
"minVersion": "",
"maxVersion": "",
"severity": 1
},
"properties": {
"minVersion": {
"$ref": "#/definitions/minVersion"
},
"maxVersion": {
"$ref": "#/definitions/maxVersion"
},
"severity": {
"type": "integer",
"title": "Severity",
"description": "The severity code number.",
"enum": [
1,
3
],
"enumNames": [
"1 - Soft block",
"3 - Hard block"
],
"default": 1
},
"targetApplication": {
"type": "array",
"title": "Target applications",
"description": "The list of target application information.",
"default": [
],
"items": {
"type": "object",
"title": "Target application",
"description": "Target application",
"additionalProperties": false,
"required": [
"guid",
"minVersion",
"maxVersion"
],
"properties": {
"guid": {
"type": "string",
"title": "Application id",
"description": "The application unique identifier.",
"enum": [
"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
"{3550f703-e582-4d05-9a08-453d09bdfdc6}",
"{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}",
"{aa3c5121-dab2-40e2-81ca-7ea25febc110}"
],
"enumNames": [
"Firefox",
"Thunderbird",
"Seamonkey",
"Android"
]
},
"minVersion": {
"$ref": "#/definitions/minVersion"
},
"maxVersion": {
"$ref": "#/definitions/maxVersion"
}
}
}
}
}
}
},
"details": {
"type": "object",
"title": "Details",
"required": [
"name",
"why"
],
"properties": {
"name": {
"type": "string",
"title": "Name"
},
"why": {
"type": "string",
"title": "Why"
},
"who": {
"type": "string",
"title": "Who"
},
"bug": {
"type": "string",
"title": "Bug"
},
"created": {
"type": "string",
"format": "date-time"
}
}
},
"blockID": {
"type": "string",
"title": "Internal blocklist id",
"description": "Original block id, eg. i152",
"pattern": "^i[0-9]+$"
}
}
} |
Thank you @leplatrem, I manage to reproduce the issue now.
With this record: This issue related to error_handler, it doesn't expect array indexes as element names here Line 151 in c788175
It seems quite easy to fix, but the question I have is more about the format of message we want to show. Now it will be something like this: |
Cool! Thanks!
I'm ok with this! ;) |
Validation messages are tricky, because we'd have introspect the internal of jsonschema validation... Which is not recommended :/ |
#1508 - fix json_error_handler behaviour in case field name is index
The text was updated successfully, but these errors were encountered: