com.ancientlightstudios.quarkus.kotlin.openapi.parser.SchemaCollector.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-kotlin-openapi-maven-plugin Show documentation
Show all versions of quarkus-kotlin-openapi-maven-plugin Show documentation
A Maven plugin to use the OpenAPI generator.
package com.ancientlightstudios.quarkus.kotlin.openapi.parser
import com.ancientlightstudios.quarkus.kotlin.openapi.models.hints.OriginPathHint.originPath
import com.ancientlightstudios.quarkus.kotlin.openapi.models.transformable.TransformableSchema
import com.ancientlightstudios.quarkus.kotlin.openapi.utils.pop
class SchemaCollector {
private val collectedReferences = mutableMapOf()
private val unresolvedSchema = mutableSetOf()
fun registerSchema(contextPath: String) = collectedReferences.getOrPut(contextPath) {
TransformableSchema("")
.apply {
originPath = contextPath
}.also {
unresolvedSchema.add(it)
}
}
val nextUnresolvedSchema: TransformableSchema?
get() = unresolvedSchema.pop()
}