Commit b011fba
authored
refactor(schema): simplify prefix validation regex (#280)
Annoying yak shave:
- I have an ecosystem cross-reference unit test for osv.dev in the
works, which relies on using the regex in the schema definition,
verbatim.
- [Python 3.7 has a FutureWarning on set
constructs](https://docs.python.org/dev/whatsnew/3.7.html#re), where as
far as I can tell, `(:[[:digit:]]+)?` would need to be written as
`(:\[[:digit:]]+)?`, which isn't valid in the JSON Schema (more in
python/cpython#74534)
-
https://json-schema.org/draft/2020-12/json-schema-core#name-regular-expressions
says JSON Schema regex is ECMA-262, so what gets used in the schema
needs to be the subset that works with
https://docs.python.org/3/library/re.html
- https://xkcd.com/1171/
---------
Signed-off-by: Andrew Pollock <[email protected]>
Signed-off-by: Andrew Pollock <[email protected]>1 parent 2e1329f commit b011fba
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
0 commit comments