Skip to content

Commit 583f515

Browse files
committed
OpenAPI: Fix dual responses and parameter definitions
Signed-off-by: Olle E. Johansson <[email protected]>
1 parent e73bdf5 commit 583f515

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

spec/openapi.json

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"operationId": "listTeaProducts",
6161
"parameters": [
6262
{
63-
"$ref": "#/components/parameters/standard_pagination"
63+
"$ref": "#/components/stdparameters/standard_pagination"
6464
}
6565
],
6666
"responses": {
@@ -84,7 +84,7 @@
8484
"operationId": "getTeaLeaf",
8585
"parameters": [
8686
{
87-
"$ref": "#/components/parameters/tea_leaf_identifier"
87+
"$ref": "#/components/stdparameters/tea_leaf_identifier"
8888
}
8989
],
9090
"responses": {
@@ -113,7 +113,7 @@
113113
"operationId": "getTeaCollection",
114114
"parameters": [
115115
{
116-
"$ref": "#/components/parameters/tea_collection_identifier"
116+
"$ref": "#/components/stdparameters/tea_collection_identifier"
117117
}
118118
],
119119
"responses": {
@@ -140,27 +140,42 @@
140140
"webhooks": {},
141141
"components": {
142142
"schemas": {
143+
"type_identifier" : {
144+
"type": "object",
145+
"description": "Declaration of an identifier",
146+
"properties": {
147+
"idtype": {
148+
"description": "Identifier types",
149+
"enum": [
150+
"tei",
151+
"purl",
152+
"cpe"
153+
],
154+
"default": "tei"
155+
},
156+
"idvalue": {
157+
"description": "Value of the identifier",
158+
"type": "string"
159+
}
160+
}
161+
},
143162
"base_product_fields": {
144163
"type": "object",
145164
"properties": {
146165
"product_name": {
147-
"type": "string"
148-
},
149-
"barcode": {
150-
"type": "string",
151-
"description": "Barcode"
152-
},
153-
"sku": {
154166
"type": "string",
155-
"description": "Product SKU"
167+
"description": "Product name in free text."
156168
},
157-
"vendor_uuid": {
169+
"uuid": {
158170
"$ref": "#/components/schemas/type_uuid",
159-
"description": "Vendor UUID"
171+
"description": "UUID"
160172
},
161-
"purl": {
162-
"type": "string",
163-
"description": "Package URL (PURL)"
173+
"identifiers": {
174+
"type": "array",
175+
"items": {
176+
"$ref": "#/components/schemas/type_identifier"
177+
},
178+
"description": "Array of identifiers for this product (tei, cpe, purl)"
164179
}
165180
}
166181
},
@@ -230,9 +245,6 @@
230245
{
231246
"type": "object",
232247
"properties": {
233-
"identifier": {
234-
"$ref": "#/components/schemas/type_uuid"
235-
},
236248
"leaf_references": {
237249
"type": "array",
238250
"items": {
@@ -591,6 +603,25 @@
591603
"content": {
592604
"application/json": {}
593605
}
606+
},
607+
"standard_errors": {
608+
"400": {
609+
"description": "Invalid request body",
610+
"content": {
611+
"application/json": {}
612+
}
613+
},
614+
"401": {
615+
"$ref": "#/components/responses/401-unauthorized"
616+
},
617+
"404": {
618+
"$ref": "#/components/responses/404-object-by-id-not-found"
619+
}
620+
},
621+
"standard_delete": {
622+
"204": {
623+
"description": "Resource successfully deleted"
624+
}
594625
}
595626
},
596627
"parameters": {
@@ -718,37 +749,6 @@
718749
}
719750
]
720751
},
721-
"responses": {
722-
"standard_errors": {
723-
"400": {
724-
"description": "Invalid request body",
725-
"content": {
726-
"application/json": {}
727-
}
728-
},
729-
"401": {
730-
"$ref": "#/components/responses/401-unauthorized"
731-
},
732-
"404": {
733-
"$ref": "#/components/responses/404-object-by-id-not-found"
734-
}
735-
},
736-
"standard_delete": {
737-
"204": {
738-
"description": "Resource successfully deleted"
739-
}
740-
}
741-
},
742-
"parameters": {
743-
"standard_pagination": {
744-
"page_offset": {
745-
"$ref": "#/components/parameters/page-offset"
746-
},
747-
"page_size": {
748-
"$ref": "#/components/parameters/page-size"
749-
}
750-
}
751-
},
752752
"operations": {
753753
"standard_delete": {
754754
"responses": {

0 commit comments

Comments
 (0)