All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ancientlightstudios.quarkus.kotlin.openapi.parser.SchemaCollector.kt Maven / Gradle / Ivy

There is a newer version: 0.4.14
Show newest version
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()

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy