Based off of this
- Title - Product Catalog API
- Description - API for the Product Catalog Service
- License - MIT
- Tags - retail and catalog
- Security Schemes - name - product-catalog-api type - API Key key location - HTTP header name - api_key
- Security - select
product-catalog-api
just created
- Create product
- Name it product
- application/json
- Type of product just created
- Add 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 } }
-
/services/product/{id}
-
Summary - Get product by Id
-
Description - Get product by Id
-
Path Parameter
-
"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 }
-
Create GET operation
-
Query param in the GET operation
{ "name": "inventory", "description": "whether to include inventory information in the response", "schema": { "type": "boolean" }, "in": "query" }
with example:
"product-without-inventory": { "value": "false" }
-
Response - plus sign, add 200, select product
-
Response - plus sign, add 404, not found
-
Security Requirements - choose api key
- Just get this json, click the API name, source and paste it in.
- Click
Save As JSON
- Click Upload Artifact
- Name it globex / ProductCatalogAPI
- Validity rule -> Full
Demonstrate messing up the json.
- Importers
- Select Product Catalog
- Enter in URL
- Open URL and see the example being served
Based off of this.
Example spec: