Skip to content

Instantly share code, notes, and snippets.

@sixthextinction
Created August 13, 2023 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sixthextinction/a8b5af932c980b1f477d36f978d8f443 to your computer and use it in GitHub Desktop.
Save sixthextinction/a8b5af932c980b1f477d36f978d8f443 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"title": "Customer Service",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:3003"
}
],
"paths": {
"/customers": {
"get": {
"summary": "Get all customers",
"responses": {
"200": {
"description": "List of customers",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Customer"
}
}
}
}
}
}
}
},
"/customers/{id}": {
"get": {
"summary": "Get customer by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Customer details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Customer"
}
}
}
},
"404": {
"description": "Customer not found"
}
}
}
}
},
"components": {
"schemas": {
"Customer": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"address": {
"type": "string"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment