diff --git a/clients/client/src/main/java/org/eclipse/sw360/clients/rest/resource/releases/SW360Release.java b/clients/client/src/main/java/org/eclipse/sw360/clients/rest/resource/releases/SW360Release.java index a74c5e819a..87c3d2e882 100644 --- a/clients/client/src/main/java/org/eclipse/sw360/clients/rest/resource/releases/SW360Release.java +++ b/clients/client/src/main/java/org/eclipse/sw360/clients/rest/resource/releases/SW360Release.java @@ -44,6 +44,7 @@ public final class SW360Release extends SW360HalResource mainLicenseIds, 66: optional set otherLicenseIds, + 67: optional string declaredLicense, 40: optional Vendor vendor, 41: optional string vendorId, diff --git a/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/JacksonCustomizations.java b/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/JacksonCustomizations.java index 611dfce7b6..bd10806a8f 100644 --- a/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/JacksonCustomizations.java +++ b/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/JacksonCustomizations.java @@ -1104,6 +1104,7 @@ public static abstract class RequestSummaryMixin extends RequestSummary { "rolesIsSet", "mainLicenseIdsIsSet", "otherLicenseIdsIsSet", + "declaredLicenseIsSet", "vendorIsSet", "vendorIdIsSet", "clearingInformationIsSet", @@ -1231,6 +1232,7 @@ static abstract class ReleaseMixin extends Release { "rolesIsSet", "mainLicenseIdsIsSet", "otherLicenseIdsIsSet", + "declaredLicenseIsSet", "vendorIsSet", "vendorIdIsSet", "clearingInformationIsSet", diff --git a/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/RestControllerHelper.java b/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/RestControllerHelper.java index 5a7131402d..88a531b78e 100644 --- a/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/RestControllerHelper.java +++ b/rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/RestControllerHelper.java @@ -992,7 +992,7 @@ public Package convertToEmbeddedPackage(Package pkg) { public Release convertToEmbeddedReleaseWithDet(Release release) { List fields = List.of("id", "name", "version", "cpeid", "createdBy", "createdOn", "componentId","componentType", - "additionalData", "clearingState", "mainLicenseIds", "binaryDownloadurl", "sourceCodeDownloadurl", + "additionalData", "clearingState", "declaredLicense", "mainLicenseIds", "binaryDownloadurl", "sourceCodeDownloadurl", "releaseDate", "externalIds", "languages", "operatingSystems", "softwarePlatforms", "vendor", "mainlineState", "packageIds"); return convertToEmbeddedRelease(release, fields); diff --git a/rest/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/ReleaseSpecTest.java b/rest/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/ReleaseSpecTest.java index 647532ccbe..1c2476c8e3 100644 --- a/rest/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/ReleaseSpecTest.java +++ b/rest/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/ReleaseSpecTest.java @@ -284,6 +284,7 @@ public void before() throws TException, IOException { release.setLanguages(new HashSet<>(Arrays.asList("C++", "Java"))); release.setMainLicenseIds(new HashSet<>(Arrays.asList("GPL-2.0-or-later", "Apache-2.0"))); release.setOtherLicenseIds(new HashSet<>(Arrays.asList("MIT", "BSD-3-Clause"))); + release.setDeclaredLicense("MIT OR GPL-2.0-or-later"); release.setOperatingSystems(ImmutableSet.of("Windows", "Linux")); release.setSoftwarePlatforms(new HashSet<>(Arrays.asList("Java SE", ".NET"))); release.setEccInformation(eccInformation); @@ -759,6 +760,7 @@ public void should_document_get_release_all_details() throws Exception { subsectionWithPath("_embedded.sw360:releases.[]additionalData").description("A place to store additional data used by external tools").optional(), subsectionWithPath("_embedded.sw360:releases.[]releaseIdToRelationship").description("Release Id To Relationship of Release").optional(), subsectionWithPath("_embedded.sw360:releases.[]languages").description("The language of the component"), + subsectionWithPath("_embedded.sw360:releases.[]declaredLicense").description("The declared SPDX license expression").optional(), subsectionWithPath("_embedded.sw360:releases.[]mainLicenseIds").description("An array of all main licenses").optional(), subsectionWithPath("_embedded.sw360:releases.[]otherLicenseIds").description("An array of all other licenses associated with the release").optional(), subsectionWithPath("_embedded.sw360:releases.[]operatingSystems").description("The OS on which the release operates"), @@ -910,6 +912,7 @@ public void should_document_get_release() throws Exception { fieldWithPath("releaseDate").description("The date of this release"), fieldWithPath("createdOn").description("The creation date of the internal sw360 release"), fieldWithPath("componentType").description("The componentType of the release, possible values are " + Arrays.asList(ComponentType.values())), + fieldWithPath("declaredLicense").description("The declared SPDX license expression").optional(), fieldWithPath("mainlineState").description("the mainline state of the release, possible values are: " + Arrays.asList(MainlineState.values())), subsectionWithPath("eccInformation").description("The eccInformation of this release"), fieldWithPath("sourceCodeDownloadurl").description("the source code download url of the release"), @@ -1457,6 +1460,7 @@ private RestDocumentationResultHandler documentReleaseProperties() { fieldWithPath("version").description("The version of the release"), fieldWithPath("createdBy").description("Email of the release creator"), fieldWithPath("cpeid").description("CpeId of the release"), + fieldWithPath("declaredLicense").description("The declared SPDX license expression").optional(), fieldWithPath("mainLicenseIds").description("An array of all main licenses"), fieldWithPath("clearingState").description("The clearing of the release, possible values are " + Arrays.asList(ClearingState.values())), fieldWithPath("releaseDate").description("The date of this release"),