gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

Add streaming support

Open egonz opened this issue 4 years ago • 2 comments

Any plans to add streaming support? For instance if the OpenAPI definition had a response type schema component of type array could the automatically produce a proto RPC that used stream?

E.g. given an OpenAPI definition fragment:

components:
    schemas:
        FooBar:
            type: array
            items:
                $ref: '#/components/schemas/Bar'

Produces a proto RPC call like:

rpc GetFooBar ( GettFooBarParameters ) returns ( stream FooBar ) {
    option (google.api.http) = { post:"/foobar" body:"fooBar"  };
}

egonz avatar Sep 16 '20 22:09 egonz

Hi Eddie,

Is this issue related to the output of gnostic-grpc?

If so, then no. There are no plans to support streaming. I think @noahdietz and I discussed it back in 2019 and came to the conclusion that OpenAPI does not support streams and therefore gnostic-grpc shouldn't either. However, if OpenAPI supports streaming, gnostic-grpc should do it as well.

LorenzHW avatar Sep 17 '20 20:09 LorenzHW

This seems related to AsyncAPI. If we had a JSON schema for AsyncAPI, we could extend gnostic to read these descriptions and then write another plugin similar to gnostic-grpc to generate streaming services that send messages from the AsyncAPI definitions. There are building blocks for this but no one's done it.

timburks avatar Sep 19 '20 16:09 timburks