typespec icon indicating copy to clipboard operation
typespec copied to clipboard

[Bug]: Trailing slash is always omitted from path

Open sevein opened this issue 9 months ago • 0 comments

Describe the bug

Thank you for making this project available, it's really great.

I have been unable to describe a path that includes a trailing slash (e.g., /location/{id}/refresh/ as opposed to /location/{id}/refresh) using @typespec/openapi3. This is not just a cosmetic issue in the API I'm documenting, but it's actually required. This API can automatically redirect clients to the path with the trailing slash; however, this is not feasible for methods like POST, PUT, etc.

Thank you in advance!

Reproduction

https://typespec.io/playground?c=aW1wb3J0ICJAdHlwZXNwZWMvaHR0cCI7CtIZb3BlbmFwaSI7Cgp1c2luZyBUeXBlU3BlYy5IdHRwO9AVT3BlbkFQSTsKCkBzZXJ2aWNlCm5hbWVzcGFjZSBEZW1vU8YWIHsKICBAcm91dGUoIi9sb2NhdGlvbiIpCiAgyjBMxxfFLSAgLy8gUFJPQkxFTTogdGhlIGVtaXR0ZXIgb21pdHPFEnRyYWls5ACQc2xhc2guyDZJdCBzaG91bGQgcmVhZCBgyXAve2lkfS9yZWZyZXNoL2AgKHdpdGjTSinIS8hSTk9URTogSSBjYW4gbWl0aWdhdGXFOGlzc3VlIGluIEtpb3RhIMVQYSBtaWRkbGV3YXJlIGxpa2U6yEcgIOQBeHM6Ly9naXN0LmdpdGh1Yi5jb20vc2V2ZWluL2M5NjQ3ZjA5NzQ4YTljYTBjNjhhMjE3ZmUzM2VmMzBmxUlAb3BlcuUA0ElkKCLnAM7lAUvrAWPtAOrIHXBvc3TFCm9wIMccKMUQxBxhdGjHDGlkOiBpbnRlZ2VyLMUTKToge307CiAgfQp9Cg%3D%3D&e=%40typespec%2Fopenapi3&options=%7B%22linterRuleSet%22%3A%7B%22extends%22%3A%5B%22%40typespec%2Fhttp%2Fall%22%5D%7D%7D

Checklist

sevein avatar May 14 '24 10:05 sevein