-
-
Save sixthextinction/a8b5af932c980b1f477d36f978d8f443 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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