Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rest): update response API Get a single release #2009

Conversation

tuannn2
Copy link
Contributor

@tuannn2 tuannn2 commented Jun 20, 2023

Issue: #1979

How To Test?

  • Run command line:
$ curl 'https://sw360.org/api/releases/3765276512' -i -X GET \
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic3czNjAtUkVTVC1BUEkiXSwidXNlcl9uYW1lIjoiYWRtaW5Ac3czNjAub3JnIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTY4NzIzMTYzOCwiYXV0aG9yaXRpZXMiOlsiUkVBRCIsIldSSVRFIl0sImp0aSI6ImJUQ3ZHZWE2U1dyRWFwZThTR2o2RzJ2M3RSRSIsImNsaWVudF9pZCI6InRydXN0ZWQtc3czNjAtY2xpZW50In0.Hj0HmAHlSMq9K9ilFH3kXs0LBI5ICCR6Z1PceIMqWp3zaa0xbfLIQLeH92jmyHqDUlGuzrXHidW796tUQnJzeVD2qNfZNDGkby0Dhn1BRF8x7u-JM-UZMlFpUlQhUDe7kKqapsG3stvYVUkmyh7OvJjaEmVpjIKSW7E6S0DKEINgWTz3fPCI_az2o6IrC4gjmSa1_1gNCokK84K472GgeDLUeiBNwfiH9l4orNNGw4BLBwuf5EI3Ijzy65Qptbyu2uM1M-z1L__fz3G2r5ORn6WTXjW5UM1wME2z_Hn-fqeXwPgfo5HHX8Cxs32fowWlSY1aBB7drGL2Wymi5hQGIw' \
    -H 'Accept: application/hal+json'
  • Expected Output:
{
  "name" : "Spring Core 4.3.4",
  "version" : "4.3.4",
  "releaseDate" : "2016-12-07",
  "componentType" : "OSS",
  "externalIds" : {
    "mainline-id-component" : "1432",
    "ws-component-id" : "[\"2365\",\"5487923\"]"
  },
  "additionalData" : {
    "Key" : "Value"
  },
  "createdOn" : "2016-12-18",
  "mainlineState" : "SPECIFIC",
  "clearingState" : "APPROVED",
  "createdBy" : "admin@sw360.org",
  "otherLicenseIds" : [ "BSD-3-Clause", "MIT" ],
  "languages" : [ "Java", "C++" ],
  "operatingSystems" : [ "Windows", "Linux" ],
  "softwarePlatforms" : [ ".NET", "Java SE" ],
  "sourceCodeDownloadurl" : "http://www.google.com",
  "binaryDownloadurl" : "http://www.google.com/binaries",
  "cpeId" : "cpe:/a:pivotal:spring-core:4.3.4:",
  "eccInformation" : {
    "al" : "AL",
    "eccn" : "ECCN",
    "assessorContactPerson" : "admin@sw360.org",
    "assessorDepartment" : "DEPARTMENT",
    "eccComment" : "Set ECC",
    "materialIndexNumber" : "12",
    "assessmentDate" : "2023-06-27",
    "eccStatus" : "OPEN"
  },
  "_links" : {
    "sw360:component" : {
      "href" : "https://sw360.org/api/components/17653524"
    },
    "self" : {
      "href" : "https://sw360.org/api/releases/3765276512"
    },
    "curies" : [ {
      "href" : "https://sw360.org/docs/{rel}.html",
      "name" : "sw360",
      "templated" : true
    } ]
  },
  "_embedded" : {
    "sw360:modifiedBy" : {
      "email" : "admin@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/123456789"
        }
      }
    },
    "sw360:subscribers" : [ {
      "email" : "jane@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/209582812"
        }
      }
    }, {
      "email" : "admin@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/123456789"
        }
      }
    } ],
    "sw360:licenses" : [ {
      "OSIApproved" : "NA",
      "FSFLibre" : "NA",
      "checked" : true,
      "shortName" : "Apache-2.0",
      "fullName" : "Apache 2.0 License",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/licenses/ba776860-8ef0-4797-9b96-1c8c74073082"
        }
      }
    }, {
      "OSIApproved" : "NA",
      "FSFLibre" : "NA",
      "checked" : true,
      "shortName" : "GPL-2.0-or-later",
      "fullName" : "GNU General Public License 2.0",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/licenses/cffb7db0-1535-4987-9c34-b690d54f3ff3"
        }
      }
    } ],
    "sw360:createdBy" : {
      "email" : "admin@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/123456789"
        }
      }
    },
    "sw360:moderators" : [ {
      "email" : "jane@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/209582812"
        }
      }
    }, {
      "email" : "admin@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/123456789"
        }
      }
    } ],
    "sw360:contributors" : [ {
      "email" : "jane@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/209582812"
        }
      }
    }, {
      "email" : "admin@sw360.org",
      "deactivated" : false,
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/123456789"
        }
      }
    } ],
    "sw360:attachments" : [ {
      "filename" : "spring-core-4.3.4.RELEASE.jar",
      "sha1" : "da373e491d3863477568896089ee9457bc316783",
      "attachmentType" : "BINARY_SELF",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/attachments/1231231254"
        }
      }
    }, {
      "filename" : "spring-core-4.3.4.RELEASE.jar",
      "sha1" : "da373e491d3863477568896089ee9457bc316783",
      "attachmentType" : "BINARY_SELF",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/attachments/1231231254"
        }
      }
    } ]
  }
}

@afsahsyeda afsahsyeda self-assigned this Jun 20, 2023
@tienlee tienlee added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for REST New-UI Level for the API and UI level changes for the new-ui labels Jun 21, 2023
@nikkuma7
Copy link

Test Successful.
image

@ag4ums ag4ums assigned rudra-superrr and unassigned afsahsyeda Jun 27, 2023
@@ -1007,4 +1092,18 @@ public void addEmbeddedComponentOwnerToComponent(HalResource halResource, Compon
}
}
}

public void addEmbeddedSubcribeToHalResourceComponent(HalResource halResource, Component sw360Component) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method has nothing to do with this PR, right? you just added for future use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because PR(#1983) was merged before, to avoid duplicate PR I added it to this same PR.

@@ -1000,11 +995,6 @@ public static abstract class VulnerabilityApiDTOMixin extends VulnerabilityApiDT

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonIgnoreProperties({
"assessorContactPerson",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you removed these 5 fields, as I'm not able to see any of these fields in response structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your comment. I updated response structure.

@rudra-superrr rudra-superrr removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Jun 27, 2023
@tuannn2 tuannn2 force-pushed the release/feature_update_response_API_Get_a_single_release branch from d73d7bb to 535da17 Compare June 27, 2023 10:33
Signed-off-by: tuannn2 <tuan2.nguyennhu@toshiba.co.jp>
@tuannn2 tuannn2 force-pushed the release/feature_update_response_API_Get_a_single_release branch from 535da17 to e8f6e6b Compare June 27, 2023 10:42
@rudra-superrr
Copy link
Contributor

Changes looks good.

@rudra-superrr rudra-superrr added ready ready to merge and removed needs code review labels Jun 27, 2023
@ag4ums ag4ums merged commit 32db002 into eclipse-sw360:main Jun 28, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-UI Level for the API and UI level changes for the new-ui ready ready to merge REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants