Skip to content

Commit c55d159

Browse files
chirinoctron
authored andcommitted
fixes: openapi: uuid types don't look like uuids #792
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
1 parent dee61d0 commit c55d159

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

modules/fundamental/src/advisory/model/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use utoipa::ToSchema;
1818
pub struct AdvisoryHead {
1919
/// The opaque UUID of the advisory.
2020
#[serde(with = "uuid::serde::urn")]
21+
#[schema(value_type=String)]
2122
pub uuid: Uuid,
2223

2324
/// The identifier of the advisory, as assigned by the issuing organization.

modules/fundamental/src/license/model/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use uuid::Uuid;
1212
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
1313
pub struct LicenseSummary {
1414
#[serde(with = "uuid::serde::urn")]
15+
#[schema(value_type=String)]
1516
pub id: Uuid,
1617
pub license: String,
1718
pub spdx_licenses: Vec<String>,

modules/fundamental/src/product/model/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use trustify_entity::{product, product_version};
1212
#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)]
1313
pub struct ProductHead {
1414
#[serde(with = "uuid::serde::urn")]
15+
#[schema(value_type=String)]
1516
pub id: Uuid,
1617
pub name: String,
1718
}
@@ -31,13 +32,15 @@ impl ProductHead {
3132
#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)]
3233
pub struct ProductVersionHead {
3334
#[serde(with = "uuid::serde::urn")]
35+
#[schema(value_type=String)]
3436
pub id: Uuid,
3537
pub version: String,
3638
#[serde(
3739
default,
3840
skip_serializing_if = "Option::is_none",
3941
with = "trustify_common::uuid::serde::urn"
4042
)]
43+
#[schema(value_type=String)]
4144
pub sbom_id: Option<Uuid>,
4245
}
4346

modules/fundamental/src/sbom/model/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use super::service::SbomService;
1717
#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)]
1818
pub struct SbomHead {
1919
#[serde(with = "uuid::serde::urn")]
20+
#[schema(value_type=String)]
2021
pub id: Uuid,
2122
pub hashes: Vec<Id>,
2223

openapi.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,6 @@ components:
18191819
nullable: true
18201820
uuid:
18211821
type: string
1822-
format: uuid
18231822
description: The opaque UUID of the advisory.
18241823
withdrawn:
18251824
type: string
@@ -2322,7 +2321,6 @@ components:
23222321
properties:
23232322
id:
23242323
type: string
2325-
format: uuid
23262324
license:
23272325
type: string
23282326
purls:
@@ -2687,7 +2685,6 @@ components:
26872685
properties:
26882686
id:
26892687
type: string
2690-
format: uuid
26912688
name:
26922689
type: string
26932690
ProductSbomHead:
@@ -2735,11 +2732,8 @@ components:
27352732
properties:
27362733
id:
27372734
type: string
2738-
format: uuid
27392735
sbom_id:
27402736
type: string
2741-
format: uuid
2742-
nullable: true
27432737
version:
27442738
type: string
27452739
Progress:
@@ -2953,7 +2947,6 @@ components:
29532947
$ref: '#/components/schemas/Id'
29542948
id:
29552949
type: string
2956-
format: uuid
29572950
labels:
29582951
$ref: '#/components/schemas/Labels'
29592952
name:

0 commit comments

Comments
 (0)