Skip to content

Include extact HTTP content in case of Multipart #4405

Closed
@LasneF

Description

@LasneF

When using multipart it can be confusing especially when dealing with array

in the case describes

  content:
    multipart/form-data:
      schema:
        type: object
        properties:
          id:
            # default for primitives without a special format is text/plain
            type: string
          addresses:
            # default for arrays is based on the type in the `items`
            # subschema, which is an object, so `application/json`
            type: array
            items:
              type: object
              properties : 
                 street: 
                    type: string
                 city 
                    type : sting

it can be interesting to add the exact HTTP content

Rationnal : Prism fails to do validation of such structure ,
several AI tool chatbot replies divergent / not correct answer from the truth (or may be i am wrong still they are confused)
looks they are mixing the content , with the parameter name

Content-Type: multipart/form-data; boundary=--------------------------002292520254007945318895

----------------------------002292520254007945318895
Content-Disposition: form-data; name="id"
Content-Type: application/json
"32d49c7f-566c-4d07-9f13-08e74fb5c464"
----------------------------002292520254007945318895
Content-Disposition: form-data; name="addresses"
Content-Type: application/json
{
"street" : "4726 Earth Street"
"city" : "Houston"
}
----------------------------002292520254007945318895
Content-Disposition: form-data; name="addresses"
Content-Type: application/json
{
"street" : "4 Moon Street"
"city" : "Edwards"
}

----------------------------002292520254007945318895--

and not something with

----------------------------002292520254007945318895
Content-Disposition: form-data;
Content-Type: application/json
{
"addresses" : [ { "street" : "4 Moon Street" , "city" : "Edwards"} ,
{ "street" : "4726 Earth Street" , "city" : "Houston" } ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions