1.0.0 • Published 7 years ago

swangular-components v1.0.0

Weekly downloads
4
License
Unlicense
Repository
github
Last release
7 years ago

swangular-components alt text

swangular-components is a component library for angular 2.0.0 to render swagger 2.0 documentation.

TODO

  • Create CI pipeline using Travis CI
  • Create base module
  • Fix for npm link
  • Add Output to api-swagger for debug purposes on swagger updates
  • Add more validation than just required
  • Finish request builder
  • Add support for security property in swagger 2.0
  • Make scheme selectable for the request if there are more than one
  • Clean up auth service. It's not pretty.
  • Show enumerations of enums.
  • Add support for arrays in dynamic forms
  • Add unit tests
  • Refactor into better components
  • Document more components and have more in depth documentation

Usage

npm install swangular-components --save

Requirements

  • typescript 2.4+
    • for string enums
  • angular/cli 1.3+
    • The way older version build with external modules fails with lower versions

Import in NgModule

  import { NgModule }       from '@angular/core';
  import { BrowserModule  } from '@angular/platform-browser';
  import { AppComponent }   from './components/app.component';

  import { FormsModule } from '@angular/forms';
  import { HttpModule } from '@angular/http';

  import { SwangularComponentsModule } from 'swangular-components';

  @NgModule({
      declarations: [
        AppComponent
      ],
      imports:      [
        BrowserModule,
        HttpModule,
        FormsModule,
        SwangularComponentsModule.forRoot()
      ],
      bootstrap:    [AppComponent]
  })
  export class AppModule {}

Components

error-panel

error-panel is an optional component that can show errors

<error-panel></error-panel>

api-swagger

api-swagger is the root of the tree. If you use this element, it basically injects a whole swagger page.

<api-swagger url="http://a-valid-swagger/endpoint"></api-swagger>

api-method

api-method is for showing what a url-verb combo does, i.e GET - /values

<api-method [operation]="operationObject" [swagger]="swagger" verb="get" urlTemplate="/values/{id}"></api-method>

api-model

api-model is for showing the schema and example of a request or response model

<api-model [schema]="schemaObject" [swagger]="swagger"></api-swagger>

Providers

There are a couple of injectable providers that can be used.

SwaggerService

SwaggerService should be used to make a request to a swagger 2.0 endpoint.

ErrorService

Any errors reported into this service get put into the error panel.

ApiKeyService

Provide an api key to be used to call services that require an api key. This api key will also be used as the clientId for OAuth2 requests.

OAuthService

Provide an api key to be used to call services that require an api key. This api key will also be used as the clientId for OAuth2 requests.

1.0.0

7 years ago

1.0.0-RC7

7 years ago

1.0.0-RC6

7 years ago

1.0.0-RC5

7 years ago

1.0.0-RC4

7 years ago

1.0.0-RC3

7 years ago

1.0.0-RC2

7 years ago

1.0.0-RC1

7 years ago

0.3.3

7 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago