Closed
Bug 1451334
Opened 8 years ago
Closed 8 years ago
Can't use 0 as string maxLength nor array maxItems in schema
Categories
(WebExtensions :: General, defect)
WebExtensions
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: Oriol, Assigned: Oriol)
References
Details
Attachments
(2 files)
You can define a schema with
"choices": [
{
"type": "string",
"maxLength": 0
},
{
"type": "array",
"items": {
"type": "any"
},
"maxItems": 0
}
]
but it will allow non-empty strings and non-empty arrays.
Enforcing a maximum of 0 seems stupid and I don't think Firefox schemas do it. But with the experiments API, authors can define their own schemas, and this bug becomes observable.
1. Open browser console
2. Install attached extension in about:debugging
In the console you should see 2 "TEST PASS - got an error"
Comment 1•8 years ago
|
||
Unnecessary to have QA, it's covered by a test.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
| Assignee | ||
Comment 2•8 years ago
|
||
In bug 1448120 I only fixed "minimum" for integers. I didn't fix "maxLength" for strings nor "maxItems" for arrays.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Updated•8 years ago
|
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
Resolution: --- → WONTFIX
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 4•8 years ago
|
||
Why WONTFIX? This is obviously a bug. I can use maxLength:-1 and then "foo" throws, but if I use maxLength:0 then "foo" doesn't throw? That's nonsense.
Flags: needinfo?(kmaglione+bmo)
| Assignee | ||
Updated•8 years ago
|
Summary: Can't use 0 as string maxLength nor array maxItems is schema → Can't use 0 as string maxLength nor array maxItems in schema
Comment 5•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8964968 [details]
Bug 1451334 - Allow 0 as string maxLength or array maxItems in webextension schema
https://reviewboard.mozilla.org/r/233692/#review239384
zero for maxLength here doesn't seem reasonable. throwing in other cases is not a big deal.
Attachment #8964968 -
Flags: review?(mixedpuppy) → review-
Updated•7 years ago
|
Product: Toolkit → WebExtensions
Updated•7 years ago
|
Flags: needinfo?(kmaglione+bmo)
You need to log in
before you can comment on or make changes to this bug.
Description
•