You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: invalid route auth short form reports 'must be true' instead of the bad field #702
(with extensions.auth declared). The same happens for any invalid key in the object form, for example auth: {freshWithinSeconds: 0} or auth: {roles: [member]}.
Relevant output
Invalid configuration at route /api/items, auth (const): must be true
pointer: /routes/~1api~1items/auth
routes.*.auth is oneOf: [{const: true}, {$ref: routeAuth}] in schemas/urlcode.schema.json, and validateDocument (packages/core/src/config.ts) reports validate.errors[0], which is the const: true branch. The deeper error (/routes/~1api~1items/auth/bearer/quota/requests must be >= 1) is in the error list but never shown. test/extensions.test.ts:249 currently asserts the must be true message for auth: {roles: [...]}.
Possible fix: when the first error is part of a failed oneOf/anyOf and the value is an object, report the deepest error. Another option is an if/then/else on type instead of oneOf.
Activity
feat(auth): per-credential quota on bearer routes (#572) (#704)
fix(core): name the failing field in route auth and extension policy …
test(auth): expect the named quota field in route auth errors; update…
fix(core): name the failing field in validation errors and keep exten…