Skip to content

Generated client code does not replace/set route parameters with 14.0.0-preview010  #4587

@vas6ili

Description

@vas6ili

For a path template like /odata/QueueRetention({key}) generated client code does not replace {key} url route parameter. Used net80/dotnet-nswag.exe from https://github.com/RicoSuter/NSwag/releases/tag/v14.0.0-preview010 with net8 (which is the reason I'm upgrading to 14)

Generated client code snippet

var urlBuilder_ = new System.Text.StringBuilder();

urlBuilder_.Append("odata");
urlBuilder_.Append('/');
urlBuilder_.Append("QueueRetention({key})");

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

API definition snippet

    "/odata/QueueRetention({key})": {
        "delete": {
            "description": "",
            "operationId": "QueueRetention_Delete",
            "parameters": [
                {
                    "in": "path",
                    "name": "key",
                    "required": true,
                    "schema": {
                        "format": "int64",
                        "type": "integer"
                    },
                    "x-position": 1
                },
                {
                    "in": "header",
                    "name": "api-version",
                    "schema": {
                        "nullable": true,
                        "type": "string"
                    },
                    "x-position": 2
                }
            ],
            "responses": {
                "204": {
                    "description": ""
                }
            },
            "tags": [
                "QueueRetention"
            ]
        }
    }

test-swag.json
NswagClient.zip

Probably related to #4579 @paulomorgado

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions