Skip to content

Instantly share code, notes, and snippets.

@gunzip
Last active September 16, 2025 07:35
Show Gist options
  • Save gunzip/bdc42d202e9640bf14fe602457c431c2 to your computer and use it in GitHub Desktop.
Save gunzip/bdc42d202e9640bf14fe602457c431c2 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "Minimal API",
"version": "1.0.0",
"description": "A minimal OpenAPI 3.0.1 specification with a single /documents endpoint"
},
"paths": {
"/test": {
"post": {
"summary": "Create document",
"description": "Create a new document",
"operationId": "createDocument",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Document"
}
}
}
},
"responses": {
"200": {
"$ref": "#/components/schemas/Document"
}
}
}
}
},
"components": {
"schemas": {
"_documentalias": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Document identifier"
},
"title": {
"type": "string",
"description": "Document title"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Document creation timestamp"
}
},
"required": ["id", "title", "createdAt"]
},
"Document": {
"$ref": "#/components/schemas/_documentalias"
}
},
"responses": {
"DocumentResponse": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Document"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment