allow custom type overrides (#83)
This commit is contained in:
@ -4,8 +4,10 @@ import io.bkbn.kompendium.models.meta.ErrorMap
|
||||
import io.bkbn.kompendium.models.meta.SchemaMap
|
||||
import io.bkbn.kompendium.models.oas.OpenApiSpec
|
||||
import io.bkbn.kompendium.models.oas.OpenApiSpecInfo
|
||||
import io.bkbn.kompendium.models.oas.TypedSchema
|
||||
import io.bkbn.kompendium.path.CorePathCalculator
|
||||
import io.bkbn.kompendium.path.PathCalculator
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Maintains all state for the Kompendium library
|
||||
@ -31,4 +33,8 @@ object Kompendium {
|
||||
)
|
||||
cache = emptyMap()
|
||||
}
|
||||
|
||||
fun addCustomTypeSchema(clazz: KClass<*>, schema: TypedSchema) {
|
||||
cache = cache.plus(clazz.simpleName!! to schema)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user