Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit f429764

Browse files
author
Michael Mrowetz
committed
misc tweaks to the docs
1 parent 5bb2539 commit f429764

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
** NOTE: The following applies to swagger-node apps replying on swagger-node-runner 0.5.x and better. (ie. Any app using swagger-connect 0.1.0, swagger-express-mw 0.1.0, swagger-hapi 0.1.0, swagger-restify 0.1.0, or swagger-sails 0.1.0 - or higher versions of the same.) **
44

5-
Swagger-Node application configuration is driven by the file `default.yaml` (by default) in the application's config directory. Configuration is driven by the [config](https://github.com/lorenwest/node-config/wiki/Configuration-Files) module, so reference its documentation to understand how you may set up configuration per environment and perform configuration overrides. By default, the configuration file looks something like this:
5+
Swagger-Node application configuration is driven by the file `default.yaml` (by default) in the application's `config` directory. Configuration is driven by the [config](https://github.com/lorenwest/node-config/wiki/Configuration-Files) module, so reference its documentation to understand how you may set up configuration per environment and perform configuration overrides. By default, the configuration file looks something like this:
66

77
```yaml
88
# swagger configuration file

docs/controllers.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,15 @@ The Weather API requires a controller function that takes in request and respons
6464

6565
Note that Open Weather returns a JSON object. Also, we'll need to export the controller function so that it is available to the outside world.
6666

67-
We will use the `request` library to make the request. So, add it to `package.json`:
67+
We will use the `request` library to make the request. So, ensure it is installed and added to `package.json`:
6868

69-
```javascript
70-
"dependencies": {
71-
"request": ""
72-
},
69+
```
70+
npm install request --save
7371
```
7472

75-
>Note: If a controller requires additional Node.js modules, be sure to add them to your package.json file and execute `npm install`.
73+
>Note: If a controller requires additional Node.js modules, be sure to add them to your `package.json` file and execute `npm install`.
7674

77-
In the Swagger file, you can see that when a GET is performed on `/weather`, the target controller file is `api/controllers/weather.js`, and the target method to call is getWeatherByCity():
75+
In the Swagger file, you can see that when a GET is performed on `/weather`, the target controller file is `api/controllers/weather.js`, and the target method to call is `getWeatherByCity()`:
7876

7977
```yaml
8078
paths:

docs/mock-mode.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ Here's an example that returns some data whenever the `search()` handler method
248248
}
249249
```
250250

251-
###<a name="wireup"></a>Wiring up and implementing the API controller
251+
### <a name="wireup"></a>Wiring up and implementing the API controller
252252

253253
After you're happy with your API design, you're ready to implement wire up the controller for the `/weather` path.
254254

255-
You simply specify in the OpenAPI spec the route handler (controller) file, which method to call in the controller (operationId), and any query parameters you wish to pass:
255+
You simply specify in the OpenAPI spec the route handler (`x-swagger-router-controller`) file, which method to call in the controller (`operationId`), and any query parameters you wish to pass:
256256

257257
In weather sample's `swagger.yaml` file, it looks like this:
258258

@@ -271,7 +271,7 @@ In weather sample's `swagger.yaml` file, it looks like this:
271271
type: "string"
272272
```
273273

274-
Finally, implement the route's operation -- the getWeatherByCity() method in `api/controllers/weather.js` -- which calls the back-end service and returns the response.
274+
Finally, implement the route's operation -- the `getWeatherByCity()` method in `api/controllers/weather.js` -- which calls the back-end service and returns the response.
275275

276276
Here is the sample controller implementation for a weather API:
277277

0 commit comments

Comments
 (0)