Skip to content

Commit ea9aaad

Browse files
authored
Merge pull request #108 from a-oren/TC-4691
feat(api): add recommendation schemas to v5 OpenAPI spec
2 parents 8bbea61 + 7799978 commit ea9aaad

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

api/v5/openapi.yaml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ info:
55
license:
66
name: Apache 2.0
77
url: https://www.apache.org/licenses/LICENSE-2.0.html
8-
version: 5.1.0
8+
version: 5.2.0
99
servers:
1010
- url: /api/v5
1111
description: API v5 endpoint
@@ -386,6 +386,10 @@ components:
386386
type: object
387387
additionalProperties:
388388
$ref: '#/components/schemas/Source'
389+
recommendations:
390+
type: object
391+
additionalProperties:
392+
$ref: '#/components/schemas/RecommendationSource'
389393
ProviderStatus:
390394
type: object
391395
properties:
@@ -450,6 +454,8 @@ components:
450454
recommendations:
451455
type: integer
452456
default: 0
457+
deprecated: true
458+
description: "Deprecated: Use provider-level recommendations map in ProviderReport instead."
453459
unscanned:
454460
type: integer
455461
default: 0
@@ -471,7 +477,8 @@ components:
471477
items:
472478
$ref: '#/components/schemas/TransitiveDependencyReport'
473479
recommendation:
474-
description: Trusted Content recommendation that is not related to any security vulnerability
480+
description: "Deprecated: Use provider-level recommendations map in ProviderReport instead. Trusted Content recommendation that is not related to any security vulnerability."
481+
deprecated: true
475482
allOf:
476483
- $ref: '#/components/schemas/PackageRef'
477484
highestVulnerability:
@@ -571,6 +578,38 @@ components:
571578
$ref: '#/components/schemas/PackageRef'
572579
reason:
573580
type: string
581+
RecommendationSource:
582+
type: object
583+
description: Recommendation data from a specific recommendation source
584+
properties:
585+
status:
586+
type: string
587+
description: Health status of the recommendation source
588+
summary:
589+
$ref: '#/components/schemas/RecommendationSummary'
590+
dependencies:
591+
type: array
592+
items:
593+
$ref: '#/components/schemas/RecommendationReport'
594+
RecommendationSummary:
595+
type: object
596+
description: Summary of recommendations from a recommendation source
597+
properties:
598+
total:
599+
type: integer
600+
default: 0
601+
RecommendationReport:
602+
type: object
603+
description: A recommendation mapping a dependency to its recommended alternative
604+
properties:
605+
ref:
606+
description: The original dependency being analyzed
607+
allOf:
608+
- $ref: '#/components/schemas/PackageRef'
609+
recommendation:
610+
description: The recommended alternative package
611+
allOf:
612+
- $ref: '#/components/schemas/PackageRef'
574613
LicensesRequest:
575614
type: object
576615
description: List of package URLs (purls) to fetch license information for

0 commit comments

Comments
 (0)