Skip to content

Commit 5630327

Browse files
committed
added pagination to /product-index
Signed-off-by: Paul Horton <phorton@sonatype.com>
1 parent 2867a74 commit 5630327

File tree

1 file changed

+77
-5
lines changed

1 file changed

+77
-5
lines changed

spec/openapi.json

+77-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
"parameters": [
3131
{
3232
"$ref": "#/components/parameters/product-identifier"
33+
},
34+
{
35+
"$ref": "#/components/parameters/page-offset"
36+
},
37+
{
38+
"$ref": "#/components/parameters/page-size"
3339
}
3440
],
3541
"responses": {
@@ -38,11 +44,27 @@
3844
"content": {
3945
"application/json": {
4046
"schema": {
41-
"type": "array",
42-
"items:": {
43-
"$ref": "#/components/schemas/tea-product-index"
44-
},
45-
"minItems": 1
47+
"allOf": [
48+
{
49+
"$ref": "#/components/schemas/type-pagination-details"
50+
},
51+
{
52+
"type": "object",
53+
"properties": {
54+
"results": {
55+
"type": "array",
56+
"items": {
57+
"$ref": "#/components/schemas/tea-product-index"
58+
},
59+
"minItems": 1
60+
}
61+
},
62+
"required": [
63+
"results"
64+
]
65+
}
66+
]
67+
4668
}
4769
}
4870
}
@@ -311,6 +333,35 @@
311333
"ATTESTATION_UPDATED"
312334
]
313335
},
336+
"type-pagination-details": {
337+
"type": "object",
338+
"properties": {
339+
"timestamp": {
340+
"type": "string",
341+
"format": "date-time"
342+
},
343+
"page_start_index": {
344+
"type": "number",
345+
"format": "int64",
346+
"default": 0
347+
},
348+
"page_size": {
349+
"type": "number",
350+
"format": "int64",
351+
"default": 100
352+
},
353+
"total_results": {
354+
"type": "number",
355+
"format": "int64"
356+
}
357+
},
358+
"required": [
359+
"timestamp",
360+
"page_start_index",
361+
"page_size",
362+
"total_results"
363+
]
364+
},
314365
"type-tea-collection-artifact-type": {
315366
"type": "string",
316367
"title": "Type",
@@ -421,6 +472,27 @@
421472
}
422473
},
423474
"parameters": {
475+
"page-offset": {
476+
"name": "page-offset",
477+
"description": "Pagination offset",
478+
"in": "query",
479+
"required": false,
480+
"schema": {
481+
"type": "number",
482+
"format": "int64",
483+
"default": 0
484+
}
485+
},
486+
"page-size": {
487+
"name": "page-size",
488+
"description": "Pagination offset",
489+
"in": "query",
490+
"required": false,
491+
"schema": {
492+
"type": "number",
493+
"format": "int64"
494+
}
495+
},
424496
"product-identifier": {
425497
"name": "product-identifier",
426498
"description": "Product Identifier part of a TEI",

0 commit comments

Comments
 (0)