gnostic
gnostic copied to clipboard
Add streaming support
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" };
}
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.
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.