forked from loafle/openapi-generator-original
[Typescript] Fix typescript-inversify compiler errors (#3607)
* Update addJsonHeaders addJsonHeaders currently throws a compiler error because the headers args in get/put/post etc is nullable, but the argument in addJsonHeaders is not * Executed samples generator
This commit is contained in:
@@ -40,7 +40,7 @@ class HttpClient implements IHttpClient {
|
||||
return !(body instanceof FormData) ? JSON.stringify(body) : body;
|
||||
}
|
||||
|
||||
private addJsonHeaders(headers: Headers) {
|
||||
private addJsonHeaders(headers?: Headers) {
|
||||
return Object.assign({}, {
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json"
|
||||
@@ -77,4 +77,4 @@ class HttpClient implements IHttpClient {
|
||||
}
|
||||
}
|
||||
|
||||
export default HttpClient
|
||||
export default HttpClient
|
||||
|
||||
@@ -35,7 +35,7 @@ class HttpClient implements IHttpClient {
|
||||
return !(body instanceof FormData) ? JSON.stringify(body) : body;
|
||||
}
|
||||
|
||||
private addJsonHeaders(headers: Headers) {
|
||||
private addJsonHeaders(headers?: Headers) {
|
||||
return Object.assign({}, {
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json"
|
||||
@@ -67,4 +67,4 @@ class HttpClient implements IHttpClient {
|
||||
}
|
||||
}
|
||||
|
||||
export default HttpClient
|
||||
export default HttpClient
|
||||
|
||||
Reference in New Issue
Block a user