-
-
Save sixthextinction/9112f5adeba59a3a4ce4ab3bc4435c84 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": "Product Catalog Service", | |
"version": "1.0.0" | |
}, | |
"servers": [ | |
{ | |
"url": "http://localhost:3001", | |
"description": "Local server" | |
} | |
], | |
"paths": { | |
"/products": { | |
"get": { | |
"summary": "Get all products", | |
"responses": { | |
"200": { | |
"description": "List of products", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/Product" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/products/{id}": { | |
"get": { | |
"summary": "Get product by ID", | |
"parameters": [ | |
{ | |
"name": "id", | |
"in": "path", | |
"required": true, | |
"description": "ID of the product", | |
"schema": { | |
"type": "integer", | |
"format": "int64" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Product details", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Product" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Product not found" | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"Product": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "integer", | |
"format": "int64" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"description": { | |
"type": "string" | |
}, | |
"price": { | |
"type": "number", | |
"format": "float" | |
} | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment