sam-goodwin / eventual

Build scalable and durable micro-services with APIs, Messaging and Workflows
https://docs.eventual.ai
MIT License
174 stars 4 forks source link

feat: api spec intrinsic #337

Closed thantos closed 1 year ago

thantos commented 1 year ago

Add APISpecification.generate intrinsic to allow access to the Open API Spec from within the handlers/commands/etc.

Primary use case is to supply the api spec via a command for situations like an openai plugin.

export const specCommand = command(
  "specCommand",
  async (): Promise<openapi.OpenAPIObject> => {
    return ApiSpecification.generate();
  }
);