Skip to content

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

@mrnitoqq

Description

@mrnitoqq

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions