fix: only return Observable types for NestJS if the option is switched on
We're using --ts_proto_opt=nestjs=true and wanted to remove Observable's being returned, so we tried --ts_proto_opt=returnObservable=false but it had no effect.
This PR fixes that issue so it does behave as expected. If it is incorrect, then I suggest you update the documentation to make it clear that returnObservable has no effect when nestjs=true. Thanks.
Bump on this, using nestJS currently doesn't allow me to generate methods returning a promise
@tmthecoder if you've got --ts_proto_opt=nestJs=true set then you should get Promise's along with Observable's, which you don't have to use. You won't get them though, if you've also set ts_proto_opt=returnObservable=true OR if your methods involve streams. Whatever the case, I've just re-synced this branch with main but I'm not sure what the maintainer wants to do here sorry.
@alexkb I see the types be promise or observable for the controller implementations but the clients only have observable in the definitions, not sure why that is. I have the observable flag set to false manually in the proto gen command