kompendium
2.0.3
2.0.3 2.0.2 2.0.1

# IMethodParser

interface IMethodParser
Content copied to clipboard

## Functions

calculateRoutePath
Link copied to clipboard
open fun Route. calculateRoutePath (): String
Content copied to clipboard

Uses the built-in Ktor route path Route.toString but cuts out any meta route such as authentication... anything that matches the RegEx pattern `/\\(.+\\)`

defaultValueInjector
Link copied to clipboard
open fun defaultValueInjector (param: KParameter ): Any
Content copied to clipboard

Allows the reflection invoker to populate a parameter map with values in order to sus out any default parameters.

getDefaultParameterValue
Link copied to clipboard
open fun getDefaultParameterValue (clazz: KClass <*>, prop: KProperty <*>): Any ?
Content copied to clipboard

Absolutely disgusting reflection to determine if a default value is available for a given property.

mapToSpec
Link copied to clipboard
open fun Set < ParameterExample >. mapToSpec (parameterName: String ): Map < String , Parameter.Example >?
Content copied to clipboard
parseExceptions
Link copied to clipboard
open fun parseExceptions (exceptionInfo: Set < ExceptionInfo <*>>, feature: Kompendium ): Map < Int , Response >
Content copied to clipboard
parseMethodInfo
Link copied to clipboard
open fun parseMethodInfo (info: MethodInfo <*, *>, paramType: KType , requestType: KType , responseType: KType , feature: Kompendium ): PathOperation
Content copied to clipboard

Generates the OpenAPI Path spec from provided metadata

parseResponse
Link copied to clipboard
open fun parseResponse (responseType: KType , responseInfo: ResponseInfo <*>?, feature: Kompendium ): Map < Int , Response >
Content copied to clipboard
resolveContent
Link copied to clipboard
open fun Kompendium . resolveContent (type: KType , mediaTypes: List < String >, examples: Map < String , Any >): Map < String , MediaType >?
Content copied to clipboard

Generates MediaTypes along with any examples provided

toParameter
Link copied to clipboard
open fun KProperty <*>. toParameter (info: MethodInfo <*, *>, parentType: KType , parentClazz: KClass <*>, feature: Kompendium ): Parameter
Content copied to clipboard
toParameterSpec
Link copied to clipboard
open fun KType . toParameterSpec (info: MethodInfo <*, *>, feature: Kompendium ): List < Parameter >
Content copied to clipboard

Parses a type for all parameter information. All fields in the receiver must be annotated with io.bkbn.kompendium.annotations.Param.

toRequestSpec
Link copied to clipboard
open fun KType . toRequestSpec (requestInfo: RequestInfo <*>?, feature: Kompendium ): Request ?
Content copied to clipboard

Converts a KType to an Request

toResponseSpec
Link copied to clipboard
open fun KType . toResponseSpec (responseInfo: ResponseInfo <*>?, feature: Kompendium ): Pair < Int , Response >?
Content copied to clipboard

Converts a KType to a pairing of http status code to Response

## Inheritors

DefaultMethodParser
Link copied to clipboard