Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues passing array element correctly for a POST application/x-www-form-urlencoded content type #2740

Open
freddyexposito opened this issue Nov 22, 2024 · 0 comments

Comments

@freddyexposito
Copy link

We are trying to render correctly a POST endpoint for application/x-www-form-urlencoded content type but there is an issue to try to pass multiple elements to an array of Strings element.

Context

Our customers cannot properly use our stoplight API test page to submit POST request to our test server when there is an array of multiple values in a application/x-www-form-urlencoded request

Current Behavior

When we put multiple values in the array, the curl generated command doesn't put the array variable properly
image
image

Expected Behavior

It should be able to render the curl command using the same array variable to pass multiple values

curl --request POST \
--url https://brokers.vividseats.com/webservices/v1/transfer0rderVic
-header 'Accept: application/xml, application/json* \
--header 'Content-Type: application/x-www-form-urlencoded' \/
--data apiToken= \
--data 'orderId=' \
-data orderiloken=
--data 'transferURLList=http://a.com'
--data 'transferURLList=http://b.com'
-data transter sources

Possible Workaround/Solution

not known

Steps to Reproduce

Creating endpoint like this one

"/v1/transferOrderViaURL" : {
      "post" : {
        "tags" : [ "/v1" ],
        "summary" : "/transferOrderViaURL",
        "description" : "XML response response and supports JSON<br />Order id or orderToken are required <br />Transfers Electronic Transfer tickets via URL<br />Not rate limited",
        "operationId" : "transferOrderViaURL",
        "requestBody" : {
          "content" : {
            "application/x-www-form-urlencoded" : {
              "schema" : {
                "type" : "object",
                "properties" : {
                  "apiToken" : {
                    "type" : "string"
                  },
                  "orderId" : {
                    "type" : "integer",
                    "format" : "int32"
                  },
                  "orderToken" : {
                    "type" : "string"
                  },
                  "transferURLList" : {
                    "type" : "array",
                    "items" : {
                      "type" : "string"
                    }
                  },
                  "transferSource" : {
                    "type" : "string"
                  }
                }
              }
            },
            "*/*" : {
              "schema" : {
                "type" : "object",
                "properties" : {
                  "apiToken" : {
                    "type" : "string"
                  },
                  "orderId" : {
                    "type" : "integer",
                    "format" : "int32"
                  },
                  "orderToken" : {
                    "type" : "string"
                  },
                  "transferURLList" : {
                    "type" : "array",
                    "items" : {
                      "type" : "string"
                    }
                  },
                  "transferSource" : {
                    "type" : "string"
                  }
                }
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Successful operation",
            "content" : {
              "application/xml" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Response"
                }
              },
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Response"
                }
              }
            }
          }
        }
      }
    }

Environment

https://vividseats.stoplight.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant