MrNiamh
01/04/2024, 6:47 PMval inputFilesMultipart = MultipartFormFile.multi.optional("inputFiles")
val proxyTrackingMultipart = MultipartFormField.auto<PostPutProxyTrackingRequestDTO>(CustomJackson).required("proxyTracking")
data class PostPutProxyTrackingRequestDTO(
val title: String,
val description: String,
val isin: String,
val date: LocalDate,
val existingDocumentIds: List<TenantDocumentId>,
val options: List<PostPutProxyTrackingOptionRequestDTO>
)
data class PostPutProxyTrackingOptionRequestDTO(
val option: String,
val voted: Boolean,
)
val proxyTrackingFormBody = Body.multipartForm(Validator.Strict, inputFilesMultipart, proxyTrackingMultipart).toLens()
I'm then sending this request (no files in this one):
curl '<http://localhost:9000/tenants/48a295c5-da55-45b7-8b95-78818dc38cc2/proxy-tracking>' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
-H 'Connection: keep-alive' \
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEsUJBnHCya0lYGPx' \
-H 'Origin: <http://localhost:3000>' \
-H 'Referer: <http://localhost:3000/>' \
--data-raw $'------WebKitFormBoundaryEsUJBnHCya0lYGPx\r\nContent-Disposition: form-data; name="body"; filename="blob"\r\nContent-Type: application/json\r\n\r\n{"title":"dsad","description":"adsadsa","isin":"ecf66d3a-f67c-451b-86ad-47d72c271c73","date":"2024-01-04","existingDocumentIds":[],"options":[]}\r\n------WebKitFormBoundaryEsUJBnHCya0lYGPx--\r\n' \
--compressed
but just get the below error when i run
proxyTrackingFormBody(request)
{
"message": "Missing/invalid parameters",
"params": [
{
"name": "proxyTracking",
"type": "form",
"datatype": "object",
"required": true,
"reason": "Missing"
}
]
}
The multipart all looks fine, content disposition etc all looks fine so I'm at a bit of a loss.dave
01/05/2024, 8:40 AMMrNiamh
01/05/2024, 9:51 AM.auto
) so it should be setup correctly.
I'll see if I can put together a little project to replicate itMrNiamh
01/05/2024, 5:01 PMfilename="blob"
that breaks it, if I remove it then it works. Feels like that should be ignored either way considering it's a MultipartFormField
?MrNiamh
01/05/2024, 6:50 PMPostPutProxyTrackingRequestDTO
to the swagger is there? I can't see a place to put an example which would allow it to generate. As a workaround I have an empty endpoint, but feels like there must be better?