de.lancom.openapi.jackson.ReferenceParser.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-parser Show documentation
Show all versions of openapi-parser Show documentation
This open-source project provides an OpenAPI 3.0 Parser implemented in Kotlin, utilizing immutable data classes
package de.lancom.openapi.jackson
import de.lancom.openapi.field.Field
import de.lancom.openapi.refs.ReferenceOrInstance
import de.lancom.openapi.refs.Referenceable
// TODO?
interface ReferenceParser : Parser {
fun parseReferenceOrEntity(
wrapper: Wrapper
): Field> {
return wrapper.getReferenceOrEntity(::parseWrapper)
}
fun parseReferenceOrEntityOpt(
wrapper: Wrapper
): Field?> {
return wrapper.getNullOrElse {
parseReferenceOrEntity(wrapper)
}
}
}