{ ... "collectionItems": [ { "property": "somevalue" }, { "property": "someothervalue" } ]}
Cannot deserialize instance of `java.lang.String` out of START_OBJECT token at [Source: (ByteArrayInputStream); line: 23, column: 9] (through reference chain: com.codebarrel.automation.api.webhook.IncomingWebhook["collectionItems"]->java.util.ArrayList[0])
Hi @Willem Prins
Without seeing your complete rule and the response structure, my recommendation is to use the text and list handing functions, conditional list filtering, and to progressively write pieces of the response to the audit log. That may uncover if this is a problem identifying the structure in the response or an actual defect with parsing.
Here are some references to help with those steps:
Kind regards,Bill
Hi @Bill Sheboy Thanks for those links, it's good to know have these resources for working with smart values.
I created a new webhook to test my filtering options, and it seems the problem is that I cannot do perform any type of smartvalue handling because the payload as a whole is rejected when a parse error occurs. As soon as I replace the collection with a regular nested object, I can work with the payload.So in my case, any curly bracket "{" that follows a "[" causes a parse error, which would be the case for any webhook where the body contains a collection of objects. Considering that this seems to be a pretty common and valid JSON construct, I'm surprised that this cannot be parsed:From the spec:
> An array is an ordered collection of values [..] A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.
Hi, Willem!
One more thing to try: save the response as a created variable to convert it to a string and then try to parse it, using text and list functions.
If that still doesn't work, I recommend working with your site admin to submit a ticket to Atlassian Support here: https://support.atlassian.com/contact/#/ They may see something else to help. Once you hear back from them please post what you learn to benefit the community. Thanks!
Hi Bill, thanks for staying with us here. Sadly, there's no way to get that response or save it to a variable because the automation errors out when it cannot parse the payload.Thanks for the tip about contacting support though, I'll reach out to my admin and try and find answers there.Luckily our amazing third-party service's engineers were able to offer an alternative approach which means we get webhook payloads without an array of objects, so we're not entirely stuck.
It looks like you're new here. Sign in or register to get started.