mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[GH-ISSUE #1979] [bug]: Generate code throws error for some language #637
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#637
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @devblin on GitHub (Nov 28, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1979
Is there an existing issue for this?
Current behavior
Current behavior
Currently, I am getting following, without any code for NodeJs Axios code generator language.
PRODUCTION:

DEVELOPMENT:

Expected behavior
Steps to reproduce
Environment
Production
Version
Cloud
@devblin commented on GitHub (Nov 28, 2021):
@liyasthomas , I have checked the code-base, and found similar error for few more generators. And, I tried fixing NodeJs Axios one in local environment, it's working fine. If you can confirm the bug, I would like to submit a PR for this issue.
@liyasthomas commented on GitHub (Nov 28, 2021):
Hi @devblin, appreciate your interest in contributing to Hoppscotch. Feel free to open a PR and we'll take a look into it.
@devblin commented on GitHub (Nov 28, 2021):
@liyasthomas , For methods other than GET, the contentType and requestBody could be null, so in null cases, can we have placeholders for contentType as "REQUEST_CONTENT_TYPE" and similar for requestBody in the generated code?
@liyasthomas commented on GitHub (Nov 28, 2021):
Can we omit attributes such as
bodyandcontent-typethat has a possiblenullvalue? And only append to the generated code if it's not a null. A null check would be enough.@devblin commented on GitHub (Nov 28, 2021):
Yeah, sure I will make changes handling nulls and append non-null attributes.