
com.ancientlightstudios.quarkus.kotlin.openapi.parser.JsonPointer.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
@Suppress("DataClassPrivateConstructor")
data class JsonPointer private constructor(val path: String) {
fun append(vararg segments: String): JsonPointer {
val rootPath = path.trimEnd('/')
val subPath = segments.joinToString(separator = "/") {
it.replace("~", "~0")
.replace("/", "~1")
}
return JsonPointer("$rootPath/$subPath")
}
companion object {
fun fromPath(path: String) = JsonPointer(path)
fun fromSegments(vararg segments: String) = JsonPointer("/").append(*segments)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy