{ "openapi": "3.0.2", "info": { "title": "Product Catalog API", "version": "1.0.0", "description": "API for the Product Catalog Service", "license": { "name": "MIT License", "url": "https://opensource.org/licenses/MIT" } }, "paths": { "/services/product/{id}": { "summary": "Get product by Id", "description": "Get product by Id", "get": { "parameters": [ { "examples": { "product-without-inventory": { "value": "false" } }, "name": "inventory", "description": "whether to include inventory information in the response", "schema": { "type": "boolean" }, "in": "query" } ], "responses": { "200": { "$ref": "#/components/responses/product" }, "404": { "description": "Product not found" } }, "security": [ { "product-catalog-api": [ ] } ], "summary": "Get product by Id", "description": "Get product by Id" }, "parameters": [ { "examples": { "product-with-inventory": { "value": "329299" }, "product-without-inventory": { "value": "329299" }, "product-non-existing": { "value": "999999" } }, "name": "id", "schema": { "type": "string" }, "in": "path", "required": true } ] }, "/services/products": { "summary": "Get paginated list of Products", "get": { "parameters": [ { "examples": { "paginated-product-list-with-inventory": { "value": "5" }, "paginated-product-list-without-inventory": { "value": "5" } }, "name": "limit", "description": "Max number of records returned.", "schema": { "type": "integer" }, "in": "query" }, { "examples": { "paginated-product-list-with-inventory": { "value": "1" }, "paginated-product-list-without-inventory": { "value": "1" } }, "name": "page", "description": "The page number. First page is 1.", "schema": { "type": "integer" }, "in": "query" }, { "examples": { "paginated-product-list-without-inventory": { "value": "false" } }, "name": "inventory", "description": "Whether to define inventory information in the response", "schema": { "type": "boolean" }, "in": "query", "required": false } ], "responses": { "200": { "$ref": "#/components/responses/paginated-product-list" } }, "security": [ { "product-catalog-api": [ ] } ], "summary": "Get paginated list of products" } }, "/services/product/list/{ids}": { "description": "Get products list by Ids", "get": { "parameters": [ { "examples": { "product-list-without-inventory": { "value": "false" } }, "name": "inventory", "description": "Whether to include inventory information in the response", "schema": { "type": "boolean" }, "in": "query" } ], "responses": { "200": { "$ref": "#/components/responses/product-list" } }, "security": [ { "product-catalog-api": [ ] } ], "summary": "Get list of product by Id" }, "parameters": [ { "examples": { "product-list-with-inventory": { "value": "329199,329299" }, "product-list-without-inventory": { "value": "329199,329299" } }, "name": "ids", "schema": { "type": "string" }, "in": "path", "required": true } ] } }, "components": { "schemas": { "paginated-product-list": { "description": "", "type": "object" }, "product": { "description": "", "type": "object" } }, "responses": { "product": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/product" }, "examples": { "product-with-inventory": { "value": { "itemId": "329299", "name": "Quarkus T-shirt", "desc": "Our T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 10, "quantity": 736 } }, "product-without-inventory": { "value": { "itemId": "329299", "name": "Quarkus T-shirt", "desc": "Our T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 10 } } } } }, "description": "Product Details by Id" }, "product-list": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/product" } }, "examples": { "product-list-with-inventory": { "value": [ { "itemId": "329299", "name": "Quarkus T-shirt", "desc": "Our T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 10, "quantity": 736 }, { "itemId": "329199", "name": "Pronounced Kubernetes", "desc": "Our Men's Value T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 9, "quantity": 512 } ] }, "product-list-without-inventory": { "value": [ { "itemId": "329299", "name": "Quarkus T-shirt", "desc": "Our T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 10 }, { "itemId": "329199", "name": "Pronounced Kubernetes", "desc": "Our Men's Value T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 9 } ] } } } }, "description": "List of products" }, "paginated-product-list": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/paginated-product-list" }, "examples": { "paginated-product-list-with-inventory": { "value": { "content": [ { "itemId": "329299", "name": "Quarkus T-shirt", "desc": "Our T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 10, "quantity": 736 }, { "itemId": "329199", "name": "Pronounced Kubernetes", "desc": "Our Men's Value T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 9, "quantity": 512 }, { "itemId": "165613", "name": "Knit socks", "desc": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna leo, cursus a fringilla et, aliquam at tellus. Praesent est nulla, mattis in auctor vitae, commodo sed eros. Etiam volutpat a felis vel elementum. Duis ut vestibulum orci, ut hendrerit felis. Nulla nunc lectus, luctus ut tortor a, sollicitudin gravida dolor. Integer euismod, velit non tempor mattis, odio neque ornare neque, nec sollicitudin elit massa nec ante.", "price": 4.15, "quantity": 256 }, { "itemId": "165614", "name": "Quarkus H2Go water bottle", "desc": "Copper vacuum insulated sport bottle with 650 ml capacity. Durable, double wall stainless steel vacuum construction with copper insulation, which allows your beverage to stay cold for 48 hours and at least 12 hours for hot beverages. The construction also prevents condensation on the outside of the bottle. Material: Stainless Steel. Colour: Black Height:27,20 cm Diameter:7,20 cm Weight:380 gram", "price": 14.45, "quantity": 54 }, { "itemId": "165954", "name": "Patagonia Refugio pack 28L", "desc": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna leo, cursus a fringilla et, aliquam at tellus. Praesent est nulla, mattis in auctor vitae, commodo sed eros. Etiam volutpat a felis vel elementum. Duis ut vestibulum orci, ut hendrerit felis. Nulla nunc lectus, luctus ut tortor a, sollicitudin gravida dolor. Integer euismod, velit non tempor mattis, odio neque ornare neque, nec sollicitudin elit massa nec ante.", "price": 6, "quantity": 87 } ], "pageable": { "sort": { "sorted": false, "unsorted": true, "empty": true }, "offset": 0, "pageNumber": 0, "pageSize": 5, "paged": true, "unpaged": false }, "totalPages": 9, "totalElements": 41, "last": false, "size": 5, "number": 0, "sort": { "sorted": false, "unsorted": true, "empty": true }, "numberOfElements": 5, "first": true, "empty": false } }, "paginated-product-list-without-inventory": { "value": { "content": [ { "itemId": "329299", "name": "Quarkus T-shirt", "desc": "Our T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 10 }, { "itemId": "329199", "name": "Pronounced Kubernetes", "desc": "Our Men's Value T-Shirt is an everyday essential! This short-sleeve heavyweight T-shirt is comfortable, economical and made to last. Designed with a traditional fit that runs true to size, he’ll show off his personality, humor and interests with an easy, relaxed style.", "price": 9 }, { "itemId": "165613", "name": "Knit socks", "desc": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna leo, cursus a fringilla et, aliquam at tellus. Praesent est nulla, mattis in auctor vitae, commodo sed eros. Etiam volutpat a felis vel elementum. Duis ut vestibulum orci, ut hendrerit felis. Nulla nunc lectus, luctus ut tortor a, sollicitudin gravida dolor. Integer euismod, velit non tempor mattis, odio neque ornare neque, nec sollicitudin elit massa nec ante.", "price": 4.15 }, { "itemId": "165614", "name": "Quarkus H2Go water bottle", "desc": "Copper vacuum insulated sport bottle with 650 ml capacity. Durable, double wall stainless steel vacuum construction with copper insulation, which allows your beverage to stay cold for 48 hours and at least 12 hours for hot beverages. The construction also prevents condensation on the outside of the bottle. Material: Stainless Steel. Colour: Black Height:27,20 cm Diameter:7,20 cm Weight:380 gram", "price": 14.45 }, { "itemId": "165954", "name": "Patagonia Refugio pack 28L", "desc": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut urna leo, cursus a fringilla et, aliquam at tellus. Praesent est nulla, mattis in auctor vitae, commodo sed eros. Etiam volutpat a felis vel elementum. Duis ut vestibulum orci, ut hendrerit felis. Nulla nunc lectus, luctus ut tortor a, sollicitudin gravida dolor. Integer euismod, velit non tempor mattis, odio neque ornare neque, nec sollicitudin elit massa nec ante.", "price": 6 } ], "pageable": { "sort": { "sorted": false, "unsorted": true, "empty": true }, "offset": 0, "pageNumber": 0, "pageSize": 5, "paged": true, "unpaged": false }, "totalPages": 9, "totalElements": 41, "last": false, "size": 5, "number": 0, "sort": { "sorted": false, "unsorted": true, "empty": true }, "numberOfElements": 5, "first": true, "empty": false } } } } }, "description": "API to get product details.\n- get Paginated list of Products\n- get Product details based on comma separated ids\n- get Product detail of a specific product id" } }, "securitySchemes": { "product-catalog-api": { "type": "apiKey", "name": "api_key", "in": "header" } } }, "security": [ { "product-catalog-api": [ ] } ], "tags": [ { "name": "retail", "description": "" }, { "name": "catalog", "description": "" } ] }