# @4geit/swg-<NAME>-<TYPE> [![npm version](//badge.fury.io/js/@4geit%2Fswg-<NAME>-<TYPE>.svg)](//badge.fury.io/js/@4geit%2Fswg-<NAME>-<TYPE>)

---

<DESCRIPTION>

## Installation

1. A recommended way to install ***@4geit/swg-<NAME>-<TYPE>*** is through [npm](//www.npmjs.com/search?q=@4geit/swg-<NAME>-<TYPE>) package manager using the following command:

```bash
npm i @4geit/swg-<NAME>-<TYPE> --save
```

Or use `yarn` using the following command:

```bash
yarn add @4geit/swg-<NAME>-<TYPE>
```

2. In your swagger file, you need to add a reference to the `<CLASS>` definition under the `paths` property (e.g. `/api/swagger/swagger.yaml`) as below:

```yaml
swagger: "2.0"
# ...
paths:
  /hello:
    x-swagger-router-controller: swg-<NAME>-<TYPE>
    get:
      $ref: ../../node_modules/@4geit/swg-<NAME>-<TYPE>/swagger.yaml#/definitions/<CLASS>
# ...
```

And you will also need to add the path to the `controllers` folder of the `swg-<NAME>-<TYPE>` package so that swagger-node will find the relevant controller to use. Edit the file `/config/default.yaml` and add two new paths to the properties `mockControllersDirs` and `controllersDirs` as illustrated below:

```yaml
swagger:
  # ...
  bagpipes:
    _router:
      # ...
      mockControllersDirs:
        # ...
        - node_modules/@4geit/swg-<NAME>-<TYPE>/mocks
        # ...
      controllersDirs:
        # ...
        - node_modules/@4geit/swg-<NAME>-<TYPE>/controllers
        # ...
```
