Skip to content

Commit be1cc32

Browse files
Update OpenAPI docs (#102)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: dependencytrack-bot <106437498+dependencytrack-bot@users.noreply.github.com>
1 parent 85133cf commit be1cc32

2 files changed

Lines changed: 170 additions & 43 deletions

File tree

docs/reference/api/openapi-v1.yaml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,6 @@ paths:
12671267
name: includeRepositoryMetaData
12681268
schema:
12691269
type: boolean
1270-
- in: query
1271-
name: includeIntegrityMetaData
1272-
schema:
1273-
type: boolean
12741270
responses:
12751271
"200":
12761272
content:
@@ -9750,8 +9746,6 @@ components:
97509746
- MACHINE_LEARNING_MODEL
97519747
- DATA
97529748
- CRYPTOGRAPHIC_ASSET
9753-
componentMetaInformation:
9754-
$ref: "#/components/schemas/ComponentMetaInformation"
97559749
copyright:
97569750
type: string
97579751
maxLength: 1024
@@ -9912,26 +9906,6 @@ components:
99129906
- name
99139907
- project
99149908
- uuid
9915-
ComponentMetaInformation:
9916-
type: object
9917-
properties:
9918-
integrityMatchStatus:
9919-
type: string
9920-
enum:
9921-
- HASH_MATCH_PASSED
9922-
- HASH_MATCH_FAILED
9923-
- HASH_MATCH_UNKNOWN
9924-
- COMPONENT_MISSING_HASH
9925-
integrityRepoUrl:
9926-
type: string
9927-
lastFetched:
9928-
type: integer
9929-
format: int64
9930-
description: UNIX epoch timestamp in milliseconds
9931-
publishedDate:
9932-
type: integer
9933-
format: int64
9934-
description: UNIX epoch timestamp in milliseconds
99359909
ComponentOccurrence:
99369910
type: object
99379911
properties:
@@ -10560,10 +10534,6 @@ components:
1056010534
type: array
1056110535
items:
1056210536
$ref: "#/components/schemas/Permission"
10563-
teams:
10564-
type: array
10565-
items:
10566-
$ref: "#/components/schemas/Team"
1056710537
username:
1056810538
type: string
1056910539
maxLength: 255
@@ -10667,6 +10637,10 @@ components:
1066710637
$ref: "#/components/schemas/Permission"
1066810638
suspended:
1066910639
type: boolean
10640+
teams:
10641+
type: array
10642+
items:
10643+
$ref: "#/components/schemas/Team"
1067010644
username:
1067110645
type: string
1067210646
maxLength: 255

docs/reference/api/openapi-v2.yaml

Lines changed: 166 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ info:
5050
Note that if no sortable fields are documented for an operation,
5151
sorting is not supported *at all*.
5252
53+
## Field expansion
54+
55+
Some collection endpoints support an `expand` query parameter.
56+
Passing an expand value includes optional fields in each response item
57+
that are omitted by default, typically because they are expensive to compute
58+
and only needed in specific contexts.
59+
60+
Valid `expand` values for an endpoint are listed in its operation description.
61+
Unknown values are silently ignored.
62+
5363
## Errors
5464
5565
All error responses use the `application/problem+json` media type
@@ -191,12 +201,17 @@ paths:
191201
Sorting is supported for the following fields:
192202
193203
* `name`
194-
* `version`
195204
* `group`
196-
* `purl`
197-
* `cpe`
198205
* `last_inherited_risk_score`
199206
207+
### Expandable fields
208+
209+
The following fields can be included via `expand`:
210+
211+
* `metrics`
212+
* `package_metadata`
213+
* `package_artifact_metadata`
214+
200215
Requires permission `VIEW_PORTFOLIO`
201216
operationId: listComponents
202217
parameters:
@@ -262,6 +277,22 @@ paths:
262277
Requires `hash_type` to be set.
263278
schema:
264279
type: string
280+
- name: package_artifact_published_since
281+
in: query
282+
description: |-
283+
Filter by package artifact publish date (inclusive lower bound).
284+
285+
Note that components without resolved package artifact metadata,
286+
or whose upstream repository did not report a publication date,
287+
are excluded whenever `package_artifact_published_since` or
288+
`package_artifact_published_before` is set.
289+
schema:
290+
$ref: "#/components/schemas/timestamp"
291+
- name: package_artifact_published_before
292+
in: query
293+
description: Filter by package artifact publish date (exclusive upper bound).
294+
schema:
295+
$ref: "#/components/schemas/timestamp"
265296
- name: project_state
266297
in: query
267298
description: |-
@@ -280,6 +311,16 @@ paths:
280311
Omit to include components regardless of the flag.
281312
schema:
282313
type: boolean
314+
- name: expand
315+
in: query
316+
description: Optional fields to include in each component response item. Unknown
317+
values are silently ignored.
318+
style: form
319+
explode: true
320+
schema:
321+
type: array
322+
items:
323+
type: string
283324
- name: limit
284325
in: query
285326
description: Maximum number of items to retrieve from the collection
@@ -662,7 +703,30 @@ paths:
662703
tags:
663704
- Projects
664705
summary: Retrieves a list of all components for a given project.
665-
description: Requires permission `VIEW_PORTFOLIO`
706+
description: |-
707+
Requires permission `VIEW_PORTFOLIO`
708+
709+
### Sortable fields
710+
711+
Sorting is supported for the following fields:
712+
713+
* `name`
714+
* `group`
715+
* `last_inherited_risk_score`
716+
* `package_artifact_metadata.published_at`
717+
718+
Components without resolved artifact metadata, or whose upstream registry did not
719+
report a publication date, are placed at the end of the result for both sort
720+
directions when sorting by `package_artifact_metadata.published_at`.
721+
722+
### Expandable fields
723+
724+
The following fields can be included via `expand`:
725+
726+
* `metrics`
727+
* `package_metadata`
728+
* `package_artifact_metadata`
729+
* `occurrence_count`
666730
operationId: listProjectComponents
667731
parameters:
668732
- name: uuid
@@ -684,6 +748,22 @@ paths:
684748
are returned
685749
schema:
686750
type: boolean
751+
- name: q
752+
in: query
753+
description: Optional free-text search term. Matches components whose `group`
754+
or `name` contains the given value (case-insensitive).
755+
schema:
756+
type: string
757+
- name: expand
758+
in: query
759+
description: Optional fields to include in each component response item. Unknown
760+
values are silently ignored.
761+
style: form
762+
explode: true
763+
schema:
764+
type: array
765+
items:
766+
type: string
687767
- name: limit
688768
in: query
689769
description: Maximum number of items to retrieve from the collection
@@ -698,6 +778,18 @@ paths:
698778
description: Opaque token pointing to a specific position in a collection
699779
schema:
700780
type: string
781+
- name: sort_direction
782+
in: query
783+
schema:
784+
$ref: "#/components/schemas/sort-direction"
785+
- name: sort_by
786+
in: query
787+
description: Field to sort by. Refer to the operation description for information
788+
about which fields are sortable.
789+
schema:
790+
maxLength: 255
791+
minLength: 1
792+
type: string
701793
responses:
702794
"200":
703795
description: A list of all components for a given project
@@ -1549,22 +1641,22 @@ paths:
15491641
items:
15501642
pattern: "^[^=]+=.*$"
15511643
type: string
1552-
- name: created_at_from
1644+
- name: created_since
15531645
in: query
15541646
description: Filter runs created on or after this timestamp.
15551647
schema:
15561648
$ref: "#/components/schemas/timestamp"
1557-
- name: created_at_to
1649+
- name: created_before
15581650
in: query
15591651
description: Filter runs created before this timestamp.
15601652
schema:
15611653
$ref: "#/components/schemas/timestamp"
1562-
- name: completed_at_from
1654+
- name: completed_since
15631655
in: query
15641656
description: Filter runs completed on or after this timestamp.
15651657
schema:
15661658
$ref: "#/components/schemas/timestamp"
1567-
- name: completed_at_to
1659+
- name: completed_before
15681660
in: query
15691661
description: Filter runs completed before this timestamp.
15701662
schema:
@@ -1708,6 +1800,11 @@ paths:
17081800
$ref: "#/components/responses/generic-error"
17091801
components:
17101802
schemas:
1803+
timestamp:
1804+
type: integer
1805+
description: "Epoch timestamp in milliseconds since January 1, 1970 UTC."
1806+
format: int64
1807+
example: 1752209050377
17111808
project-state:
17121809
type: string
17131810
enum:
@@ -2324,11 +2421,6 @@ components:
23242421
- FAILED
23252422
- COMPLETED
23262423
- CANCELLED
2327-
timestamp:
2328-
type: integer
2329-
description: "Epoch timestamp in milliseconds since January 1, 1970 UTC."
2330-
format: int64
2331-
example: 1752209050377
23322424
list-workflow-runs-response:
23332425
required:
23342426
- items
@@ -2364,6 +2456,9 @@ components:
23642456
$ref: "#/components/schemas/total-count"
23652457
x-parent: true
23662458
list-components-response-item:
2459+
required:
2460+
- name
2461+
- uuid
23672462
type: object
23682463
properties:
23692464
name:
@@ -2417,6 +2512,10 @@ components:
24172512
$ref: "#/components/schemas/component-project"
24182513
metrics:
24192514
$ref: "#/components/schemas/dependency-metrics"
2515+
package_metadata:
2516+
$ref: "#/components/schemas/package-metadata"
2517+
package_artifact_metadata:
2518+
$ref: "#/components/schemas/package-artifact-metadata"
24202519
json-schema-validation-error:
24212520
required:
24222521
- instance_location
@@ -2595,6 +2694,9 @@ components:
25952694
- SERVICES
25962695
- TAGS
25972696
list-project-components-response-item:
2697+
required:
2698+
- name
2699+
- uuid
25982700
type: object
25992701
properties:
26002702
name:
@@ -2648,6 +2750,12 @@ components:
26482750
uuid:
26492751
type: string
26502752
format: uuid
2753+
metrics:
2754+
$ref: "#/components/schemas/dependency-metrics"
2755+
package_metadata:
2756+
$ref: "#/components/schemas/package-metadata"
2757+
package_artifact_metadata:
2758+
$ref: "#/components/schemas/package-artifact-metadata"
26512759
list-vuln-policies-response-item:
26522760
required:
26532761
- name
@@ -2959,6 +3067,51 @@ components:
29593067
policy_violations_operational_unaudited:
29603068
type: integer
29613069
format: int32
3070+
package-metadata:
3071+
required:
3072+
- resolved_at
3073+
type: object
3074+
properties:
3075+
latest_version:
3076+
type: string
3077+
description: |
3078+
Latest known version in the configured registries. Null when the resolver ran but returned no version.
3079+
nullable: true
3080+
latest_version_published_at:
3081+
description: |
3082+
When the latest version was published. May be null even when latest_version is non-null, as some registries do not report publication dates.
3083+
nullable: true
3084+
allOf:
3085+
- $ref: "#/components/schemas/timestamp"
3086+
resolved_at:
3087+
description: When package metadata was last resolved from the upstream repository.
3088+
allOf:
3089+
- $ref: "#/components/schemas/timestamp"
3090+
description: |
3091+
Latest version information from configured package registries. Only present when the component has a PURL with a type supported by at least one configured repository, and metadata has been successfully resolved from an upstream repository. Metadata resolution is asynchronous and runs in the background after a component is created or updated. This field may be absent for recently created components until resolution completes.
3092+
package-artifact-metadata:
3093+
type: object
3094+
properties:
3095+
hashes:
3096+
$ref: "#/components/schemas/hashes"
3097+
published_at:
3098+
description: When this artifact was published to the repository.
3099+
nullable: true
3100+
allOf:
3101+
- $ref: "#/components/schemas/timestamp"
3102+
resolved_from:
3103+
type: string
3104+
description: Identifier of the repository from which artifact metadata was
3105+
fetched.
3106+
nullable: true
3107+
resolved_at:
3108+
description: When artifact metadata was last resolved from the upstream
3109+
repository.
3110+
nullable: true
3111+
allOf:
3112+
- $ref: "#/components/schemas/timestamp"
3113+
description: |
3114+
Artifact-level metadata for the component's exact version from configured package repositories. Only present when the component has a PURL with a version, the PURL type is supported by at least one configured repository, and artifact metadata has been successfully resolved from an upstream repository. Metadata resolution is asynchronous and runs in the background after a component is created or updated. This field may be absent for recently created components until resolution completes.
29623115
extension-test-check-status:
29633116
type: string
29643117
enum:

0 commit comments

Comments
 (0)