From 92940527027bb5cf926f395418c850b87916eed1 Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:17:44 +0200 Subject: [PATCH] Adding required annotations to license fields Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- backend/internal/license/license_detector.go | 5 +++++ backend/internal/server/openapi.yml | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/internal/license/license_detector.go b/backend/internal/license/license_detector.go index 9b26bdef..b79a54aa 100644 --- a/backend/internal/license/license_detector.go +++ b/backend/internal/license/license_detector.go @@ -96,14 +96,19 @@ func (l List) String() string { // swagger:model License type License struct { // SPDX is the SPDX identifier for the license. + // required: true SPDX string `json:"spdx"` // Confidence indicates how accurate the license detection is. + // required: true Confidence float32 `json:"confidence"` // IsCompatible signals if the license is compatible with the OpenTofu project. + // required: true IsCompatible bool `json:"is_compatible"` // File holds the file in the repository where the license was detected. + // required: true File string `json:"file"` // Link may contain a link to the license file for humans to view. This may be empty. + // required: false Link string `json:"link,omitempty"` } diff --git a/backend/internal/server/openapi.yml b/backend/internal/server/openapi.yml index e616c371..15acd536 100644 --- a/backend/internal/server/openapi.yml +++ b/backend/internal/server/openapi.yml @@ -1,8 +1,8 @@ definitions: Addr: description: |- - Addr describes a module address combination of NAMESPACE-NAME-TARGETSYSTEM. This will translate to - github.com/NAMESPACE/terraform-TARGETSYSTEM-NAME for now. + Addr represents a full provider address (NAMESPACE/NAME). It currently translates to + github.com/NAMESPACE/terraform-provider-NAME . type: object BaseDetails: properties: @@ -112,6 +112,11 @@ definitions: spdx: description: SPDX is the SPDX identifier for the license. type: string + required: + - spdx + - confidence + - is_compatible + - file title: License describes a license found in a repository. type: object LicenseList: