Skip to content

Add support of kebab-case naming in routes names #141

@llotall

Description

@llotall

Describe the bug
Generated wrong methods names in the case of kebab-case naming style of the routes

Just give the name of the route wirh kebab case like that:

.MapGet(
    "some-route-name/{id:guid}",
    (ISender sender, [AsParameters] SomeCommand command, CancellationToken cancellationToken) =>
        sender.Send(query, cancellationToken))

To Reproduce

"/api/v1/attachment/image/some-route-name/{id}": {
      "get": {
        "tags": [
          "image"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SomeResponse"
                }
              }
            }
          }
        }
      }
    }

Expected behavior
Generated service with correct method name

typescript public someRouteName(id: string): Observable<...>

Additional context
Actual result:

typescript public some-route - name(id: string): Observable<...>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions