z0mt3c/node-restify-swagger — pull request #15 by rochal (2014-11-10 03:38:14+00:00)
Title: Swagger spec compatibility features

Added few compatibility fixes:

- Allow setting `header` data type. This comes useful when your API requires authtoken to be passed in the request header. usage:

```
validation: {
token: { isRequired: true, type: 'string', scope: 'header' }
},
```

- Add support for arrays of models. This is especially useful if you POST or PUT complex data types:

```
validation: {
books: { isRequired: true, type: 'array', swaggerType: 'Book', scope: 'body'
},
models: {
Book: {
id: 'Boook',
properties: {
name: { type: 'string' },
code: { type: 'integer' },
}
}
}
```
then your POST/PUT payloads can look like this:
```
{
"books": [{ "name": "The Hobbit", "code": 1 }, { "name": "Lord of The Rings", "code": 2 }]
}
```

- do not create duplicate swagger entries for the same routes.
Example:
```
{ url: '/users', version: '1.0.0' }
{ url: '/users', version: '1.2.3' }
```
should not create 2 entries in swagger