-
-
Notifications
You must be signed in to change notification settings - Fork 776
Description
Is your feature request related to a problem? Please describe.
I have several "string wrapper" record structs for which the value contains a / which I would like to be part of the generated url. It seems from:
https://github.com/reactiveui/refit/blob/main/Refit/RestMethodInfo.cs#L319-L324
that the only supported parameter type supporting the "Round-tripping" ** syntax is string.
What I want is something like:
public interface IApi
{
[Get("/{**repo}/users/{id}")]
Task<User> GetUserAsync(Repository repo, int id);
}(either with or without the **)
Repository is a record struct that has a string in the some/repo format, that is with a / that I do not want to be url encoded.
Describe the solution you'd like
I can see three solutions (maybe there are more).
- Simply allow any type to by round-tripping, and call ToString() on it.
- Allow to somehow register the type
RepositoryinRefitSettingsand have an explicit formatter associated with it. - Make it possible using the current
IUrlParameterFormatterto return the raw string somehow. Currently theIUrlParameterFormatteris not invoked when the parameter is part of the path.
Describe alternatives you've considered
None
Describe suggestions on how to achieve the feature
None
Additional context
None