edit

Typesafe HTTP contracts

This contract example shows:

  • 2 endpoints with typesafe contracts (marshalling of path parameters and bodies)
  • Custom filters (reporting latency)
  • API key security via a typesafe Query parameter (this can be a header or a body parameter as well)
  • OpenApi/Swagger API documentation - Run this example and point a browser here

Gradle setup

    compile group: "org.http4k", name: "http4k-core", version: "2.35.1"
    compile group: "org.http4k", name: "http4k-contract", version: "2.35.1"

Code