swagger-api / swagger-api/swagger-codegen-generators

Incorrect order of parameters with nodejs-server

Open
#906 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

When generating the nodejs-server code, the order of parameters for GET methods does not match the expected order.

Both this library (for POST methods) and the "oas3-tools" library expect the order of the parameters to be:
query --> path --> headers --> cookies

The NodeJSServerCodegen is currently adding "allParams" for GET requests, which will output parameters in the order defined in the swagger file (which could be path --> query --> headers --> cookies).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the NodeJSServerCodegen entry point and the GET handling that adds "allParams"; compare it with the POST parameter ordering described in the issue. Done means generated GET methods consistently order parameters as query, path, headers, then cookies, rather than following the Swagger file order.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.