mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
[routing-utils] Update routes schema for new property (#6860)
Adds an additional property for the `routes` schema.
### Related Issues
N/A
### 📋 Checklist
<!--
Please keep your PR as a Draft until the checklist is complete
-->
#### Tests
- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`
#### Code Review
- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
This commit is contained in:
@@ -150,6 +150,22 @@ export const routesSchema = {
|
||||
},
|
||||
},
|
||||
},
|
||||
middleware: {
|
||||
type: 'object',
|
||||
required: ['id', 'type'],
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
maxLength: 256,
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
maxLength: 32,
|
||||
enum: ['v8-worker'],
|
||||
},
|
||||
},
|
||||
},
|
||||
has: hasSchema,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -36,6 +36,10 @@ export type Source = {
|
||||
redirect?: Record<string, string>;
|
||||
cookie?: string;
|
||||
};
|
||||
middleware?: {
|
||||
id: string;
|
||||
type: 'v8-worker';
|
||||
};
|
||||
};
|
||||
|
||||
export type Handler = {
|
||||
|
||||
Reference in New Issue
Block a user