fix: missing '?' in query parameter string for code generators
This commit is contained in:
@@ -25,7 +25,7 @@ export const GoNativeCodegen = {
|
||||
const requestBody = rawInput ? rawParams : rawRequestBody
|
||||
if (method === "GET") {
|
||||
requestString.push(
|
||||
`req, err := http.NewRequest("${method}", "${url}${pathName}${queryString}")\n`
|
||||
`req, err := http.NewRequest("${method}", "${url}${pathName}?${queryString}")\n`
|
||||
)
|
||||
}
|
||||
if (["POST", "PUT", "PATCH", "DELETE"].includes(method)) {
|
||||
@@ -33,11 +33,11 @@ export const GoNativeCodegen = {
|
||||
if (isJSONContentType(contentType)) {
|
||||
requestString.push(`var reqBody = []byte(\`${requestBody}\`)\n\n`)
|
||||
requestString.push(
|
||||
`req, err := http.NewRequest("${method}", "${url}${pathName}${queryString}", bytes.NewBuffer(reqBody))\n`
|
||||
`req, err := http.NewRequest("${method}", "${url}${pathName}?${queryString}", bytes.NewBuffer(reqBody))\n`
|
||||
)
|
||||
} else if (contentType.includes("x-www-form-urlencoded")) {
|
||||
requestString.push(
|
||||
`req, err := http.NewRequest("${method}", "${url}${pathName}${queryString}", strings.NewReader("${requestBody}"))\n`
|
||||
`req, err := http.NewRequest("${method}", "${url}${pathName}?${queryString}", strings.NewReader("${requestBody}"))\n`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user