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

[BUG][C] "-" in Parametername is converted to "_" #5101

Open
axbusch opened this issue Jan 24, 2020 · 1 comment
Open

[BUG][C] "-" in Parametername is converted to "_" #5101

axbusch opened this issue Jan 24, 2020 · 1 comment

Comments

@axbusch
Copy link

axbusch commented Jan 24, 2020

Version: 4.2.3-SNAPSHOT

 parameters:
      - name: x-api-token
          in: header
          description: Authorization Token
          required: false
          type: string

The generated code is:

 char* valueHeader_x_api_token;
  keyValuePair_t* keyPairHeader_x_api_token = 0;
  if (x_api_token) {
    keyHeader_x_api_token = strdup("x_api_token");
    valueHeader_x_api_token = strdup((x_api_token));
    keyPairHeader_x_api_token = keyValuePair_create(keyHeader_x_api_token, valueHeader_x_api_token);
    list_addElement(localVarHeaderParameters, keyPairHeader_x_api_token);
  }

but i would expect

keyHeader_x_api_token = strdup("x-api-token");
@axbusch axbusch changed the title [BUG] C "-" in Parametername is converted to "_" [BUG][C] "-" in Parametername is converted to "_" Jan 24, 2020
@ityuhui
Copy link
Contributor

ityuhui commented Feb 29, 2020

Hello @axbusch

I fix this defect in PR #5487 . Could you please have a try after the PR is mered?

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

No branches or pull requests

2 participants