Commit a9cffe1
committed
fix: resolve OpenAPI spec validation errors for token restrictions
Replace .allow(false).default(false) with .empty(Joi.valid('', false))
.allow(null).default(null) on token restriction schemas (referrers,
addresses, rateLimit). The false sentinel produced invalid OpenAPI:
type "array" with default: false and enum: [false].
Using .empty() converts false inputs to undefined (then defaulted to
null), maintaining backward compatibility for API consumers that send
false to clear restrictions. Runtime code uses truthiness checks so
null behaves identically to false.
Also replace notifyFrom .default('now') with .default(null) since
'now' is not a valid date-time value. The runtime already treats any
falsy notifyFrom as "use current time".
These changes eliminate all 5 OpenAPI validation errors, allowing SDK
generation without --skip-validate-spec.1 parent 8078830 commit a9cffe1
2 files changed
+13
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
| 633 | + | |
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1489 | 1489 | | |
1490 | 1490 | | |
1491 | 1491 | | |
1492 | | - | |
| 1492 | + | |
1493 | 1493 | | |
1494 | | - | |
1495 | | - | |
| 1494 | + | |
| 1495 | + | |
1496 | 1496 | | |
1497 | 1497 | | |
1498 | 1498 | | |
| |||
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | | - | |
| 1506 | + | |
1507 | 1507 | | |
1508 | | - | |
1509 | | - | |
| 1508 | + | |
| 1509 | + | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
1514 | 1514 | | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | | - | |
1518 | | - | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1519 | 1520 | | |
1520 | 1521 | | |
1521 | 1522 | | |
1522 | 1523 | | |
1523 | | - | |
1524 | | - | |
| 1524 | + | |
| 1525 | + | |
1525 | 1526 | | |
1526 | 1527 | | |
1527 | 1528 | | |
| |||
0 commit comments