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

[REQ] Javascript client: allow dot in path parameters #6030

Closed
mrnitoqq opened this issue Apr 23, 2020 · 2 comments · Fixed by #6116
Closed

[REQ] Javascript client: allow dot in path parameters #6030

mrnitoqq opened this issue Apr 23, 2020 · 2 comments · Fixed by #6116

Comments

@mrnitoqq
Copy link

Is your feature request related to a problem? Please describe.

I'm using grpc-gateway patch feature so it generates following openapi spec

"/v1/public/auth/user/{user.id}": {
      "put": {
        "summary": "Update user",
        "operationId": "AuthService_UpdateUser",
        "responses": {
          ...
        },
        "parameters": [
          {
            "name": "user.id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          ...
        ]
      },
      "patch": {
        "summary": "Update user",
        "operationId": "AuthService_UpdateUser2",
        "responses": {
          ...
        },
        "parameters": [
          {
            "name": "user.id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          ...
        ],
      }
    },

As we can see there is {user.id} parameter in the path, but js client does not replace it with correct variable.
According to this lines
Javascript/ApiClient.mustache#L147
Javascript/es6/ApiClient.mustache#L137
it replaces only {user_id} like params

Describe the solution you'd like

Changing regexp to /\{([\w-\.]+)\}/g will solve the problem

Describe alternatives you've considered

Additional context

@wing328
Copy link
Member

wing328 commented Apr 29, 2020

Changing regexp to /{([\w-.]+)}/g will solve the problem

can you please file a PR with the suggested fix so that we can review it more easily?

@nitoqq
Copy link
Contributor

nitoqq commented Apr 30, 2020

Hi, please look PR ^^

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

Successfully merging a pull request may close this issue.

3 participants