-
-
Save sixthextinction/cd3a96c8b79b59d6a260230e2d0ab80e 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" | |
} | |
], | |
"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, | |
"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" | |
}, | |
"price": { | |
"type": "number", | |
"format": "float" | |
} | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment