Modified the root path of endpoint mapping
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
+@RequestMapping("/mvn")
public class VulnerabilityApi {
private final VulnerabilityApiService service;
@@ -15,40 +16,40 @@ public class VulnerabilityApi {
this.service = service;
}
- @GetMapping(value = "/mvn/vulnerabilities", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(value = "/vulnerabilities", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String> getAllVulnerabilities(@RequestParam(required = false, defaultValue = "0") int offset,
@RequestParam(required = false, defaultValue = RestApplication.DEFAULT_PAGE_SIZE) int limit,
@RequestParam(required = false, defaultValue = "") List<String> attributes) {
return service.getAllVulnerabilities(offset, limit, attributes);
}
- @GetMapping(value = "/mvn/vulnerabilities/{external_id}", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(value = "/vulnerabilities/{external_id}", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String > getVulnerability(@PathVariable("external_id") String externalId,
@RequestParam(required = false, defaultValue = "") List<String> attributes) {
return service.getVulnerability(externalId, attributes);
}
- @GetMapping(value = "/mvn/vulnerabilities/{external_id}/purls", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(value = "/vulnerabilities/{external_id}/purls", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String> getPurls(@RequestParam(required = false, defaultValue = "0") int offset,
@RequestParam(required = false, defaultValue = RestApplication.DEFAULT_PAGE_SIZE) int limit,
@PathVariable("external_id") String externalId) {
return service.getPurls(externalId, offset, limit);
}
- @GetMapping(value = "/mvn/vulnerabilities/{external_id}/callables", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(value = "/vulnerabilities/{external_id}/callables", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String> getVulnerableCallables(@RequestParam(required = false, defaultValue = "0") int offset,
@RequestParam(required = false, defaultValue = "1000") int limit,
@PathVariable("external_id") String externalId) {
return service.getVulnerableCallables(externalId, offset, limit);
}
- @PostMapping(value = "/mvn/vulnerabilities/coordinates", produces = MediaType.APPLICATION_JSON_VALUE)
+ @PostMapping(value = "/vulnerabilities/coordinates", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String> getCoordinatesVulnerabilities(@RequestBody List<String> mavenCoordinates,
@RequestParam(required = false, defaultValue = "") List<String> attributes) {
return service.getCoordinatesVulnerabilities(mavenCoordinates, attributes);
}
- @GetMapping(value = "/mvn/packages/{pkg}/{pkg_ver}/vulnerabilities", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(value = "/packages/{pkg}/{pkg_ver}/vulnerabilities", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String> getPackageVersionVulnerabilities(@PathVariable("pkg") String package_name,
@PathVariable("pkg_ver") String package_version,
@RequestParam(required = false, defaultValue = "") List<String> attributes) {
