forked from loafle/openapi-generator-original
* #2147: fix compiler error in angular typescript codegen * #2147: generate samples
This commit is contained in:
parent
804b589f5f
commit
e01a786bc9
@ -296,17 +296,17 @@ export class {{classname}} {
|
|||||||
if ({{paramName}}) {
|
if ({{paramName}}) {
|
||||||
{{#isCollectionFormatMulti}}
|
{{#isCollectionFormatMulti}}
|
||||||
{{paramName}}.forEach((element) => {
|
{{paramName}}.forEach((element) => {
|
||||||
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', <any>element){{#useHttpClient}} || formParams{{/useHttpClient}};
|
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', <any>element){{#useHttpClient}} as any || formParams{{/useHttpClient}};
|
||||||
})
|
})
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
{{^isCollectionFormatMulti}}
|
{{^isCollectionFormatMulti}}
|
||||||
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])){{#useHttpClient}} || formParams{{/useHttpClient}};
|
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])){{#useHttpClient}} as any || formParams{{/useHttpClient}};
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
}
|
}
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{^isListContainer}}
|
{{^isListContainer}}
|
||||||
if ({{paramName}} !== undefined) {
|
if ({{paramName}} !== undefined) {
|
||||||
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', <any>{{paramName}}){{#useHttpClient}} || formParams{{/useHttpClient}};
|
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', <any>{{paramName}}){{#useHttpClient}} as any || formParams{{/useHttpClient}};
|
||||||
}
|
}
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
|
@ -8,9 +8,7 @@
|
|||||||
export class CustomQueryEncoderHelper extends QueryEncoder {
|
export class CustomQueryEncoderHelper extends QueryEncoder {
|
||||||
encodeKey(k: string): string {
|
encodeKey(k: string): string {
|
||||||
k = super.encodeKey(k);
|
k = super.encodeKey(k);
|
||||||
return k.replace(/\+/gi, '%2B')
|
return k.replace(/\+/gi, '%2B');
|
||||||
.replace(/%5B/, "[").replace(/%5D/, "]")
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
encodeValue(v: string): string {
|
encodeValue(v: string): string {
|
||||||
v = super.encodeValue(v);
|
v = super.encodeValue(v);
|
||||||
|
@ -425,10 +425,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -498,10 +498,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -425,10 +425,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -498,10 +498,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -425,10 +425,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -498,10 +498,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -427,10 +427,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -500,10 +500,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -427,10 +427,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -500,10 +500,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -425,10 +425,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -498,10 +498,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -425,10 +425,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -498,10 +498,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -427,10 +427,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -500,10 +500,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
@ -427,10 +427,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams = formParams.append('name', <any>name) || formParams;
|
formParams = formParams.append('name', <any>name) as any || formParams;
|
||||||
}
|
}
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams = formParams.append('status', <any>status) || formParams;
|
formParams = formParams.append('status', <any>status) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.post<any>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
@ -500,10 +500,10 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) || formParams;
|
formParams = formParams.append('additionalMetadata', <any>additionalMetadata) as any || formParams;
|
||||||
}
|
}
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams = formParams.append('file', <any>file) || formParams;
|
formParams = formParams.append('file', <any>file) as any || formParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
return this.httpClient.post<ApiResponse>(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user