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
Describe the bug
We need to use parameters with the characters '%2F' in them. After the change to src/RestSharp/Parameters/Parameter.cs in 4ddda24, which changed the Value property of the Parameter record from having an init set accessor to having no set accessor, we are unable to do this since there is no way to override the regex logic performed on the value in the UrlSegmentParameter constructor. Previously we were doing the following to set the Value property to the desired value
To Reproduce
Steps to reproduce the behavior, preferably using a code snippet.
Post the non-working request here as well if you made it work using Postman, Swagger, or any other client.
See that this code does not compile:
new UrlSegmentParameter("foo","foo%2fbar"){Value="foo%2fbar"};
and new UrlSegmentParameter("foo", "foo%2fbar") results in a parameter with a Value of foo/bar
Expected behavior
A clear and concise description of what you expected to happen.
Post the working request here as well if you made it work using Postman, Swagger, or any other client.
You can use https://requestbin.com/r to create a public request bin and share the link in the issue.
We should be able to use a path parameter that includes '%2F' or '%2f'. I have a pull request for a suggested fix here #2265
Stack trace
Copy the full stack trace here if you get an exception.
Desktop (please complete the following information):
OS: [e.g. macOS]
.NET version [e.g. .NET 6]
Version [e.g. 110.2.0]
macOS .NET 8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
We need to use parameters with the characters '%2F' in them. After the change to src/RestSharp/Parameters/Parameter.cs in 4ddda24, which changed the Value property of the Parameter record from having an init set accessor to having no set accessor, we are unable to do this since there is no way to override the regex logic performed on the value in the UrlSegmentParameter constructor. Previously we were doing the following to set the Value property to the desired value
We are unable to use a different class for this parameter due to this line https://github.com/restsharp/RestSharp/blob/dev/src/RestSharp/Request/UriExtensions.cs#L57
To Reproduce
Steps to reproduce the behavior, preferably using a code snippet.
Post the non-working request here as well if you made it work using Postman, Swagger, or any other client.
See that this code does not compile:
and
new UrlSegmentParameter("foo", "foo%2fbar")
results in a parameter with a Value offoo/bar
Expected behavior
A clear and concise description of what you expected to happen.
Post the working request here as well if you made it work using Postman, Swagger, or any other client.
You can use https://requestbin.com/r to create a public request bin and share the link in the issue.
We should be able to use a path parameter that includes '%2F' or '%2f'. I have a pull request for a suggested fix here #2265
Stack trace
Copy the full stack trace here if you get an exception.
Desktop (please complete the following information):
macOS .NET 8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: