From 49ed68930e6bde5d7164274a455ea5c794822c2d Mon Sep 17 00:00:00 2001 From: Ben Meyrick Date: Thu, 10 Oct 2024 15:56:53 +0100 Subject: [PATCH 1/3] Improve typescript-angular README.mustache - Add syntax highlighting to code blocks - Correct heading levels --- .../typescript-angular/README.mustache | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache index 96a302fd0f9b..5afb33f0d4f7 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache @@ -1,34 +1,35 @@ -## {{npmName}}@{{npmVersion}} +# {{npmName}}@{{npmVersion}} {{{appDescription}}} {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install {{npmName}}@{{npmVersion}} --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,12 +38,14 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link {{npmName}} ``` @@ -50,13 +53,11 @@ __Note for Windows users:__ The Angular CLI has troubles to use linked npm packa 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 +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { {{apiModuleClassName}} } from '{{npmName}}'; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { {{apiModuleClassName}}, {{configurationClassName}}, {{configurationParametersInterfaceName}} } from '{{npmName}}'; @@ -95,7 +96,7 @@ export function apiConfigFactory (): {{configurationClassName}} { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { {{apiModuleClassName}}, {{configurationClassName}} } from '{{npmName}}'; @@ -120,7 +121,7 @@ import { {{apiModuleClassName}}, {{configurationClassName}} } from '{{npmName}}' export class AppModule {} ``` -``` +```typescript import { DefaultApi } from '{{npmName}}'; export class AppComponent { @@ -131,11 +132,12 @@ export class AppComponent { Note: The {{apiModuleClassName}} is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons. -#### Using multiple OpenAPI files / APIs / {{apiModuleClassName}}s +### Using multiple OpenAPI files / APIs / {{apiModuleClassName}}s In order to use multiple `{{apiModuleClassName}}s` generated from different OpenAPI files, you can create an alias name when importing the modules in order to avoid naming conflicts: -``` + +```typescript import { {{apiModuleClassName}} } from 'my-api-path'; import { {{apiModuleClassName}} as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +156,21 @@ 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. -``` +```typescript import { BASE_PATH } from '{{npmName}}'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from '{{npmName}}'; @NgModule({ @@ -179,11 +182,11 @@ import { BASE_PATH } from '{{npmName}}'; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +194,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from '{{npmName}}'; import { environment } from '../environments/environment'; @@ -219,6 +223,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), From 90a0f7b50268f8d29cacb688b8b458d91b15cb99 Mon Sep 17 00:00:00 2001 From: Ben Meyrick Date: Thu, 10 Oct 2024 16:31:22 +0100 Subject: [PATCH 2/3] Add space between heading and convert bare url to angle brackets link --- .../src/main/resources/typescript-angular/README.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache index 5afb33f0d4f7..66f0c21629de 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/README.mustache @@ -50,7 +50,7 @@ npm link {{npmName}} ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. ### General usage @@ -133,6 +133,7 @@ Note: The {{apiModuleClassName}} is restricted to being instantiated once app wi This is to ensure that all services are treated as singletons. ### Using multiple OpenAPI files / APIs / {{apiModuleClassName}}s + In order to use multiple `{{apiModuleClassName}}s` generated from different OpenAPI files, you can create an alias name when importing the modules in order to avoid naming conflicts: From f8c2700dca4d418597ed50b18e73e0460a96e148 Mon Sep 17 00:00:00 2001 From: Ben Meyrick Date: Thu, 10 Oct 2024 16:34:26 +0100 Subject: [PATCH 3/3] Update samples --- .../composed-schemas-tagged-unions/README.md | 58 ++++++++++--------- .../builds/composed-schemas/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/with-npm/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/with-npm/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- .../builds/default/README.md | 58 ++++++++++--------- 16 files changed, 512 insertions(+), 416 deletions(-) diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/README.md b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/README.md index afb5432d9042..459f049d0d86 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/README.md +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/README.md @@ -1,34 +1,35 @@ -## @ +# @ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1.0.0 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/README.md b/samples/client/others/typescript-angular/builds/composed-schemas/README.md index afb5432d9042..459f049d0d86 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/README.md +++ b/samples/client/others/typescript-angular/builds/composed-schemas/README.md @@ -1,34 +1,35 @@ -## @ +# @ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1.0.0 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/README.md b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/README.md index c9f878935eaf..7eca7931bc24 100644 --- a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 0.0.1 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/README.md b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md index d45e75b5ae62..3fb46b154060 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md @@ -1,34 +1,35 @@ -## @openapitools/typescript-angular-petstore@1.0.0 +# @openapitools/typescript-angular-petstore@1.0.0 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @openapitools/typescript-angular-petstore@1.0.0 --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console 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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from '@openapitools/typescript-angular-petstore'; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from '@openapitools/typescript-angular-petst export class AppModule {} ``` -``` +```typescript import { DefaultApi } from '@openapitools/typescript-angular-petstore'; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/README.md b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/README.md index c9f878935eaf..7eca7931bc24 100644 --- a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 0.0.1 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/README.md b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md index d45e75b5ae62..3fb46b154060 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md @@ -1,34 +1,35 @@ -## @openapitools/typescript-angular-petstore@1.0.0 +# @openapitools/typescript-angular-petstore@1.0.0 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @openapitools/typescript-angular-petstore@1.0.0 --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console 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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from '@openapitools/typescript-angular-petstore'; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from '@openapitools/typescript-angular-petst export class AppModule {} ``` -``` +```typescript import { DefaultApi } from '@openapitools/typescript-angular-petstore'; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/README.md b/samples/client/petstore/typescript-angular-v14-query-param-object-format/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/README.md +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md index 04eb035e5680..6653fc45df74 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md @@ -1,34 +1,35 @@ -## @ +# @ 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 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @ --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,26 +38,26 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link ``` __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. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: - -``` +```typescript // without configuring providers import { ApiModule } from ''; import { HttpClientModule } from '@angular/common/http'; @@ -75,7 +76,7 @@ import { HttpClientModule } from '@angular/common/http'; export class AppModule {} ``` -``` +```typescript // configuring providers import { ApiModule, Configuration, ConfigurationParameters } from ''; @@ -95,7 +96,7 @@ export function apiConfigFactory (): Configuration { export class AppModule {} ``` -``` +```typescript // configuring providers with an authentication service that manages your access tokens import { ApiModule, Configuration } from ''; @@ -120,7 +121,7 @@ import { ApiModule, Configuration } from ''; export class AppModule {} ``` -``` +```typescript import { DefaultApi } from ''; export class AppComponent { @@ -131,11 +132,13 @@ export class AppComponent { 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 +### 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: -``` + +```typescript import { ApiModule } from 'my-api-path'; import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; @@ -154,20 +157,21 @@ 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. -``` +```typescript import { BASE_PATH } from ''; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); ``` + or -``` +```typescript import { BASE_PATH } from ''; @NgModule({ @@ -179,11 +183,11 @@ import { BASE_PATH } from ''; export class AppModule {} ``` +### Using @angular/cli -#### Using @angular/cli First extend your `src/environments/*.ts` files by adding the corresponding base path: -``` +```typescript export const environment = { production: false, API_BASE_PATH: 'http://127.0.0.1:8080' @@ -191,7 +195,8 @@ export const environment = { ``` In the src/app/app.module.ts: -``` + +```typescript import { BASE_PATH } from ''; import { environment } from '../environments/environment'; @@ -219,6 +224,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param),