register

fun <T : Any> register(type: KClass<T>, schema: StructSchema<T>)(source)

Uses schema for type, both when it is requested directly and when it appears as a field of a reflected class. Use it for a class you can't annotate or that reflection can't handle.

Registering a schema identical to the one type already has does nothing. Two schemas are identical when they have the same type name, size and schema text.

Throws

if type already has a different schema, whether registered or reflected