From ec708de1e40f3020e2f7403bc62f1164abc2527c Mon Sep 17 00:00:00 2001 From: Viktor Petersson Date: Wed, 20 Nov 2024 13:30:57 +0000 Subject: [PATCH 1/2] Adds the ability to patch `/product/tea_product_identifier` Signed-off-by: Viktor Petersson --- spec/openapi.json | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/spec/openapi.json b/spec/openapi.json index 3c46ea1..30d95da 100644 --- a/spec/openapi.json +++ b/spec/openapi.json @@ -70,11 +70,36 @@ "properties": { "product_name": { "type": "string" + }, + "barcode": { + "type": "string", + "description": "Barcode" + }, + "sku": { + "type": "string", + "description": "Product SKU" + }, + "vendor_uuid": { + "$ref": "#/components/schemas/type_uuid", + "description": "Vendor UUID" + }, + "purl": { + "type": "string", + "description": "Package URL (PURL)" } - }, - "required": [ - "product_name" - ] + } + }, + "examples": { + "basic": { + "summary": "Basic product update", + "value": { + "product_name": "Updated Product Name", + "barcode": "123456789012", + "sku": "PROD-001", + "vendor_uuid": "123e4567-e89b-12d3-a456-426614174000", + "purl": "pkg:generic/example@1.0.0" + } + } } } } From 14b317599b2b91eedd4ac28a0dfe98c4671ae5d5 Mon Sep 17 00:00:00 2001 From: Viktor Petersson Date: Wed, 20 Nov 2024 13:53:40 +0000 Subject: [PATCH 2/2] Fixes `/product` POST. Signed-off-by: Viktor Petersson --- spec/openapi.json | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/spec/openapi.json b/spec/openapi.json index 30d95da..cd12389 100644 --- a/spec/openapi.json +++ b/spec/openapi.json @@ -235,6 +235,22 @@ "properties": { "product_name": { "type": "string" + }, + "barcode": { + "type": "string", + "description": "Barcode" + }, + "sku": { + "type": "string", + "description": "Product SKU" + }, + "vendor_uuid": { + "$ref": "#/components/schemas/type_uuid", + "description": "Vendor UUID" + }, + "purl": { + "type": "string", + "description": "Package URL (PURL)" } }, "required": [ @@ -247,6 +263,16 @@ "value": { "product_name": "Example Product" } + }, + "full": { + "summary": "Full product creation with all fields", + "value": { + "product_name": "Complete Product Example", + "barcode": "123456789012", + "sku": "PROD-001", + "vendor_uuid": "123e4567-e89b-12d3-a456-426614174000", + "purl": "pkg:generic/example@1.0.0" + } } } } @@ -265,6 +291,18 @@ }, "product_name": { "type": "string" + }, + "barcode": { + "type": "string" + }, + "sku": { + "type": "string" + }, + "vendor_uuid": { + "$ref": "#/components/schemas/type_uuid" + }, + "purl": { + "type": "string" } }, "required": [