Skip to content

Commit

Permalink
OpenAPITools#5174 fix [BUG] [typescript-angular]: objects as query pa…
Browse files Browse the repository at this point in the history
…rameters break when fields are null
  • Loading branch information
daniel-frak committed Feb 3, 2020
1 parent b36b659 commit c59943d
Show file tree
Hide file tree
Showing 49 changed files with 261 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ export class {{classname}} {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ export class PetService implements PetServiceInterface {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ export class StoreService implements StoreServiceInterface {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ export class UserService implements UserServiceInterface {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down Expand Up @@ -72,7 +72,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down Expand Up @@ -161,7 +165,7 @@ export class PetService {
/**
* Deletes a pet
* @param petId Pet id to delete
* @param apiKey
* @param apiKey
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down Expand Up @@ -58,7 +58,11 @@ export class StoreService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down Expand Up @@ -58,7 +58,11 @@ export class UserService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down Expand Up @@ -72,7 +72,11 @@ export class PetService {
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams {
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if(value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
Expand Down Expand Up @@ -161,7 +165,7 @@ export class PetService {
/**
* Deletes a pet
* @param petId Pet id to delete
* @param apiKey
* @param apiKey
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
Expand Down
Loading

0 comments on commit c59943d

Please sign in to comment.