[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:
JJ Kasper
2021-10-18 16:45:42 -05:00
committed by GitHub
parent be5c0da521
commit dccacc4ca0
4 changed files with 41 additions and 0 deletions

View File

@@ -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,
},
},

View File

@@ -36,6 +36,10 @@ export type Source = {
redirect?: Record<string, string>;
cookie?: string;
};
middleware?: {
id: string;
type: 'v8-worker';
};
};
export type Handler = {