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

[typescript][angular] basePath through injected config #289

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ec8c581
#282: Use injected configuration to refer to basePath
akehir Jun 12, 2018
03939c8
Regenerate tests with new api templates
akehir Jun 12, 2018
9930f61
Ignore signing for other branches than master (#288)
jmini Jun 12, 2018
2ff81ca
Expanding customization docs (#283)
Jun 12, 2018
55f9e31
Update template modification docs (#291)
jimschubert Jun 13, 2018
ff94464
Updated api to always use configuration even if old http client is us…
akehir Jun 13, 2018
2995273
[go-server] Add dockerfile for building and run petstore service (#274)
etherealjoy Jun 13, 2018
49b8ece
update cpp server scripts/batch files (#296)
wing328 Jun 13, 2018
6f6a4a1
[rust-server] (Re-)Adding support for rust-server (#290)
bjgill Jun 13, 2018
f964873
Change "samples" profile name to "samples.shippable" (#305)
jmini Jun 13, 2018
91d6d77
[rust-server] Add rust-server to travis CI (#308)
bjgill Jun 13, 2018
7126074
add Go client test - TestPlaceOrder (#321)
grokify Jun 14, 2018
24104da
Add option modelPropertyNaming to javascript generator (#299)
stianlik Jun 14, 2018
f8e61ac
[typescript] fix cast problem (#303)
topce Jun 14, 2018
680a2bc
Configuration option to disable HTML escaping when using Gson (#298)
stianlik Jun 14, 2018
5630746
Remove "CI/pom.xml.shippable" (#319)
jmini Jun 15, 2018
6c996a7
Various improvement to CI (#326)
wing328 Jun 15, 2018
e5635d2
update brew readme (#330)
wing328 Jun 16, 2018
798bf61
Grammar and spelling fixes (#329)
scop Jun 16, 2018
53d9878
Update Petstore samples (#331)
wing328 Jun 16, 2018
c607ea8
Add fixes for es6 generator (#180)
delenius Jun 16, 2018
7c49bdd
CircleCI migration from 1.0 to 2.0 (#333)
wing328 Jun 17, 2018
75171b4
[C++] Rename template dir (#332)
ackintosh Jun 17, 2018
97bab92
[cli] Enable recommendations on validate command (#292)
jimschubert Jun 17, 2018
c51986d
Go server clean up (#328)
bvwells Jun 17, 2018
30d1021
Add links for released versions in compat table (#336)
grokify Jun 18, 2018
74914b6
Prepare release 3.0.2 (#337)
jmini Jun 18, 2018
9511586
Prepare 3.0.3-SNAPSHOT (#338)
jmini Jun 18, 2018
1ffc4a2
Moved Typescript Angular 6 builds into 'builds' subdirectory to confo…
akehir Jun 19, 2018
9151f65
Adding in Telstra (#357)
developersteve Jun 20, 2018
231202d
Initial roadmap (#295)
jimschubert Jun 20, 2018
3c9cf1d
Restore unit test (#346)
jmini Jun 20, 2018
d19a2fa
[php] Correctly handle multiple valid responses (#128)
fMads Jun 20, 2018
645a25b
Added angular 6 with-npm sample client
akehir Jun 20, 2018
108aabc
Add test cases for angular 6 generated sample client, as well as for …
akehir Jun 20, 2018
35fbac1
Fixed typos in typescript pom.xml
akehir Jun 20, 2018
9993684
Add no-watch to karma
akehir Jun 20, 2018
d4654fc
Use PhantomJS instead of Chrome, rename all typescript-angular-poms t…
akehir Jun 20, 2018
d5b209d
#282: Use injected configuration to refer to basePath
akehir Jun 12, 2018
63326b8
Regenerate tests with new api templates
akehir Jun 12, 2018
ddab13c
Updated api to always use configuration even if old http client is us…
akehir Jun 13, 2018
dc74492
Moved Typescript Angular 6 builds into 'builds' subdirectory to confo…
akehir Jun 19, 2018
6ec5160
Added angular 6 with-npm sample client
akehir Jun 20, 2018
d4d23d2
Add test cases for angular 6 generated sample client, as well as for …
akehir Jun 20, 2018
7cb71ab
Fixed typos in typescript pom.xml
akehir Jun 20, 2018
2353fe7
Add no-watch to karma
akehir Jun 20, 2018
802a42b
Use PhantomJS instead of Chrome, rename all typescript-angular-poms t…
akehir Jun 20, 2018
ea59f19
Merge branch 'feature/basePathThroughInjectedConfig' of github.com:ak…
akehir Jun 20, 2018
871445a
Enable angular 6 test cases in circleci
akehir Jun 20, 2018
dc880e8
Use nvm to update node
akehir Jun 20, 2018
6beb630
Do not show angular build progress as it spams the ci log
akehir Jun 20, 2018
c983865
Do not duplicate addons in travis
akehir Jun 20, 2018
dcb3d12
Run Chrome in headless mode for CI
akehir Jun 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export class {{classname}} {
if (configuration) {
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't you want to set

        if (configuration) {
            this.configuration = configuration;
            this.basePath = basePath || configuration.basePath || this.basePath;
        }
        this.configuration.basePath = this.basePath;

in order to account for the situation where you pass a configuration object that does not contain a base path plus a basePath parameter, since the basePath property of Configuration is optional, see
https://github.com/openapitools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache#L15
?

Copy link
Member

Choose a reason for hiding this comment

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

I would even mark the basePath property of the api service as deprecated, since only this.configuration.basePath should be used. what do you think about that?

Copy link
Member

Choose a reason for hiding this comment

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

looks good now

this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}

Expand Down Expand Up @@ -342,7 +344,7 @@ export class {{classname}} {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}{{{path}}}`, requestOptions);
return this.http.request(`${this.configuration.basePath}{{{path}}}`, requestOptions);
{{/useHttpClient}}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1-SNAPSHOT
3.0.2-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class PetService {
if (configuration) {
this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}

Expand Down Expand Up @@ -242,7 +244,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet`, requestOptions);
}

/**
Expand Down Expand Up @@ -292,7 +294,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -346,7 +348,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/findByStatus`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/findByStatus`, requestOptions);
}

/**
Expand Down Expand Up @@ -400,7 +402,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/findByTags`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/findByTags`, requestOptions);
}

/**
Expand Down Expand Up @@ -445,7 +447,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -498,7 +500,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet`, requestOptions);
}

/**
Expand Down Expand Up @@ -570,7 +572,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -646,7 +648,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export class StoreService {
if (configuration) {
this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}

Expand Down Expand Up @@ -156,7 +158,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -196,7 +198,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/inventory`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/inventory`, requestOptions);
}

/**
Expand Down Expand Up @@ -236,7 +238,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -281,7 +283,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/order`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/order`, requestOptions);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export class UserService {
if (configuration) {
this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}

Expand Down Expand Up @@ -227,7 +229,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user`, requestOptions);
}

/**
Expand Down Expand Up @@ -270,7 +272,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/createWithArray`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/createWithArray`, requestOptions);
}

/**
Expand Down Expand Up @@ -313,7 +315,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/createWithList`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/createWithList`, requestOptions);
}

/**
Expand Down Expand Up @@ -351,7 +353,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -391,7 +393,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -444,7 +446,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/login`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/login`, requestOptions);
}

/**
Expand Down Expand Up @@ -478,7 +480,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/logout`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/logout`, requestOptions);
}

/**
Expand Down Expand Up @@ -525,7 +527,7 @@ export class UserService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions);
}

}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1-SNAPSHOT
3.0.2-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class PetService {
if (configuration) {
this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}

Expand Down Expand Up @@ -242,7 +244,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet`, requestOptions);
}

/**
Expand Down Expand Up @@ -292,7 +294,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -346,7 +348,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/findByStatus`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/findByStatus`, requestOptions);
}

/**
Expand Down Expand Up @@ -400,7 +402,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/findByTags`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/findByTags`, requestOptions);
}

/**
Expand Down Expand Up @@ -445,7 +447,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -498,7 +500,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet`, requestOptions);
}

/**
Expand Down Expand Up @@ -570,7 +572,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -646,7 +648,7 @@ export class PetService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions);
return this.http.request(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export class StoreService {
if (configuration) {
this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}

Expand Down Expand Up @@ -156,7 +158,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -196,7 +198,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/inventory`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/inventory`, requestOptions);
}

/**
Expand Down Expand Up @@ -236,7 +238,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions);
}

/**
Expand Down Expand Up @@ -281,7 +283,7 @@ export class StoreService {
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
}

return this.http.request(`${this.basePath}/store/order`, requestOptions);
return this.http.request(`${this.configuration.basePath}/store/order`, requestOptions);
}

}
Loading