Closed
Description
📚 Documentation
Hi all, currently I have this protobuf:
message FooResponse {
repeated int foo = 1;
}
Which gets compiled into the following typescript definition using proto-gen-ts
export class FooResponse extends jspb.Message {
getFooList(): Array<int>;
setFooList(value: Array<int>): void;
clearFooList(): void;
addFoo(value?: int, index?: number): APIKey;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): FooResponse.AsObject;
static toObject(includeInstance: boolean, msg: FooResponse): FooResponse.AsObject;
static serializeBinaryToWriter(message: FooResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): FooResponse;
static deserializeBinaryFromReader(message: FooResponse, reader: jspb.BinaryReader): FooResponse;
}
export namespace FooResponse {
export type AsObject = {
fooList: Array<int>,
}
}
I want to be able to use this type in my front-end, but the JSON data returned by my grpc-gateway looks like this:
{ foo: [1, 2, 3] }
Instead of the expected
{ fooList: [1, 2, 3] }
Any way around this? Would I need to implement a custom marshaler just to achieve this desired result?
Metadata
Metadata
Assignees
Labels
No labels