You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i send this request to the Specmatic Stub, i get the following error:
This happens because Specmatic thinks a multipart part of type array should contain an array, and not be one:
Internally this is interpreted as a ListPattern which matches only if the value is an array.
Snippet from ListPattern.kt
If i change my part value to an array, it works, but that's not the behaviour i expected:
Steps to reproduce
Create a stub using the following OpenApi Definition:
Make an HTTP POST request to the /message endpoint containing the following parts:
Expected behavior
I expect to receive a 200 OK generated response
System Information:
OS & version: Windows 11
Browser & version: Postman 10.16.0
Specmatic version: 0.73.0
JDK version: OpenJDK 17
Additional context
To fix it, we'll need to change the way Specmatic interprets "type: array" on multipart parts. Changing the meaning from "contains a json array" to "expect to have the same part multiple times"
The text was updated successfully, but these errors were encountered:
@aeoncl Thank you for your patience. The reason we were taking time on this PR is to make sure we also understood the http RFC around this. And it does look like the expected behaviour in your bug description is valid as per this section in RFC 7578. We are now reviewing your PR in this regard. cc @jaydeepk
Description
Hi 😁, here's the issue:
In a multipart-form-data, you can have an array of parts by specifing the same partname multiple times.
Here is how it looks in the OpenApi definition (pdfFiles):
We expect this to be an array of pdfFiles:
If i send this request to the Specmatic Stub, i get the following error:
This happens because Specmatic thinks a multipart part of type array should contain an array, and not be one:
Internally this is interpreted as a ListPattern which matches only if the value is an array.
Snippet from ListPattern.kt
If i change my part value to an array, it works, but that's not the behaviour i expected:
Steps to reproduce
Expected behavior
I expect to receive a 200 OK generated response
System Information:
Additional context
To fix it, we'll need to change the way Specmatic interprets "type: array" on multipart parts. Changing the meaning from "contains a json array" to "expect to have the same part multiple times"
The text was updated successfully, but these errors were encountered: