Nodular Pudding Multiverse

    @4geit/ngx-swagger-client-service

    1.5.3 • Public • Published

    @4geit/ngx-swagger-client-service npm version


    Swagger client service for angular using the swagger-client package.

    Installation

    1. A recommended way to install @4geit/ngx-swagger-client-service is through npm package manager using the following command:
    npm i @4geit/ngx-swagger-client-service --save

    Or use yarn using the following command:

    yarn add @4geit/ngx-swagger-client-service
    1. You need to import the NgxSwaggerClientService service in the module you want to use it. For instance app.module.ts as follows:
    import { NgxSwaggerClientService, API_URL } from '@4geit/ngx-swagger-client-service';

    And you also need to add the NgxSwaggerClientService service within the @NgModule decorator as part of the providers list as well as setting the API_URL variable, it requires the URL of the API that exposes the swagger content. This URL is suffixed by /swagger and therefore if your URL is for instance http://localhost:10010/v1, the URL that will be used to fetch the swagger content will be http://localhost:10010/v1/swagger

    @NgModule({
      // ...
      providers: [
        // ...
        NgxSwaggerClientService,
        { provide: API_URL, useValue: 'http://localhost:10010/v1' },
        // ...
      ],
      // ...
    })
    export class AppModule { }

    Keywords

    none

    Install

    npm i @4geit/ngx-swagger-client-service

    DownloadsWeekly Downloads

    19

    Version

    1.5.3

    License

    MIT

    Last publish

    Collaborators

    • geraldinestarke
    • fabianstarke
    • canercandan