gravitee-io / issues

Gravitee.io - API Platform - Issues
65 stars 26 forks source link

API webhook notifier is not working for subscriptions #10056

Open exalate-issue-sync[bot] opened 1 month ago

exalate-issue-sync[bot] commented 1 month ago

Describe the bug :

describe-the-bug-

API webhook notifier receives an error when triggered and does not send the notification to the webhook endpoint.

To Reproduce :

to-reproduce-

Steps to reproduce the behaviour:

  1. Create a webhook notifier on an API in the Notification Settings and select a subscription event, eg. Subscription Accepted.
  2. Trigger the notification by enacting the subscribed event, eg. Create and accept a new subscription for the API.
  3. The webhook endpoint does not receive a notification and an error appears in the management api logs.

Expected behaviour :

expected-behaviour-

Webhook notifier should successfully send a notification when triggered.

Current behaviour :

current-behaviour-

Webhook notifier is unable to send a notification due to an error when triggered.

Useful information :

useful-information-

ERROR o.s.a.i.SimpleAsyncUncaughtExceptionHandler - Unexpected exception occurred invoking async method: public void io.gravitee.rest.api.service.impl.NotifierServiceImpl.trigger(io.gravitee.rest.api.service.common.ExecutionContext,io.gravitee.rest.api.service.notification.ApiHook,java.lang.String,java.util.Map)java.lang.ClassCastException: class io.gravitee.apim.core.notification.model.ApiNotificationTemplateData cannot be cast to class io.gravitee.rest.api.model.v4.api.GenericApiEntity (io.gravitee.apim.core.notification.model.ApiNotificationTemplateData and io.gravitee.rest.api.model.v4.api.GenericApiEntity are in unnamed module of loader java.net.URLClassLoader @f6f4d33)at io.gravitee.rest.api.service.notifiers.impl.WebhookNotifierServiceImpl.toJson(WebhookNotifierServiceImpl.java:78)at io.gravitee.rest.api.service.notifiers.impl.WebhookNotifierServiceImpl.trigger(WebhookNotifierServiceImpl.java:52)

Desktop :

desktop-

* Please see Zendesk Support tab for further comments and attachments.

exalate-issue-sync[bot] commented 1 week ago

This issue will be fixed in versions 4.3.17, 4.4.13, 4.2.22, 4.5.2