You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using Kiota to generate a .NET client for this API, and the generated client doesn't contain the trailing slashes (see the issue at the top for more details).
While we agree it's not common to have trailing slashes, apparently it's supported according to the relevant RFCs.
Describe the solution you'd like
OpenAPI.NET should respect the OpenAPI path when building out the OpenApiUrlTreeNode tree.
Hi Mickaël Derriey (@mderriey),
Thanks for creating this issue and for starting the work for a PR.
We'll be happy to review your PR once it's ready! Make sure to add plenty of test cases!
We want to be sure extraneous nodes don't appear magically or nodes don't disappear because of that change.
Maggie Kimani (@MaggieKimani1) can you help guide the contributions here please? (currently traveling for the next 10 days, it'll probably be faster this way)
Mickaël Derriey (@mderriey) Thank you for raising this and it is awesome that you have made an attempt at a PR. My first reaction to this problem is one of mild terror. You are absolutely correct that we should support this scenario. However, we need to make sure that trailing slashes do not create child nodes. We effectively want to special case this so that the trailing slash is part of the prior path segment identifier. We may need to add a new property to the tree node to indicate that it is a leaf node with a trailing slash. I'll try and spend some time to look at your PR and provide feedback.
Reacted by Mickaël Derriey, Rujith Anand and John L. Armstrong IV
Activity
baywet commentedon Mar 6, 2024
Hi Mickaël Derriey (@mderriey),
Thanks for creating this issue and for starting the work for a PR.
We'll be happy to review your PR once it's ready! Make sure to add plenty of test cases!
We want to be sure extraneous nodes don't appear magically or nodes don't disappear because of that change.
mderriey commentedon Mar 6, 2024
Hey Vincent Biret (@baywet),
To be clear, the "work" I started is really just a showcase of how the trailing slash gets eaten away when building a URL tree node.
If you'd like me to continue that work, I'm going to need some guidance as to which approach we should take.
If we find the path ends with a slash, maybe we exclude the last slash from the split, so the last segment we process has the trailing slash?
Open to suggestions here.
baywet commentedon Mar 6, 2024
Maggie Kimani (@MaggieKimani1) can you help guide the contributions here please? (currently traveling for the next 10 days, it'll probably be faster this way)
darrelmiller commentedon Mar 6, 2024
Mickaël Derriey (@mderriey) Thank you for raising this and it is awesome that you have made an attempt at a PR. My first reaction to this problem is one of mild terror. You are absolutely correct that we should support this scenario. However, we need to make sure that trailing slashes do not create child nodes. We effectively want to special case this so that the trailing slash is part of the prior path segment identifier. We may need to add a new property to the tree node to indicate that it is a leaf node with a trailing slash. I'll try and spend some time to look at your PR and provide feedback.
sevein commentedon Jul 23, 2024
FWIW, @typespec/http has recently added support for including the trailing slash (microsoft/typespec#3350).
jlarmstrongiv commentedon Sep 8, 2024
Supporting trailing slashes would allow me to write clients for APIs like https://docs.bunny.net/reference/get_-storagezonename-path-
mderriey commentedon Sep 12, 2024
If someone wants to pick up the work on #1584, please go ahead, I don't have the capacity anymore.
Apologies for leaving things unfinished.
The changes requested in the latest comment (#1584 (comment)) should be easy to implement, I think most of them are suggestions already.
Thanks in advance.