Hi, hoping someone can help here.
I have built a custom connector, all works fine providing I don't provide multiple values for an array parameter.
The original URL could look like:
http://example.com/api/v2/events?processId=10,20,30
I've defined the Custom Connector definition using Swagger, below is a snippet of what has been defined for this action:
paths:
/events:
get:
tags:
- Events
description: Get a list of events filtered by Query Parameters
summary: Search for events
operationId: GetEvents
deprecated: false
produces:
- application/json
- $ref: '#/parameters/processId'
responses:
200:
$ref: '#/responses/EventCollectionOk'
400:
$ref: '#/responses/BadRequest'
404:
$ref: '#/responses/NotFound'
processId:
name: processId
in: query
type: array
collectionFormat: csv
items:
type: integer
When I go to test, I'm getting a InternalServerError back from the API. Looking at the request URL it appears to be encoding the "," like so:
The following error is then seen in the response body:
{
"type": "NumberFormatException",
"message": "An exception has been raised by the application.",
"messageKey": "rest.exceptions.Exception",
"diagnostic": "For input string: \"10,20,30\""
}
Using Postman, I can replicate this behaviour, but if I change the "processId" value to "10,20,30" it works fine.
Is there a way to prevent the custom connector encoding request URL? There's another 100+ query parameters that also are in the same situation, I've tried to change the items type to "string" / "number" with no change in behaviour.
When its used in a flow, the same behaviour is experienced, I'm guessing anyway as that also sees an internal server error, but if I don't use multiple parameter values in the query parameters, it works fine.
Thanks 🙂