Closed NicolasMahe closed 5 years ago
There is more option to discuss:
I've also put a low priority, as this one is not blocking us.
I think protobuf types should be only available inside the gRPC server. SDK shouldn't be aware of protobuf and gRPC. If Engine exposes other types of APIs in future, SDK shouldn't be affected by this.
Related to https://github.com/mesg-foundation/engine/pull/1141#discussion_r299009817
The ServiceSDK create function should accept another struct than
service.Service
. It doesn't make sense to create a resource by passing the already created struct to the function that create it. It makes validation harder by having to make compatibility with fields that should be field only after real creation (eg: hash).As there is too many parameters to pass to the service.create function, a nice new struct should be created.
The function
fromProtoService
functions in service api should be replaced by a function that convert the proto definition to this new service.create struct.