de.lancom.openapi.entity.ResponseStatusCode.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.entity
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import de.lancom.openapi.jackson.Key
import de.lancom.openapi.jackson.KeyDeserializer
import de.lancom.openapi.jackson.KeySerializer
@JsonDeserialize(keyUsing = ResponseStatusCode.Companion.Deserializer::class)
@JsonSerialize(keyUsing = ResponseStatusCode.Companion.Serializer::class)
data class ResponseStatusCode(
val code: String
) : Key {
override val key: String = code
constructor(code: Int) : this(code.toString())
companion object {
class Deserializer : KeyDeserializer(::ResponseStatusCode)
class Serializer : KeySerializer(ResponseStatusCode::class.java)
val DEFAULT = ResponseStatusCode("default")
val HTTP_200_OK = ResponseStatusCode(200)
val HTTP_204_NO_CONTENT = ResponseStatusCode(204)
}
}