Skip to content
New issue

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

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

Already on GitHub? # to your account

Wrong indentation in nodejs-axios when body type is urlencoded #445

Closed
webholik opened this issue Jan 20, 2021 · 0 comments · Fixed by #446
Closed

Wrong indentation in nodejs-axios when body type is urlencoded #445

webholik opened this issue Jan 20, 2021 · 0 comments · Fixed by #446
Assignees

Comments

@webholik
Copy link
Contributor

Describe the bug
When the body type isx-www-form-urlencoded, the generated Axios code has wrong indentation.

To Reproduce
Choose body as x-www-form-urlencoded and enter at least two key-value pairs.
The output is:

var data = qs.stringify({
 'hello': 'world',
'this': 'that' 
});

Expected code snippet and corresponding request

var data = qs.stringify({
    'hello': 'world',
    'this': 'that' 
});

Screenshots
Screenshot 2021-01-20 at 5 40 09 PM

Additional context
This is the offending line in codegens/nodejs-axios/lib/parseRequest.js:

bodySnippet += ` data = qs.stringify({\n ${dataArray.join(',\n')} \n});`;

We are not doing any indentation at all.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
1 participant