diff --git a/bin/typescript-angular-petstore-all.sh b/bin/typescript-angular-petstore-all.sh index bdcd3cdc959..fb3e9b7ef36 100755 --- a/bin/typescript-angular-petstore-all.sh +++ b/bin/typescript-angular-petstore-all.sh @@ -15,3 +15,4 @@ ./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh ./bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh ./bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh +./bin/typescript-angular-v8-petstore-single-request-parameter.sh diff --git a/bin/typescript-angular-v8-petstore-single-request-parameter.sh b/bin/typescript-angular-v8-petstore-single-request-parameter.sh new file mode 100755 index 00000000000..9f25d467d21 --- /dev/null +++ b/bin/typescript-angular-v8-petstore-single-request-parameter.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/typescript-angular-petstore-all.bat b/bin/windows/typescript-angular-petstore-all.bat index bc57daca4bb..46dc9814917 100644 --- a/bin/windows/typescript-angular-petstore-all.bat +++ b/bin/windows/typescript-angular-petstore-all.bat @@ -13,3 +13,4 @@ call .\bin\windows\typescript-angular-v7-not-provided-in-root.bat call .\bin\windows\typescript-angular-v7-not-provided-in-root-with-npm.bat call .\bin\windows\typescript-angular-v8-provided-in-root-with-npm.bat call .\bin\windows\typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat +call .\bin\windows\typescript-angular-v8-single-request-parameter.bat diff --git a/bin/windows/typescript-angular-v8-single-request-parameter.bat b/bin/windows/typescript-angular-v8-single-request-parameter.bat new file mode 100644 index 00000000000..c963702b04c --- /dev/null +++ b/bin/windows/typescript-angular-v8-single-request-parameter.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true + + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 1ab11ff90e0..9c49c147614 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -16,6 +16,7 @@ sidebar_label: typescript-angular |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| +|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| |providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).| |false| |ngVersion|The version of Angular.| |8.0.0| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index c4cc372e35a..832152b8927 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -44,6 +44,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String NPM_REPOSITORY = "npmRepository"; public static final String WITH_INTERFACES = "withInterfaces"; + public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; public static final String TAGGED_UNIONS = "taggedUnions"; public static final String NG_VERSION = "ngVersion"; public static final String PROVIDED_IN_ROOT = "providedInRoot"; @@ -58,6 +59,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode protected String ngVersion = "8.0.0"; protected String npmRepository = null; + private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; protected String serviceFileSuffix = ".service"; protected String modelSuffix = ""; @@ -86,6 +88,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode this.cliOptions.add(CliOption.newBoolean(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", false)); + this.cliOptions.add(CliOption.newBoolean(USE_SINGLE_REQUEST_PARAMETER, + "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", + false)); this.cliOptions.add(CliOption.newBoolean(TAGGED_UNIONS, "Use discriminators to create tagged unions instead of extending interfaces.", this.taggedUnions)); @@ -163,6 +168,11 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode apiTemplateFiles.put("apiInterface.mustache", "Interface.ts"); } } + + if (additionalProperties.containsKey(USE_SINGLE_REQUEST_PARAMETER)) { + this.setUseSingleRequestParameter(convertPropertyToBoolean(USE_SINGLE_REQUEST_PARAMETER)); + } + writePropertyBack(USE_SINGLE_REQUEST_PARAMETER, getUseSingleRequestParameter()); if (additionalProperties.containsKey(TAGGED_UNIONS)) { taggedUnions = Boolean.parseBoolean(additionalProperties.get(TAGGED_UNIONS).toString()); @@ -576,6 +586,14 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode this.npmRepository = npmRepository; } + private boolean getUseSingleRequestParameter() { + return useSingleRequestParameter; + } + + private void setUseSingleRequestParameter(boolean useSingleRequestParameter) { + this.useSingleRequestParameter = useSingleRequestParameter; + } + private String getApiFilenameFromClassname(String classname) { String name = classname.substring(0, classname.length() - serviceSuffix.length()); return toApiFilename(name); diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 1ab70a7427c..28d21d1e299 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -30,11 +30,29 @@ import { {{classname}} } from '../{{filename}}'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; {{#withInterfaces}} -import { {{classname}}Interface } from './{{classFilename}}Interface'; +import { + {{classname}}Interface{{#useSingleRequestParameter}}{{#operations}}{{#operation}}{{#allParams.0}}, + {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams{{/allParams.0}}{{/operation}}{{/operations}}{{/useSingleRequestParameter}} +} from './{{classFilename}}Interface'; {{/withInterfaces}} {{#operations}} +{{^withInterfaces}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams { +{{#allParams}} + {{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}}; +{{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} +{{/withInterfaces}} + {{#description}} /** * {{&description}} @@ -108,11 +126,14 @@ export class {{classname}} { {{#summary}} * @summary {{&summary}} {{/summary}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ + {{^useSingleRequestParameter}}{{#allParams}} + * @param {{paramName}} {{description}}{{/allParams}}{{/useSingleRequestParameter}} + {{#useSingleRequestParameter}}{{#allParams.0}} + * @param requestParameters + {{/allParams.0}}{{/useSingleRequestParameter}}*/ {{! if you change this method signature, also change the version below }} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}{{#hasParams}}, {{/hasParams}}extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { - return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}extraHttpRequestParams) + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams{{/allParams.0}}{{/useSingleRequestParameter}}{{^useHttpClient}}{{#hasParams}}, {{/hasParams}}extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { + return this.{{nickname}}WithHttpInfo({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -138,20 +159,34 @@ export class {{classname}} { {{#notes}} * {{notes}} {{/notes}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}{{#useHttpClient}}* @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.{{/useHttpClient}} + {{^useSingleRequestParameter}} + {{#allParams}} + * @param {{paramName}} {{description}} + {{/allParams}} + {{/useSingleRequestParameter}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param requestParameters + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{#useHttpClient}} + * @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. + {{/useHttpClient}} */ {{#useHttpClient}} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe?: 'body', reportProgress?: boolean): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe?: 'response', reportProgress?: boolean): Observable>; - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe?: 'events', reportProgress?: boolean): Observable>; - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe: any = 'body', reportProgress: boolean = false ): Observable { + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'events', reportProgress?: boolean): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe: any = 'body', reportProgress: boolean = false ): Observable { {{/useHttpClient}} {{^useHttpClient}} - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: RequestOptionsArgs): Observable { + public {{nickname}}WithHttpInfo({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams?: RequestOptionsArgs): Observable { {{/useHttpClient}} {{#allParams}} +{{#useSingleRequestParameter}} + const {{paramName}} = requestParameters.{{paramName}}; +{{/useSingleRequestParameter}} {{#required}} if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache index fb60c1a394f..9f2f19a8129 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache @@ -22,6 +22,19 @@ import { Configuration } from '../configurat {{#operations}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams { +{{#allParams}} + {{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}}; +{{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} + {{#description}} /** * {{&description}} @@ -34,11 +47,13 @@ export interface {{classname}}Interface { {{#operation}} /** - * {{summary}} - * {{notes}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; + * {{summary}} + * {{notes}} + {{^useSingleRequestParameter}} + {{#allParams}}* @param {{paramName}} {{description}} + {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}* @param requestParameters + {{/allParams.0}}{{/useSingleRequestParameter}}*/ + {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; {{/operation}} } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index b18d05bdace..1797eae8aeb 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -59,6 +59,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(TypeScriptAngularClientCodegen.NPM_VERSION, NMP_VERSION) .put(TypeScriptAngularClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString()) + .put(TypeScriptAngularClientCodegen.USE_SINGLE_REQUEST_PARAMETER, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.PROVIDED_IN_ROOT, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.TAGGED_UNIONS, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 9c9ee52b1e5..df0ef7ccd01 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { @@ -64,6 +65,7 @@ export class PetService { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -80,6 +82,7 @@ export class PetService { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -97,6 +100,7 @@ export class PetService { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -113,6 +117,7 @@ export class PetService { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -129,6 +134,7 @@ export class PetService { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -145,6 +151,7 @@ export class PetService { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -161,6 +168,7 @@ export class PetService { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -179,6 +187,7 @@ export class PetService { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -198,7 +207,6 @@ export class PetService { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -252,7 +260,6 @@ export class PetService { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -298,7 +305,6 @@ export class PetService { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -349,7 +355,6 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -400,7 +405,6 @@ export class PetService { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -441,7 +445,6 @@ export class PetService { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -496,7 +499,6 @@ export class PetService { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -567,7 +569,6 @@ export class PetService { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 2c745639402..9a84a67805e 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { @@ -50,6 +51,7 @@ export class StoreService { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class StoreService { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -81,6 +84,7 @@ export class StoreService { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -97,6 +101,7 @@ export class StoreService { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -115,7 +120,6 @@ export class StoreService { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -149,7 +153,6 @@ export class StoreService { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -187,7 +190,6 @@ export class StoreService { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -223,7 +225,6 @@ export class StoreService { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 9ce463aa829..49f4c7f4732 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { @@ -50,6 +51,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -82,6 +85,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -98,6 +102,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -114,6 +119,7 @@ export class UserService { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -130,6 +136,7 @@ export class UserService { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -147,6 +154,7 @@ export class UserService { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -162,6 +170,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -181,7 +190,6 @@ export class UserService { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -224,7 +232,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -267,7 +274,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -311,7 +317,6 @@ export class UserService { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -345,7 +350,6 @@ export class UserService { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -382,7 +386,6 @@ export class UserService { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -429,7 +432,6 @@ export class UserService { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -462,7 +464,6 @@ export class UserService { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 9c9ee52b1e5..df0ef7ccd01 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { @@ -64,6 +65,7 @@ export class PetService { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -80,6 +82,7 @@ export class PetService { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -97,6 +100,7 @@ export class PetService { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -113,6 +117,7 @@ export class PetService { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -129,6 +134,7 @@ export class PetService { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -145,6 +151,7 @@ export class PetService { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -161,6 +168,7 @@ export class PetService { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -179,6 +187,7 @@ export class PetService { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -198,7 +207,6 @@ export class PetService { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -252,7 +260,6 @@ export class PetService { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -298,7 +305,6 @@ export class PetService { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -349,7 +355,6 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -400,7 +405,6 @@ export class PetService { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -441,7 +445,6 @@ export class PetService { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -496,7 +499,6 @@ export class PetService { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -567,7 +569,6 @@ export class PetService { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 2c745639402..9a84a67805e 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { @@ -50,6 +51,7 @@ export class StoreService { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class StoreService { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -81,6 +84,7 @@ export class StoreService { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -97,6 +101,7 @@ export class StoreService { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -115,7 +120,6 @@ export class StoreService { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -149,7 +153,6 @@ export class StoreService { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -187,7 +190,6 @@ export class StoreService { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -223,7 +225,6 @@ export class StoreService { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 9ce463aa829..49f4c7f4732 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { @@ -50,6 +51,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -82,6 +85,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -98,6 +102,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -114,6 +119,7 @@ export class UserService { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -130,6 +136,7 @@ export class UserService { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -147,6 +154,7 @@ export class UserService { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -162,6 +170,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -181,7 +190,6 @@ export class UserService { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -224,7 +232,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -267,7 +274,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -311,7 +317,6 @@ export class UserService { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -345,7 +350,6 @@ export class UserService { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -382,7 +386,6 @@ export class UserService { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -429,7 +432,6 @@ export class UserService { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -462,7 +464,6 @@ export class UserService { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index c75e5e46ddd..4937a32e7bb 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -24,7 +24,10 @@ import { Pet } from '../model/pet'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { PetServiceInterface } from './pet.serviceInterface'; +import { + PetServiceInterface +} from './pet.serviceInterface'; + @Injectable() @@ -65,6 +68,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -81,6 +85,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -98,6 +103,7 @@ export class PetService implements PetServiceInterface { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -114,6 +120,7 @@ export class PetService implements PetServiceInterface { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -130,6 +137,7 @@ export class PetService implements PetServiceInterface { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -146,6 +154,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -162,6 +171,7 @@ export class PetService implements PetServiceInterface { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -180,6 +190,7 @@ export class PetService implements PetServiceInterface { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -199,7 +210,6 @@ export class PetService implements PetServiceInterface { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -253,7 +263,6 @@ export class PetService implements PetServiceInterface { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -299,7 +308,6 @@ export class PetService implements PetServiceInterface { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -350,7 +358,6 @@ export class PetService implements PetServiceInterface { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -401,7 +408,6 @@ export class PetService implements PetServiceInterface { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -442,7 +448,6 @@ export class PetService implements PetServiceInterface { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -497,7 +502,6 @@ export class PetService implements PetServiceInterface { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -568,7 +572,6 @@ export class PetService implements PetServiceInterface { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts index effb9d16d02..281ca0c65c3 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts @@ -20,70 +20,71 @@ import { Pet } from '../model/pet'; import { Configuration } from '../configuration'; + export interface PetServiceInterface { defaultHeaders: Headers; configuration: Configuration; [others: string]: any; /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - */ + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + */ addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}>; /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey - */ + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + */ deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable<{}>; /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - */ + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: any): Observable>; /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - */ + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + */ findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable>; /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - */ + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + */ getPetById(petId: number, extraHttpRequestParams?: any): Observable; /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - */ + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + */ updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}>; /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + */ updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}>; /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 147e0c8dfd5..744e2a3e9b5 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -23,7 +23,10 @@ import { Order } from '../model/order'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { StoreServiceInterface } from './store.serviceInterface'; +import { + StoreServiceInterface +} from './store.serviceInterface'; + @Injectable() @@ -51,6 +54,7 @@ export class StoreService implements StoreServiceInterface { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -67,6 +71,7 @@ export class StoreService implements StoreServiceInterface { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -82,6 +87,7 @@ export class StoreService implements StoreServiceInterface { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -98,6 +104,7 @@ export class StoreService implements StoreServiceInterface { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -116,7 +123,6 @@ export class StoreService implements StoreServiceInterface { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -150,7 +156,6 @@ export class StoreService implements StoreServiceInterface { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -188,7 +193,6 @@ export class StoreService implements StoreServiceInterface { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -224,7 +228,6 @@ export class StoreService implements StoreServiceInterface { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts index f03e6a2df3a..39296ccb7e1 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts @@ -19,36 +19,37 @@ import { Order } from '../model/order'; import { Configuration } from '../configuration'; + export interface StoreServiceInterface { defaultHeaders: Headers; configuration: Configuration; [others: string]: any; /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - */ + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + */ deleteOrder(orderId: string, extraHttpRequestParams?: any): Observable<{}>; /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - */ + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ getInventory(extraHttpRequestParams?: any): Observable<{ [key: string]: number; }>; /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - */ + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + */ getOrderById(orderId: number, extraHttpRequestParams?: any): Observable; /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - */ + * Place an order for a pet + * + * @param body order placed for purchasing the pet + */ placeOrder(body: Order, extraHttpRequestParams?: any): Observable; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index d9acd360ef3..1b4542f3e8b 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -23,7 +23,10 @@ import { User } from '../model/user'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { UserServiceInterface } from './user.serviceInterface'; +import { + UserServiceInterface +} from './user.serviceInterface'; + @Injectable() @@ -51,6 +54,7 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -67,6 +71,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -83,6 +88,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -99,6 +105,7 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -115,6 +122,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -131,6 +139,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -148,6 +157,7 @@ export class UserService implements UserServiceInterface { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -163,6 +173,7 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -182,7 +193,6 @@ export class UserService implements UserServiceInterface { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -225,7 +235,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -268,7 +277,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -312,7 +320,6 @@ export class UserService implements UserServiceInterface { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -346,7 +353,6 @@ export class UserService implements UserServiceInterface { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -383,7 +389,6 @@ export class UserService implements UserServiceInterface { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -430,7 +435,6 @@ export class UserService implements UserServiceInterface { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -463,7 +467,6 @@ export class UserService implements UserServiceInterface { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts index a067c872bd6..ba857806fba 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts @@ -19,66 +19,67 @@ import { User } from '../model/user'; import { Configuration } from '../configuration'; + export interface UserServiceInterface { defaultHeaders: Headers; configuration: Configuration; [others: string]: any; /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - */ + * Create user + * This can only be done by the logged in user. + * @param body Created user object + */ createUser(body: User, extraHttpRequestParams?: any): Observable<{}>; /** - * Creates list of users with given input array - * - * @param body List of user object - */ + * Creates list of users with given input array + * + * @param body List of user object + */ createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; /** - * Creates list of users with given input array - * - * @param body List of user object - */ + * Creates list of users with given input array + * + * @param body List of user object + */ createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - */ + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + */ deleteUser(username: string, extraHttpRequestParams?: any): Observable<{}>; /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - */ + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + */ getUserByName(username: string, extraHttpRequestParams?: any): Observable; /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - */ + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + */ loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable; /** - * Logs out current logged in user session - * - */ + * Logs out current logged in user session + * + */ logoutUser(extraHttpRequestParams?: any): Observable<{}>; /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - */ + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + */ updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}>; } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 1d5843d4042..7fe1b177c46 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index eb7539d0d52..fc37529edc6 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 0f0a22e8234..b1cb03cc470 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 9c9ee52b1e5..df0ef7ccd01 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { @@ -64,6 +65,7 @@ export class PetService { /** * * @summary Add a new pet to the store + * @param body Pet object that needs to be added to the store */ public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -80,6 +82,7 @@ export class PetService { /** * * @summary Deletes a pet + * @param petId Pet id to delete * @param apiKey */ @@ -97,6 +100,7 @@ export class PetService { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status + * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -113,6 +117,7 @@ export class PetService { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags + * @param tags Tags to filter by */ public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { @@ -129,6 +134,7 @@ export class PetService { /** * Returns a single pet * @summary Find pet by ID + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -145,6 +151,7 @@ export class PetService { /** * * @summary Update an existing pet + * @param body Pet object that needs to be added to the store */ public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -161,6 +168,7 @@ export class PetService { /** * * @summary Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -179,6 +187,7 @@ export class PetService { /** * * @summary uploads an image + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload @@ -198,7 +207,6 @@ export class PetService { /** * Add a new pet to the store * @param body Pet object that needs to be added to the store - */ public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -252,7 +260,6 @@ export class PetService { * Deletes a pet * @param petId Pet id to delete * @param apiKey - */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -298,7 +305,6 @@ export class PetService { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { @@ -349,7 +355,6 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { @@ -400,7 +405,6 @@ export class PetService { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -441,7 +445,6 @@ export class PetService { /** * Update an existing pet * @param body Pet object that needs to be added to the store - */ public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -496,7 +499,6 @@ export class PetService { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { @@ -567,7 +569,6 @@ export class PetService { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 2c745639402..9a84a67805e 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { @@ -50,6 +51,7 @@ export class StoreService { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID + * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class StoreService { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + */ public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) @@ -81,6 +84,7 @@ export class StoreService { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID + * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -97,6 +101,7 @@ export class StoreService { /** * * @summary Place an order for a pet + * @param body order placed for purchasing the pet */ public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -115,7 +120,6 @@ export class StoreService { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -149,7 +153,6 @@ export class StoreService { /** * Returns pet inventories by status * Returns a map of status codes to quantities - */ public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -187,7 +190,6 @@ export class StoreService { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { @@ -223,7 +225,6 @@ export class StoreService { /** * Place an order for a pet * @param body order placed for purchasing the pet - */ public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 9ce463aa829..49f4c7f4732 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { @@ -50,6 +51,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user + * @param body Created user object */ public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -66,6 +68,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -82,6 +85,7 @@ export class UserService { /** * * @summary Creates list of users with given input array + * @param body List of user object */ public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -98,6 +102,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Delete user + * @param username The name that needs to be deleted */ public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { @@ -114,6 +119,7 @@ export class UserService { /** * * @summary Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -130,6 +136,7 @@ export class UserService { /** * * @summary Logs user into the system + * @param username The user name for login * @param password The password for login in clear text */ @@ -147,6 +154,7 @@ export class UserService { /** * * @summary Logs out current logged in user session + */ public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) @@ -162,6 +170,7 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Updated user + * @param username name that need to be deleted * @param body Updated user object */ @@ -181,7 +190,6 @@ export class UserService { * Create user * This can only be done by the logged in user. * @param body Created user object - */ public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -224,7 +232,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -267,7 +274,6 @@ export class UserService { /** * Creates list of users with given input array * @param body List of user object - */ public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { @@ -311,7 +317,6 @@ export class UserService { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -345,7 +350,6 @@ export class UserService { /** * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. - */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -382,7 +386,6 @@ export class UserService { * Logs user into the system * @param username The user name for login * @param password The password for login in clear text - */ public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { @@ -429,7 +432,6 @@ export class UserService { /** * Logs out current logged in user session - */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -462,7 +464,6 @@ export class UserService { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 380838570e9..9e5456808b8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index f1fc543ad0c..b64d961c32c 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 89ca23713a2..8064a6da574 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.gitignore b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION new file mode 100644 index 00000000000..d168f1d8bda --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/README.md b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/README.md new file mode 100644 index 00000000000..ab47bc7e406 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/README.md @@ -0,0 +1,180 @@ +## @openapitools/typescript-angular-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @openapitools/typescript-angular-petstore@1.0.0 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link @openapitools/typescript-angular-petstore +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-angular-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api.module.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api.module.ts new file mode 100644 index 00000000000..8487243a83b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api.module.ts @@ -0,0 +1,37 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [ + PetService, + StoreService, + UserService ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/api.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts new file mode 100644 index 00000000000..4156b6a005e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -0,0 +1,553 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/apiResponse'; +import { Pet } from '../model/pet'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +export interface AddPetRequestParams { + body: Pet; +} + +export interface DeletePetRequestParams { + petId: number; + apiKey?: string; +} + +export interface FindPetsByStatusRequestParams { + status: Array<'available' | 'pending' | 'sold'>; +} + +export interface FindPetsByTagsRequestParams { + tags: Array; +} + +export interface GetPetByIdRequestParams { + petId: number; +} + +export interface UpdatePetRequestParams { + body: Pet; +} + +export interface UpdatePetWithFormRequestParams { + petId: number; + name?: string; + status?: string; +} + +export interface UploadFileRequestParams { + petId: number; + additionalMetadata?: string; + file?: Blob; +} + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + /** + * Add a new pet to the store + * @param requestParameters + * @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. + */ + public addPet(requestParameters: AddPetRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public addPet(requestParameters: AddPetRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public addPet(requestParameters: AddPetRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public addPet(requestParameters: AddPetRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param requestParameters + * @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. + */ + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public deletePet(requestParameters: DeletePetRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + const apiKey = requestParameters.apiKey; + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param requestParameters + * @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. + */ + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const status = requestParameters.status; + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param requestParameters + * @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. + */ + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const tags = requestParameters.tags; + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param requestParameters + * @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. + */ + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public getPetById(requestParameters: GetPetByIdRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { + headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param requestParameters + * @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. + */ + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePet(requestParameters: UpdatePetRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param requestParameters + * @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. + */ + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const name = requestParameters.name; + const status = requestParameters.status; + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + formParams = formParams.append('name', name) as any || formParams; + } + if (status !== undefined) { + formParams = formParams.append('status', status) as any || formParams; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param requestParameters + * @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. + */ + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadFile(requestParameters: UploadFileRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const petId = requestParameters.petId; + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + const additionalMetadata = requestParameters.additionalMetadata; + const file = requestParameters.file; + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + formParams = formParams.append('additionalMetadata', additionalMetadata) as any || formParams; + } + if (file !== undefined) { + formParams = formParams.append('file', file) as any || formParams; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts new file mode 100644 index 00000000000..f5ce3496728 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -0,0 +1,225 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/order'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +export interface DeleteOrderRequestParams { + orderId: string; +} + +export interface GetOrderByIdRequestParams { + orderId: number; +} + +export interface PlaceOrderRequestParams { + body: Order; +} + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param requestParameters + * @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. + */ + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const orderId = requestParameters.orderId; + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @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. + */ + public getInventory(observe?: 'body', reportProgress?: boolean): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { + headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param requestParameters + * @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. + */ + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const orderId = requestParameters.orderId; + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param requestParameters + * @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. + */ + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts new file mode 100644 index 00000000000..00056c76771 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -0,0 +1,425 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/user'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +export interface CreateUserRequestParams { + body: User; +} + +export interface CreateUsersWithArrayInputRequestParams { + body: Array; +} + +export interface CreateUsersWithListInputRequestParams { + body: Array; +} + +export interface DeleteUserRequestParams { + username: string; +} + +export interface GetUserByNameRequestParams { + username: string; +} + +export interface LoginUserRequestParams { + username: string; + password: string; +} + +export interface UpdateUserRequestParams { + username: string; + body: User; +} + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + + /** + * Create user + * This can only be done by the logged in user. + * @param requestParameters + * @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. + */ + public createUser(requestParameters: CreateUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public createUser(requestParameters: CreateUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public createUser(requestParameters: CreateUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public createUser(requestParameters: CreateUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param requestParameters + * @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. + */ + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param requestParameters + * @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. + */ + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param requestParameters + * @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. + */ + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteUser(requestParameters: DeleteUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param requestParameters + * @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. + */ + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param requestParameters + * @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. + */ + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public loginUser(requestParameters: LoginUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + const password = requestParameters.password; + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + queryParameters = queryParameters.set('username', username); + } + if (password !== undefined && password !== null) { + queryParameters = queryParameters.set('password', password); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @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. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param requestParameters + * @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. + */ + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'body', reportProgress?: boolean): Observable; + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; + public updateUser(requestParameters: UpdateUserRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { + const username = requestParameters.username; + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + const body = requestParameters.body; + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts new file mode 100644 index 00000000000..c038bbc9478 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts @@ -0,0 +1,84 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/encoder.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/encoder.ts new file mode 100644 index 00000000000..cbefb4a6dd9 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/encoder.ts @@ -0,0 +1,21 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/git_push.sh b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/index.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/index.ts new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/apiResponse.ts new file mode 100644 index 00000000000..682ba478921 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/category.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/category.ts new file mode 100644 index 00000000000..b988b6827a0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/models.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/order.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/order.ts new file mode 100644 index 00000000000..c8d8a5e55c0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: Date; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/pet.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/pet.ts new file mode 100644 index 00000000000..e0404395f91 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/tag.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/tag.ts new file mode 100644 index 00000000000..b6ff210e8df --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/user.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/user.ts new file mode 100644 index 00000000000..fce51005300 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * 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 + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/ng-package.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/ng-package.json new file mode 100644 index 00000000000..3b17900dc9c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/package.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/package.json new file mode 100644 index 00000000000..4704f50abdc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/package.json @@ -0,0 +1,38 @@ +{ + "name": "@openapitools/typescript-angular-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^8.0.0", + "@angular/common": "^8.0.0", + "@angular/compiler": "^8.0.0", + "core-js": "^2.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.5.0" + }, + "devDependencies": { + "@angular/common": "^8.0.0", + "@angular/compiler": "^8.0.0", + "@angular/compiler-cli": "^8.0.0", + "@angular/core": "^8.0.0", + "@angular/platform-browser": "^8.0.0", + "ng-packagr": "^5.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.5.0", + "tsickle": "^0.35.0", + "typescript": ">=3.4.0 <3.6.0", + "zone.js": "^0.9.1" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/tsconfig.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/tsconfig.json new file mode 100644 index 00000000000..c01ebe255d4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/variables.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 25f4cdfc7f4..dd6227c1ce0 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -24,6 +24,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index 8fba3b49de8..dae6e4e90a6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' }) diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index a9fc0b74c1a..00aa65bec1a 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; + @Injectable({ providedIn: 'root' })