Closed kamok closed 3 years ago
I didn't get your idea. new Book()
already give you the instance with all the getters and setters.
It means this: protocolbuffers/protobuf-javascript#96
It looks like it's been a very popular open issue for developers to be able to create a new Book()
from a JSON object
Check this: protocolbuffers/protobuf-javascript#96
This one is the official maintainer of repo: https://github.com/grpc/grpc-node , https://github.com/grpc/grpc-node/tree/master/packages/grpc-tools
And d.ts signatures are keeping consistent with generated js codes. We need grpc-tools
to support this first. Seems it's not supported yet.
Ok so basically unless grpc-tools library implement the fromObject, this library will not have the change. Thanks, that what i wanted to know. In case other people want this feature, I read on here: https://github.com/grpc/grpc-node/issues/1730#issuecomment-815137482
That you can serialize + deserialize which would give you the instance of Message you need. Or you can write your own method that takes in a object of a specific type, and imperatively call every single one of those setter methods to build it.
Closing for now!
For example, in your example repo, you have this:
Is there a way to generate a
new Book
that has all the corresponding getter methods? I'm trying to test a piece of code that directly accessesBook.getTitle
.