ReflectionClassJsonSchemaGenerator

class ReflectionClassJsonSchemaGenerator @JvmOverloads constructor(jsonSchemaConfig: JsonSchemaConfig = JsonSchemaConfig.Default) : AbstractSchemaGenerator<KClass<out Any>, JsonSchema> (source)

A generator for producing JSON Schema representations of Kotlin classes using reflection.

This class utilizes reflection-based introspection to analyze Kotlin KClass definitions and generate JSON Schema objects. It is built on top of the AbstractSchemaGenerator and works with a configurable JsonSchemaConfig to define schema generation behavior.

Parameters

jsonSchemaConfig

Configuration for generating JSON Schemas, such as formatting details and handling of optional nullable properties. Defaults to JsonSchemaConfig.Default.

Constructors

Link copied to clipboard
constructor(jsonSchemaConfig: JsonSchemaConfig = JsonSchemaConfig.Default)

Creates an instance of ReflectionClassJsonSchemaGenerator.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun encodeToString(schema: JsonSchema): String
Link copied to clipboard
open override fun generateSchema(target: KClass<out Any>): JsonSchema
Link copied to clipboard
open override fun generateSchemaString(target: KClass<out Any>): String
Link copied to clipboard
open override fun schemaType(): KClass<JsonSchema>
Link copied to clipboard
open override fun targetType(): KClass<KClass<out Any>>