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

Incorrect url generation when using new baseurl #519

Closed
martinale14 opened this issue Oct 12, 2023 · 0 comments
Closed

Incorrect url generation when using new baseurl #519

martinale14 opened this issue Oct 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@martinale14
Copy link
Contributor

martinale14 commented Oct 12, 2023

Steps to Reproduce

  1. Actual builder if you provide this input
@ChopperApi(baseUrl: 'https://localhost:4000/test')
abstract class HttpTestServiceBaseUrl extends ChopperService {
  static HttpTestServiceBaseUrl create([ChopperClient? client]) =>
      _$HttpTestServiceBaseUrl(client);

  @Get(path: '')
  Future<Response> getAll();
}
  1. Produces this output
final class _$HttpTestServiceBaseUrl extends HttpTestServiceBaseUrl {
  _$HttpTestServiceBaseUrl([ChopperClient? client]) {
    if (client == null) return;
    this.client = client;
  }

  @override
  final definitionType = HttpTestServiceBaseUrl;

  @override
  Future<Response<dynamic>> getAll() {
    final Uri $url = Uri.parse('https:/localhost:4000/test');
    final Request $request = Request(
      'GET',
      $url,
      client.baseUrl,
    );
    return client.send<dynamic, dynamic>($request);
  }
}
  1. As you notice the final Uri is generating with only one slash https:/...
  2. I am currently working on a solution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants