Generate OpenAPI of the Ingress
Generate OpenAPI of the Ingress, by reading through the service metadata. In order to do that we need the SDKs to send input/output schemas.
An alternative idea for this would be to integrate with an external schema registry. That way the SDKs could reference the relevant input/output schemas from the registry.
@geoff-nunan what would be the use case? Essentially let the SDK publish the schema to the registry, so that external consumers can use it?
Or viceversa use the schemas, already existing in the schema registry, to generate code in the SDK?
@slinkydeveloper In our use-case, we have a graphical UI that allows users to automate processes using BPMN notation. If a developer registers a new handler in restate, we want to make that handler available to be called through the BPMN editor. We would like to be able to discover the new handler and make it appear in the UI so that a user can orchestrate calls to that handler. To do that, we would ideally be able to discover the input and output schema from the handler. Extending that a little further, we can trigger BPMN processes when a message is received from Kafka, and we can get the schema for the kafka topic from the schema registry. A minimal first step would be for us to be able to specify the input and output schemas uri for handlers in the SDK.
A full openAPI spec would be awesome, but then it is a different pattern to what we have with kafka
Hey @geoff-nunan, do I understand correctly that you're trying to implement some sort of service discovery system on top of the restate admin API?
If that's the case, I wonder if a more "generic" solution to assign arbitrary metadata to each handler is what you need (not necessarily JSON schema, but whatever metadata you want), versus what this issue proposes.
One idea could be the following: If invoking the service after the discovery is ok for you, you could implement a wrapper on the SDK APIs that generates a "synthetic" handler for each service you create, containing the additional metadata you want to provide with each handler.
We got one step closer with https://github.com/restatedev/restate/issues/2178 to solving this issue. Now we only need to only assemble all the info in the schema registry in order to generate the ingress OpenAPI
@nikrooz fyi