My API accepts null value, but the error said it don't

Hello, I'm new here.
So currently I'm trying to build a form input which the parameters will be sent to API from our server.
The problem is, the API accepts null values for the data from Form and I've tried it in our swagger and it's works well.
But when I call it from the retool it returns:

{
"errors": {
"mode": [
"The value 'null' is not valid for Mode."
]
},
"type": "RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-cab4eff5ea9878438f18b23451fc1432-b5c53460eb69294f-00"
}

Any idea what should I do?

=-=-=-=-=-=-=-=-=-=-=-=-=
this is how I test it in swagger. the responseBody shows only UrlSlug, means I only sent that parameter while the others is null.

while this is the try on the retool


this image is the simpler version that I test, because the parameters should be much more than that, and the errors are more that simply only the Mode there.

The null value I sent there should be from Form objects like Multiselect, Editable Numbers, etc.

Solved by giving a bridge (transformer) for the value into empty string before parsing to the API.

1 Like

Hey @DarkJoxie - glad you got this solved and thank you for posting your solution :slightly_smiling_face: Let us know if you hit any other snags!