{"record":{"id":"1dfbe28976a6d1b2","repo":"pinpoint-apm/pinpoint","slug":"webhook-url-is-required","errorCode":null,"errorMessage":"Webhook URL is required","messagePattern":"Webhook URL is required","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"commons-server/src/main/java/com/navercorp/pinpoint/common/server/webhook/WebhookUrlValidator.java","lineNumber":89,"sourceCode":"    ));\n\n    private WebhookUrlValidator() {\n    }\n\n    public static String validate(String url) {\n        final URI uri = validateUriSyntax(url);\n        validateHostWithoutResolving(uri.getHost());\n\n        return uri.toString();\n    }\n\n    public static String validateSyntax(String url) {\n        return validateUriSyntax(url).toString();\n    }\n\n    private static URI validateUriSyntax(String url) {\n        if (url == null || url.isBlank()) {\n            throw new IllegalArgumentException(\"Webhook URL is required\");\n        }\n\n        final URI uri;\n\n        try {\n            uri = new URI(url).normalize().parseServerAuthority();\n        } catch (URISyntaxException e) {\n            throw new IllegalArgumentException(\"Malformed webhook URL\", e);\n        }\n\n        validateScheme(uri);\n        validateAuthority(uri);\n\n        return uri;\n    }\n\n    private static void validateScheme(URI uri) {\n        String scheme = uri.getScheme();","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/commons-server/src/main/java/com/navercorp/pinpoint/common/server/webhook/WebhookUrlValidator.java#L71-L107","documentation":"WebhookUrlValidator.validateUriSyntax throws IllegalArgumentException when the webhook URL string is null or blank. A webhook target must be a concrete absolute URL before any URI parsing is attempted.","triggerScenarios":"Calling WebhookUrlValidator.validateSyntax(url) or uri(url) with null, \"\", or whitespace-only string; saving a webhook config without a URL field populated.","commonSituations":"Webhook configuration form submitted with the URL field empty; environment variable or config property for the webhook endpoint unset; JSON payload missing the url key.","solutions":["Provide a non-empty webhook URL before calling the validator","Add a required-field check in the form/config layer that surfaces 'URL is required' to the user earlier","Ensure the config property (e.g. webhook.url) is set in the environment or properties file"],"exampleFix":"// before\nString url = config.get(\"webhook.url\");\nWebhookUrlValidator.validateSyntax(url);\n// after\nString url = config.get(\"webhook.url\");\nif (url == null || url.isBlank()) throw new IllegalArgumentException(\"webhook.url must be configured\");\nWebhookUrlValidator.validateSyntax(url);","handlingStrategy":"validation","validationCode":"if (url == null || url.isBlank()) throw new IllegalArgumentException(\"webhook URL is required\");","typeGuard":"boolean hasWebhookUrl(String url) { return url != null && !url.isBlank(); }","tryCatchPattern":"try { WebhookUrlValidator.validateSyntax(url); } catch (IllegalArgumentException e) { form.reject(\"url\", \"Webhook URL is required\"); }","preventionTips":["Mark the webhook URL field as required in UI/config schemas","Check config properties at startup, fail fast on missing values","Trim whitespace from user input before validating"],"tags":["java","webhook","validation","url"],"backgroundTag":"empty-required-field","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}