Fix: Unable to use sealed typed collections #199 (#200)

This commit is contained in:
Gennadi Kudrjavtsev
2022-02-20 01:33:13 +02:00
committed by GitHub
parent c8f64a50b0
commit c50f7f7ccc
3 changed files with 2 additions and 5 deletions

View File

@ -5,6 +5,7 @@
### Added
### Changed
- Fixed sealed typed collections schema generation
### Remove

View File

@ -27,7 +27,6 @@ object CollectionHandler : SchemaHandler {
val collectionClass = collectionType.classifier as KClass<*>
logger.debug("Obtained collection class: $collectionClass")
val referenceName = Helpers.genericNameAdapter(type, clazz)
generateKTypeKontent(collectionType, cache)
val valueReference = when (collectionClass.isSealed) {
true -> {
val subTypes = gatherSubTypes(collectionType)
@ -39,6 +38,7 @@ object CollectionHandler : SchemaHandler {
})
}
false -> {
generateKTypeKontent(collectionType, cache)
val schema = cache[collectionClass.simpleName] ?: error("${collectionClass.simpleName} not found")
val slug = collectionClass.simpleName!!
postProcessSchema(schema, slug)

View File

@ -60,10 +60,6 @@
},
"components": {
"schemas": {
"FlibbityGibbit": {
"properties": {},
"type": "object"
},
"SimpleGibbit": {
"properties": {
"a": {