spring-cloud-contract icon indicating copy to clipboard operation
spring-cloud-contract copied to clipboard

feat: allow multipart parts with content types

Open adrianhj opened this issue 2 years ago • 1 comments

WIP implementation for commentary of an alternative approach for multipart/form-data support based off of the back of #1888 backed by WireMock's multipart support vs generating a regex against the request parts.

Looking to pick this back up and progress if there is interest with some guidance.

DSL wise aim would be to provide something closer to the multipart/form-data spec to give a bit more freedom than currently possible, such as the following for a scenario of sending a correctly structured JSON metadata part and a file part in the request.

multipart(
    metadata: part(
        value: "{...}",
        contentType: "application/json",
    ),
    file: part(
        value: <file>,
        filename: "example.pdf",
        contentType: "application/pdf"
    )
)

adrianhj avatar Aug 17 '23 10:08 adrianhj

Also since this is a new feature I think we should add it to main, WDYT ?

marcingrzejszczak avatar Sep 19 '23 12:09 marcingrzejszczak