wiremock-webhooks-extension
wiremock-webhooks-extension copied to clipboard
Multiple postServe actions
Hello,
How can I request multiple webhooks per mapping ?
-- Thanks, Andrei
I'm also interested to know.
Can we define more than one single callback / webhook ? As the JSON type of "postServeActions" is an object ({...}) and not an array ([...]), I'm afraid not :-(
{
"request" : {
...
},
"response" : {
...
},
"postServeActions" : {
}
}
But on the other hand, its name is "postServeActions" (plural !)
Huum, there seems to be a way to have multiple post-serve actions...but only one per extension:
I'm not sure why I implemented it that way. I'll have a look at whether it's feasible to change this to accept a list.
I'll have a look at whether it's feasible to change this to accept a list.
Oh yes, that would be very handy !
I'm also very interested in #8 so that we can use for callbacks exactly the same mechanism (eg bodyFileName
, transformerParameters
) as for responses, eg
"postServeActions" : {
"webhook" : {
"method" : "POST",
"url" : "http://...",
"bodyFileName" : "templates/dynamic-request.xml",
"transformerParameters" : {
"my-template-param" : "foo"
}
}
}
I'd really like to work on #8 but it's not all that trivial. I've got a big backlog of stuff to do with WireMock core, so I'm going to struggle to get to it in the near future unfortunately.
I'd really like to work on #8 but it's not all that trivial. I've got a big backlog of stuff to do with WireMock core, so I'm going to struggle to get to it in the near future unfortunately.
How's the work on #8 going? I would like to help implementing that feature
I'm not sure why I implemented it that way. I'll have a look at whether it's feasible to change this to accept a list.
Also considering backwards compatibility, how about defining a new extension with name "webhooks"
(currently it's singular in the getName()
and allow that to have aa list of WebhookDefinition
. This way there are no changes needed in core with how extensions are loaded.
I appreciate your backlog so I'll propose this change in a pr, but lemme know if I'm totally off!
-- Would appreciate opinions on this