RicoSuter/NSwag

Remove invalid characters in path segments when generating operation names

Open

#2,447 opened on Oct 5, 2019

View on GitHub
 (5 comments) (0 reactions) (0 assignees)C# (1,189 forks)batch import
help wantedtype: bug

Repository metrics

Stars
 (6,291 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Some OpenApi paths include characters which are not valid in a C# identifier and should not be included in the generated operation name.

Here is an example:

"/path1/path2/>pathWithInvalidPrefixChar": {
      "get": {
        "description": "",
        "operationId": "pathWithInvalidPrefixChar",
...

In this example, the ">" character should not be included in the generated operation name.

Contributor guide