Skip to content

Instantly share code, notes, and snippets.

@DavidBiesack
Created August 4, 2023 15:10
Show Gist options
  • Save DavidBiesack/17b15294c55ebc8e2af9188dc0b53e0b to your computer and use it in GitHub Desktop.
Save DavidBiesack/17b15294c55ebc8e2af9188dc0b53e0b to your computer and use it in GitHub Desktop.
OpenAPI document with format: text in a JSON schema
{
"openapi": "3.0.3",
"info": {
"title": "API with `format: text`",
"description": "API with `format: text`.",
"contact": {
"name": "Lorem Ipsum",
"url": "https://www.example.com/",
"email": "api@apiture.com"
},
"license": {
"name": "API License",
"url": "https://www.example.com/license.pdf"
},
"version": "0.1.0"
},
"tags": [
{
"name": "Text",
"description": "Text Services"
}
],
"servers": [
{
"url": "https://api.example.com/test"
}
],
"paths": {
"/text": {
"get": {
"summary": "Return lorum ipsum text",
"description": "Return lorum ipsum text",
"operationId": "getText",
"tags": [
"Text"
],
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/text"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"text": {
"title": "Text",
"description": "Lorum Ipsum text",
"type": "string",
"format": "text"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment