swagger-api / swagger-js

Javascript library to connect to swagger-enabled APIs via browser or nodejs
http://swagger.io
Apache License 2.0
2.6k stars 755 forks source link

fix(execute): parse stringified objects #3474

Closed glowcloud closed 3 months ago

glowcloud commented 3 months ago

Refs https://github.com/swagger-api/swagger-ui/issues/7734

This example from the test:

requestBody: {
  a: {
    b: 'c',
    c: ['d', 'e'],
    d: {
      e: 'f',
    },
  },
},

will return:

a%5Bb%5D=c&a%5Bc%5D=%5B%22d%22%2C%22e%22%5D&a%5Bd%5D=%7B%22e%22%3A%22f%22%7D

which should decode to:

a[b]=c&a[c]=["d","e"]&a[d]={"e":"f"}

As established for previous issues, we're not encoding nested objects/arrays, as the behaviour for that is undefined.

swagger-bot commented 3 months ago

:tada: This PR is included in version 3.27.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: