8000 add basePath to GenApiClient by jaumard · Pull Request #10 · Jaguar-dart/client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add basePath to GenApiClient #10

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

Merged
merged 11 commits into from
Aug 29, 2018

Conversation

jaumard
Copy link
Contributor
@jaumard jaumard commented Aug 29, 2018

fix #1

Copy link
Member
@tejainece tejainece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Please fix the requested changes.

@@ -2,5 +2,6 @@ export 'requests.dart';
export 'params.dart';

class GenApiClient {
const GenApiClient();
final String basePath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just path should be enough?

@@ -2,5 +2,6 @@ export 'requests.dart';
export 'params.dart';

class GenApiClient {
const GenApiClient();
final String basePath;
const GenApiClient([this.basePath = ""]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make basePath named optional argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean just initialize it to null instead ?

@@ -22,7 +22,7 @@ class Writer {

sb.write('var req = base.${r.method}');

if (r.path != null) sb.write('.path("${r.path}")');
if (r.path != null) sb.write('.path("\$basePath${r.path}")');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use two different calls to .path method. That way, Jaguar Resty will take care of missing forward slashes, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ho ok !

@tejainece
Copy link
Member

@jaumard Please fix the merge conflicts.

@jaumard
Copy link
Contributor Author
jaumard commented Aug 29, 2018

Let me know if there something more to do @tejainece should be ok now

Copy link
Member
@tejainece tejainece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the requested changes.

@@ -2,5 +2,6 @@ export 'requests.dart';
export 'params.dart';

class GenApiClient {
const GenApiClient();
final String path;
const GenApiClient([this.path = null]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change it to named optional parameter.

const GenApiClient({this.path});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

Copy link
Member
@tejainece tejainece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member
@tejainece tejainece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

Base path for ApiClient
2 participants
0