typespec
typespec copied to clipboard
[Bug]: Trailing slash is always omitted from path
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
- [X] Follow our Code of Conduct
- [X] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- [X] The provided reproduction is a minimal reproducible example of the bug.