Skip to content

Commit 3e1ddb3

Browse files
committed
Merge remote-tracking branch 'madpah/fix/openapi-schema-errors' into feat/domain-objects
2 parents b39b16c + 75b8c71 commit 3e1ddb3

File tree

2 files changed

+87
-157
lines changed

2 files changed

+87
-157
lines changed

Diff for: spec/generators/common.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inputSpec: /local/spec/openapi.json
1+
inputSpec: /local/spec/openapi.yaml
22
gitUserId: CycloneDX
33
gitRepoId: transparency-exchange-api
44

Diff for: spec/openapi.yaml

+86-156
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ info:
77
description: TBC
88
contact:
99
name: TEA Working Group
10-
email: TBC
10+
1111
url: https://github.com/CycloneDX/transparency-exchange-api
1212
license:
1313
name: Apache 2.0
@@ -17,81 +17,82 @@ servers:
1717
- url: http://localhost/tea/v1
1818
description: Local development
1919
paths:
20-
"/product/uuid/{uuid}":
20+
/product/uuid/{uuid}:
2121
get:
2222
description: Returns the corresponding leafs for a given product UUID.
2323
operationId: getTeaProductByUuid
2424
parameters:
25-
- "$ref": "#/components/parameters/tei_urn"
25+
# @todo
26+
- $ref: "#/components/parameters/tei_urn"
2627
responses:
27-
'200':
28+
200:
2829
description: Requested TEA Product found and returned
2930
content:
3031
application/json:
3132
schema:
32-
"$ref": "#/components/schemas/product"
33-
'404':
34-
"$ref": "#/components/responses/404-object-by-id-not-found"
33+
$ref: "#/components/schemas/product"
34+
400:
35+
$ref: "#/components/responses/400-invalid-request"
36+
404:
37+
$ref: "#/components/responses/404-object-by-id-not-found"
3538
tags:
3639
- TEA Product
37-
"/product/type/{type_identifier}":
40+
/product/{product-identifier-type}/{product-identifier}:
3841
get:
3942
description: Returns a list of TEA products. Note that multiple products may
4043
match.
41-
operationId: ProductByIdentifier
44+
operationId: getTeaProductByIdentifier
4245
parameters:
43-
- name: type_identifier
44-
description: The identifier type (enum)
45-
in: path
46-
required: true
47-
schema:
48-
"$ref": "#/components/schemas/identifier"
49-
- name: type_val
50-
description: The actual identifier string
51-
in: query
52-
required: true
53-
schema:
54-
type: string
46+
- $ref: "#/components/schemas/identifier_type"
47+
- $ref: "#/components/parameters/product-identifier"
48+
- $ref: "#/components/parameters/page-offset"
49+
- $ref: "#/components/parameters/page-size"
5550
responses:
56-
'200':
51+
200:
5752
description: Product retrieved successfully
58-
content:
59-
application/json:
60-
schema:
61-
"$ref": "#/components/responses/paginated_product_list"
62-
"$ref": "#/components/responses/standard_errors"
63-
"/leaf/{tea_leaf_identifier}":
53+
$ref: "#/components/responses/paginated-product"
54+
400:
55+
$ref: "#/components/responses/400-invalid-request"
56+
404:
57+
$ref: "#/components/responses/404-object-by-id-not-found"
58+
tags:
59+
- TEA Product
60+
/leaf/{leaf-identifier}:
6461
get:
6562
description: Get the TEA Leaf that describes the Version of a Product
66-
operationId: getTeaLeaf
63+
operationId: getTeaLeafById
6764
parameters:
68-
- "$ref": "#/components/parameters/tea_leaf_identifier"
65+
- $ref: "#/components/schemas/uuid"
6966
responses:
70-
'200':
67+
200:
7168
description: Requested TEA Leaf found and returned
7269
content:
7370
application/json:
7471
schema:
7572
"$ref": "#/components/schemas/component"
76-
'404':
77-
"$ref": "#/components/responses/404-object-by-id-not-found"
73+
400:
74+
$ref: "#/components/responses/400-invalid-request"
75+
404:
76+
$ref: "#/components/responses/404-object-by-id-not-found"
7877
tags:
7978
- TEA Leaf
80-
"/collection/{tea_collection_identifier}":
79+
/collection/{collection-identifier}:
8180
get:
8281
description: Get a TEA Collection by it's Identifier
83-
operationId: getTeaCollection
82+
operationId: getTeaCollectionById
8483
parameters:
85-
- "$ref": "#/components/parameters/tea_collection_identifier"
84+
- $ref: "#/components/schemas/uuid"
8685
responses:
87-
'200':
86+
200:
8887
description: Requested TEA Collection found and returned
8988
content:
9089
application/json:
9190
schema:
92-
"$ref": "#/components/schemas/collection"
93-
'404':
94-
"$ref": "#/components/responses/404-object-by-id-not-found"
91+
"$ref": "#/components/schemas/tea_collection"
92+
400:
93+
$ref: "#/components/responses/400-invalid-request"
94+
404:
95+
$ref: "#/components/responses/404-object-by-id-not-found"
9596
tags:
9697
- TEA Collection
9798
webhooks: {}
@@ -469,72 +470,37 @@ components:
469470
- BLAKE2b-512
470471
- BLAKE3
471472
responses:
472-
base_error:
473-
type: object
474-
description: Error message
475-
properties:
476-
error:
477-
type: string
478-
message:
479-
type: string
480-
404-object-by-id-not-found:
481-
description: Object requested by identifier not found
473+
204-common-delete:
474+
description: Object deleted successfully
475+
content:
476+
application/json: {}
477+
400-invalid-request:
478+
description: Request was Invalid
482479
content:
483480
application/json: {}
484481
401-unauthorized:
485482
description: Authentication required
486483
content:
487484
application/json: {}
488-
pagination_details:
489-
type: object
490-
description: Pagination details
491-
properties:
492-
timestamp:
493-
type: string
494-
format: date-time
495-
example: '2024-03-20T15:30:00Z'
496-
page_start_index:
497-
type: number
498-
format: int64
499-
default: 0
500-
page_size:
501-
type: number
502-
format: int64
503-
default: 100
504-
total_results:
505-
type: number
506-
format: int64
507-
required:
508-
- timestamp
509-
- page_start_index
510-
- page_size
511-
- total_results
512-
paginated_product_list:
513-
type: object
514-
description: List of Products
515-
allOf:
516-
- $ref: "#/components/responses/pagination_details"
517-
- type: object
518-
properties:
519-
products:
520-
type: array
521-
items:
522-
$ref: "#/components/schemas/product"
523-
standard_errors:
524-
description: Standard error codes
525-
'400':
526-
description: Invalid request body
527-
content:
528-
application/json: {}
529-
'401':
530-
"$ref": "#/components/responses/401-unauthorized"
531-
'404':
532-
"$ref": "#/components/responses/404-object-by-id-not-found"
533-
standard_delete:
534-
description: Delete response
535-
'204':
536-
description: Resource successfully deleted
485+
404-object-by-id-not-found:
486+
description: Object requested by identifier not found
487+
content:
488+
application/json: {}
489+
paginated-product:
490+
description: A paginated response containing TEA Products
491+
content:
492+
application/json:
493+
schema:
494+
allOf:
495+
- $ref: "#/components/schemas/product"
496+
- type: object
497+
properties:
498+
results:
499+
type: array
500+
items:
501+
"$ref": "#/components/schemas/product"
537502
parameters:
503+
# Pagination
538504
page-offset:
539505
name: page-offset
540506
description: Pagination offset
@@ -553,86 +519,50 @@ components:
553519
type: number
554520
format: int64
555521
default: 100
556-
tei_urn:
557-
name: tei_urn
558-
description: Transparency Exchange Identifier (URN)
522+
# Identifiers
523+
collection-identifier:
524+
name: collection-identifier
525+
description: TEA Collection Identifier
559526
in: path
560527
required: true
561528
schema:
562-
type: string
563-
tea_product_identifier:
564-
name: tea_product_identifier
565-
description: TEA Product Identifier
529+
$ref: "#/components/schemas/type_uuid"
530+
leaf-identifier:
531+
name: leaf-identifier
532+
description: TEA Leaf Identifier
566533
in: path
567534
required: true
568535
schema:
569-
type: string
570-
product_version:
571-
name: product_version
572-
description: Product Version string
536+
$ref: "#/components/schemas/type_uuid"
537+
product-identifier-type:
538+
name: product-identifier-type
539+
description: The identifier type (enum)
573540
in: path
574541
required: true
575542
schema:
576-
type: string
577-
tea_collection_identifier:
578-
name: tea_collection_identifier
579-
description: TEA Collection Identifier
580-
in: path
543+
$ref: "#/components/schemas/type_product_identifier_type"
544+
product-identifier:
545+
name: product-identifier
546+
description: The actual identifier string
547+
in: query
581548
required: true
582549
schema:
583550
type: string
584-
tea_leaf_identifier:
585-
name: tea_leaf_identifier
586-
description: TEA Leaf Identifier
551+
# @todo - REVIEW AS THIS IS USED AS A UUID in /product/uuid/{uuid} ??
552+
tei_urn:
553+
name: tei_urn
554+
description: Transparency Exchange Identifier (URN)
587555
in: path
588556
required: true
589557
schema:
590558
type: string
591-
purl:
592-
name: purl
593-
description: Package URL (PURL)
594-
in: query
595-
required: false
596-
schema:
597-
type: string
598-
barcode:
599-
name: barcode
600-
description: Barcode
601-
in: query
602-
required: false
603-
schema:
604-
type: string
605-
sku:
606-
name: sku
607-
description: Product SKU
608-
in: query
609-
required: false
610-
schema:
611-
type: string
612-
vendor_uuid:
613-
name: vendor_uuid
614-
description: Vendor UUID
615-
in: query
616-
required: false
617-
schema:
618-
"$ref": "#/components/schemas/uuid"
619559
securitySchemes:
620560
bearerAuth:
621561
type: http
622562
scheme: bearer
623563
basicAuth:
624564
type: http
625565
scheme: basic
626-
security_requirements:
627-
standard_auth:
628-
- bearerAuth: []
629-
- basicAuth: []
630-
operations:
631-
standard_delete:
632-
responses:
633-
"$ref": "#/components/responses/standard_delete"
634-
security:
635-
"$ref": "#/components/security_requirements/standard_auth"
636566
security:
637567
- bearerAuth: []
638568
- basicAuth: []

0 commit comments

Comments
 (0)