AbstractSchemaGenerator

abstract class AbstractSchemaGenerator<T : Any, R : Any>(introspector: SchemaIntrospector<T>, typeGraphTransformer: TypeGraphTransformer<R>) : SchemaGenerator<T, R> (source)

Abstract base class for generating schemas by combining introspection and representation logic.

Parameters

T

the type of the object for which the schema is being generated

R

the type of the resulting schema representation

Constructors

Link copied to clipboard
constructor(introspector: SchemaIntrospector<T>, typeGraphTransformer: TypeGraphTransformer<R>)

Functions

Link copied to clipboard
abstract fun encodeToString(schema: R): String

Serializes the given schema representation into a string.

Link copied to clipboard
open override fun generateSchema(target: T): R

Generates a JSON object representing the schema of the input target.

Link copied to clipboard
open override fun generateSchemaString(target: T): String

Serializes the schema of the provided object into a JSON-formatted string.

Link copied to clipboard
abstract fun schemaType(): KClass<R>

Returns the type of the schema representation being generated.

Link copied to clipboard
abstract fun targetType(): KClass<T>

Returns the type of the target for which the schema is being generated.