Skip to content

Instantly share code, notes, and snippets.

@dbalatero
Created November 14, 2022 19:56
Show Gist options
  • Save dbalatero/338d01031f475365ab49af31f00df5ca to your computer and use it in GitHub Desktop.
Save dbalatero/338d01031f475365ab49af31f00df5ca to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"title": "Demo API",
"description": "The Demo API is not a real API.",
"version": "1.0.0"
},
"paths": {
"/users": {
"post": {
"summary": "Create user",
"description": "Creates a user",
"operationId": "postUsers",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The user's first + last name"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The created user's ID"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"country": {
"type": "string",
"nullable": true,
"enum": [
"foo",
"bar"
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment