Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support [<BasePath>] #36

Open
Smaug123 opened this issue Dec 29, 2023 · 1 comment · Fixed by #44
Open

Support [<BasePath>] #36

Smaug123 opened this issue Dec 29, 2023 · 1 comment · Fixed by #44

Comments

@Smaug123
Copy link
Owner

Smaug123 commented Dec 29, 2023

E.g. from their docs:

[BasePath("v1")]
public interface ISomeApi
{
    [Get("first")]
    Task<FirstResponse> GetFirstAsync();

    [Get("{url}")]
    Task GetSecondAsync([Path] string url);
}

Remember, this needs to respect any /absolute/paths in the member annotations: if we pass /foo to GetSecondAsync, the result is that we skip the v1 from the BasePath.

Also from the docs:

If it's specified both ways, then the [BaseAddress(...)] attribute is ignored. This means that you can have a default Base Address specified on the interface, but this can be overridden when actually instantiating it using RestClient.

@Smaug123
Copy link
Owner Author

Oops, I implemented BaseAddress and not BasePath in #44.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant