api

http4k / org.http4k.filter / GenerateDataClasses

GenerateDataClasses

class GenerateDataClasses<out NODE> : Filter (source)

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 : GenerateDataClasses.Gen
Gen interface Gen : Iterable<GenerateDataClasses.Gen>
ObjectGen data class ObjectGen : GenerateDataClasses.Gen
Primitives enum class Primitives : GenerateDataClasses.Gen

Constructors

Name Summary
<init> GenerateDataClasses(json: Json<NODE>, out: PrintStream = System.out, idGenerator: () -> Int = { Math.abs(Random.nextInt()) })
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).

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
with fun <T> T.with(vararg modifiers: (T) -> T): T