in src/main/java/com/amazon/inspector/jenkins/amazoninspectorbuildstep/AmazonInspectorBuilder.java [481:499]
public AmazonInspectorBuilder newInstance(StaplerRequest req, JSONObject formData) throws FormException {
String sourceVal = formData.optString("sbomgenSource", null);
formData.put("sbomgenSource", sourceVal);
JSONObject selectionObj = formData.optJSONObject("sbomgenSelection");
if (selectionObj != null && selectionObj.has("value")) {
String sbomValue = selectionObj.getString("value");
formData.put("sbomgenSelection", sbomValue);
if ("manual".equalsIgnoreCase(sbomValue)) {
String manualPath = selectionObj.optString("sbomgenPath", "").trim();
if (manualPath.isEmpty()) {
throw new FormException("Manual SBOMGen selected but no path provided.", "sbomgenPath");
}
formData.put("sbomgenPath", manualPath);
}
}
return req.bindJSON(AmazonInspectorBuilder.class, formData);
}