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
The "industries" array parameter should be encoded as a csv list like this industries=1,16
Current Behavior
For an OAS2 spec the desired encoding for the array parameter could be achieved with "collectionFormat": "multi" in the parameter definition.
The OAS3 spec indicates that "collectionFormat": "multi" is now replaced by a "style": "form" value within the encoding. I have tried this (see the demonstration API definition), but the "industries" parameter gets encoded like this industries=[1,16]. The brackets are a problem for the underlying API.
Context
Is there any way to modify my OAS3 spec to encourage swagger-ui to encode the "industries" parameter without the brackets?
The text was updated successfully, but these errors were encountered:
Okay! I've fixed this specific case by adding a saner default for encoding array values: use toString instead of JSON.stringify.
However... the problem still remains that Swagger-Client isn't considering OAS3 encoding values (you're the first to mention it afaik!). I'll see if I can set aside some time to tackle that in the coming week(s).
Demonstration API definition
https://gist.githubusercontent.com/banders/29352a89a8ca4a17b46f46a6dd9fc84a/raw/afcf0137adf7f6ecb8e1b15cb0bb86b323807330/jobposting.json
Configuration
Test with:
[swagger-ui url]?url=https://gist.githubusercontent.com/banders/29352a89a8ca4a17b46f46a6dd9fc84a/raw/afcf0137adf7f6ecb8e1b15cb0bb86b323807330/jobposting.json#/Job_Feed/post_jobs
Test the 'POST Jobs' operation
Expected Behavior
The "industries" array parameter should be encoded as a csv list like this
industries=1,16
Current Behavior
For an OAS2 spec the desired encoding for the array parameter could be achieved with
"collectionFormat": "multi"
in the parameter definition.The OAS3 spec indicates that
"collectionFormat": "multi"
is now replaced by a"style": "form"
value within theencoding
. I have tried this (see the demonstration API definition), but the "industries" parameter gets encoded like thisindustries=[1,16]
. The brackets are a problem for the underlying API.Context
Is there any way to modify my OAS3 spec to encourage swagger-ui to encode the "industries" parameter without the brackets?
The text was updated successfully, but these errors were encountered: