HttpComponentContext

What an HttpComponent is built with: schema generation, plus ref for referencing another component from inside this one. The renderer registers the built component under its key; the context exposes no way to register, build or finish components itself.

Properties

Link copied to clipboard
abstract val inline: Boolean

Whether schemas (and components) are inlined rather than referenced.

Functions

Link copied to clipboard
abstract fun arraySchema(mainTargetType: Type, vararg typeParameters: Type): Schema<*>

An array schema whose items are the schema of the type.

Link copied to clipboard
abstract fun componentSchema(key: String, schema: Schema<*>): Schema<*>

Registers schema as the schema component key and returns a $ref to it.

Link copied to clipboard
abstract fun <T : Any> ref(component: HttpComponent<T>): T

A reference to component (a $ref, or the component itself when schemas are inlined), building it first unless the render already did.

Link copied to clipboard
abstract fun resolveType(mainTargetType: Type, vararg typeParameters: Type): ResolvedType
Link copied to clipboard
abstract fun schema(mainTargetType: Type, vararg typeParameters: Type): Schema<*>

The schema of the type, usually a $ref that the renderer resolves when the document is finished.