Skip to content

Instantly share code, notes, and snippets.

@potfur
Created July 17, 2026 17:37
Show Gist options
  • Select an option

  • Save potfur/99edc4a1dae9fca4a1f1d5d216c8cd2e to your computer and use it in GitHub Desktop.

Select an option

Save potfur/99edc4a1dae9fca4a1f1d5d216c8cd2e to your computer and use it in GitHub Desktop.
SchemaModelNamer
import org.http4k.contract.jsonschema.v3.SchemaModelNamer
import org.http4k.contract.jsonschema.v3.SchemaModelNamer.Companion.Simple
fun interface SchemaModelNamerChain : (Any) -> String?
fun SchemaModelNamerChain.then(next: SchemaModelNamerChain) =
SchemaModelNamerChain { this(it) ?: next(it) }
fun SchemaModelNamerChain.then(next: SchemaModelNamer) =
SchemaModelNamer { this(it) ?: next(it) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment