PostServeActions and ServeEventListeners
Webhooks
Java DSL
These inspections perform various static code analysis on Webhooks.webhook()
call chains and the related outer .withServeEventListener()
calls. Currently, they check the following:
Missing withUrl()
call
If there is no URL specified, there is no target to send the webhook request to.

Usage of the ANY
request method
ANY is designed for request matching, so using it may not be valid.

Listener name not specified as webhook
when using a webhook definition
When a webhook definition is specified in .withServeEventListener()
, the listener name must be webhook
.

Duplicate configuration
This inspection reports duplicate withBody()
and withBinaryBody()
calls in WebhookDefinition
call chains. When a body is specified in multiple calls/ways, the body’s value would be overridden.
A quick fix is also available to remove duplicate calls for the selected body. It keeps the call that the user invokes the quick fix on.

JSON DSL
These inspections perform various static code analysis on serveEventListener.parameters
properties. Currently, they check the following:
Missing url
property
If there is no URL specified, there is no target to send the webhook request to.

Usage of the ANY
request method
ANY is designed for request matching, so using it may not be valid.

headers
property value is not an object
The value of the headers
property must be an object, essentially of a map of header name-value pairs.

Duplicate configuration
This inspection reports duplicate body configuration in the serveEventListener.parameters
property. Validated properties are body
and base64Body
.
Regardless of if multiple of the same property, or different properties are specified, they are all reported and highlighted if duplicates are found.
Also, the related quick fix removes duplicate properties, keeping the property that the user invokes the quick fix on:
