fix(rpc): protocol Route.fulfill (#3200)

This commit is contained in:
Max Schmitt 2020-07-30 05:42:14 +02:00 committed by GitHub
parent 3bd97776b8
commit 52eb6c609a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 13 deletions

View file

@ -2055,13 +2055,13 @@ export type RouteContinueOptions = {
};
export type RouteContinueResult = void;
export type RouteFulfillParams = {
status: number,
headers: {
status?: number,
headers?: {
name: string,
value: string,
}[],
body: string,
isBase64: boolean,
body?: string,
isBase64?: boolean,
};
export type RouteFulfillOptions = {

View file

@ -1694,16 +1694,17 @@ Route:
fulfill:
parameters:
status: number
# default is 200
status: number?
headers:
type: array
type: array?
items:
type: object
properties:
name: string
value: string
body: string
isBase64: boolean
body: string?
isBase64: boolean?

View file

@ -803,13 +803,13 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
postData: tOptional(tBinary),
});
scheme.RouteFulfillParams = tObject({
status: tNumber,
headers: tArray(tObject({
status: tOptional(tNumber),
headers: tOptional(tArray(tObject({
name: tString,
value: tString,
})),
body: tString,
isBase64: tBoolean,
}))),
body: tOptional(tString),
isBase64: tOptional(tBoolean),
});
scheme.ResponseBodyParams = tOptional(tObject({}));
scheme.ResponseFinishedParams = tOptional(tObject({}));