api

http4k / org.http4k.filter / GenerateDataClasses

GenerateDataClasses

class GenerateDataClasses<out NODE> : Filter

This Filter is used to generate Data class definitions from a Response containing JSON. The Filter will try and reduce the number of class definitions by selecting the definition with the most fields (for cases where lists of items have different fields).

Types

Name Summary
ArrayGen data class ArrayGen : Gen
Gen interface Gen : Iterable<Gen>
ObjectGen data class ObjectGen : Gen
Primitives enum class Primitives : Gen

Constructors

Name Summary
<init> This Filter is used to generate Data class definitions from a Response containing JSON. The Filter will try and reduce the number of class definitions by selecting the definition with the most fields (for cases where lists of items have different fields).GenerateDataClasses(json: Json<NODE>, out: PrintStream = System.out, idGenerator: () -> Int = { abs(Random.nextInt()) })

Functions

Name Summary
invoke fun invoke(next: HttpHandler): HttpHandler

Extension Functions

Name Summary
appliedWhen fun Behaviour.appliedWhen(trigger: Trigger): Stage
then fun Filter.then(next: Filter): Filter
fun Filter.then(next: HttpHandler): HttpHandler
fun Filter.then(routingHttpHandler: RoutingHttpHandler): RoutingHttpHandler
then fun Filter.then(appLoader: AppLoader): AppLoader
fun Filter.then(appLoader: AppLoaderWithContexts): <ERROR CLASS>