Skip to content

Instantly share code, notes, and snippets.

View elizabetht's full-sized avatar

Elizabeth Thomas elizabetht

  • Minneapolis, MN
View GitHub Profile
@elizabetht
elizabetht / App.kt
Created February 23, 2021 16:43
OpenAPI contracts/routing
/*
* This Kotlin source file was generated by the Gradle 'init' task.
*/
package com.test.openapi
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.test.openapi.Jackson.auto
import org.http4k.contract.contract
import org.http4k.contract.div
{
"type": "object",
"properties": {
"selected": {
"type": "boolean"
},
"type": {
"type": "string"
},
"messages": {
{
"type": "object",
"properties": {
"getItBy": {
"type": "string"
}
}
}
{
"type": "object",
"properties": {
"selected": {
"type": "boolean"
},
"messages": {
"$ref": "./messages_object.json"
}
}
{
"type": "object",
"properties": {
"specialOrderDelivery": {
"$ref": "./specialOrderDelivery_object.json"
},
"download": {
"$ref": "./download_object.json"
}
}
{
"type": "object",
"required": [
"summary"
],
"properties": {
"fulfillment": {
"description": "Fulfillment data",
"$ref": "./sku_fulfillment.json"
}
{
"swagger": "2.0",
"info": {
"description": "All mocked APIs go here",
"version": "1.0.0",
"title": "Mocked APIs",
"contact": {
"email": "abc@gmail.com"
}
},
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},