Skip to content

Commit

Permalink
fix(rpc): protocol Route.fulfill (#3200)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Jul 30, 2020
1 parent 3bd9777 commit 52eb6c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/rpc/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {

Expand Down
9 changes: 5 additions & 4 deletions src/rpc/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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?



Expand Down
10 changes: 5 additions & 5 deletions src/rpc/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({}));
Expand Down

0 comments on commit 52eb6c6

Please sign in to comment.