Skip to content

Commit 0cb911a

Browse files
committed
OpenAPI: Add new API end point for using CPE, PURL and TEI to find product
Signed-off-by: Olle E. Johansson <[email protected]>
1 parent 583f515 commit 0cb911a

File tree

1 file changed

+33
-14
lines changed

1 file changed

+33
-14
lines changed

spec/openapi.json

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
}
2424
],
2525
"paths": {
26-
"/product/{tei_urn}": {
26+
"/product/uuid/{uuid}": {
2727
"get": {
28-
"description": "Returns the corresponding leafs for a given TEI URN",
29-
"operationId": "getTeaProduct",
28+
"description": "Returns the corresponding leafs for a given product UUID.",
29+
"operationId": "getTeaProductByUuid",
3030
"parameters": [
3131
{
3232
"$ref": "#/components/parameters/tei_urn"
@@ -54,18 +54,33 @@
5454
]
5555
}
5656
},
57-
"/product": {
57+
"/product/type/{type_identifier}": {
5858
"get": {
59-
"description": "Returns a list of TEA Products",
60-
"operationId": "listTeaProducts",
59+
"description": "Returns a list of TEA products. Note that multiple products may match.",
60+
"operationId": "ProductByIdentifier",
6161
"parameters": [
62+
{
63+
"name": "type_identifier",
64+
"description": "The identifier type (enum)",
65+
"in": "path",
66+
"required": true,
67+
"schema": {
68+
"$ref" : "#/components/schemas/prodid_type"
69+
}
70+
},
6271
{
63-
"$ref": "#/components/stdparameters/standard_pagination"
72+
"name": "type_val",
73+
"description": "The actual identifier string",
74+
"in": "query",
75+
"required": true,
76+
"schema": {
77+
"type": "string"
78+
}
6479
}
6580
],
6681
"responses": {
6782
"200": {
68-
"description": "List retrieved successfully",
83+
"description": "Product retrieved successfully",
6984
"content": {
7085
"application/json": {
7186
"schema": {
@@ -140,17 +155,21 @@
140155
"webhooks": {},
141156
"components": {
142157
"schemas": {
158+
"prodid_type": {
159+
"type": "enum",
160+
"description": "Identifier types",
161+
"enum": [
162+
"tei",
163+
"purl",
164+
"cpe"
165+
]
166+
},
143167
"type_identifier" : {
144168
"type": "object",
145169
"description": "Declaration of an identifier",
146170
"properties": {
147171
"idtype": {
148-
"description": "Identifier types",
149-
"enum": [
150-
"tei",
151-
"purl",
152-
"cpe"
153-
],
172+
"$ref": "#/components/schemas/prodid_type",
154173
"default": "tei"
155174
},
156175
"idvalue": {

0 commit comments

Comments
 (0)