Commit 802f530
committed
🔧 enable ajv strict mode and fix view schema type declaration
- Add `strict: true` to Ajv options to surface schema issues earlier
- Add `allowUnionTypes: true` to relax the strict mode rule disallowing union
types, since the schemas use them intentionally
- Wrap `ajv.validate()` in a try/catch to report schema-level errors (e.g.
unknown keywords) without crashing, since strict mode can throw instead of
returning false
- Add `"type": "object"` to the `view` property in view-schema.json, which
strict mode now requires1 parent 5ddfd3b commit 802f530
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
| |||
0 commit comments