OpenApiSpecSynthesizer

Synthesizes the openApiSpec() override of a handler class: replaces the frontend's fake override with a real function returning the analyzed OpenAPI fragment as a string constant.

Functions

Link copied to clipboard
fun addOverride(pluginContext: IrPluginContext, irClass: IrClass, base: IrSimpleFunction, fragment: String)

Adds override fun openApiSpec(): String? = "<fragment>" to irClass.

Link copied to clipboard
fun baseOpenApiSpecOf(irClass: IrClass): IrSimpleFunction?

The openApiSpec() declaration of the AbstractRestHandler ancestor, or null on an older runtime.

Link copied to clipboard
fun hasHandWrittenOverride(irClass: IrClass): Boolean

Whether irClass declares its own openApiSpec() (same shape: no value parameters).