Skip to content

Commit

Permalink
Merge ea7a204 into e045433
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefulton committed Jan 3, 2014
2 parents e045433 + ea7a204 commit 795aced
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/index.js
Expand Up @@ -119,8 +119,8 @@ module.exports.loadRestifyRoutes = function () {
var url = spec.url || item.path;
var name = lingo.camelcase(url.replace(/[\/_]/g, ' '));
var method = spec.method;
var swagger = spec.swagger || {};
var mySwaggerPathParts = swagger.docPath || url.split(path.sep)[1];
var specSwagger = spec.swagger || {};
var mySwaggerPathParts = specSwagger.docPath || url.split(path.sep)[1];
var mySwaggerPath = module.exports.swaggerPathPrefix + mySwaggerPathParts;
var models = spec.models || {};

Expand Down Expand Up @@ -200,17 +200,17 @@ module.exports.loadRestifyRoutes = function () {
paramType: 'body'
});
}
swaggerDoc[method.toLowerCase()](convertToSwagger(url), swagger.summary, {
notes: swagger.notes || null,
nickname: swagger.nickname || name,
responseClass: swagger.responseClass || undefined,
produces: swagger.produces || [
swaggerDoc[method.toLowerCase()](convertToSwagger(url), specSwagger.summary, {
notes: specSwagger.notes || null,
nickname: specSwagger.nickname || name,
responseClass: specSwagger.responseClass || undefined,
produces: specSwagger.produces || swagger.produces || [
'application/json'
],
consumes: swagger.consumes || [
consumes: specSwagger.consumes || swagger.consumes || [
'application/json'
],
responseMessages: swagger.responseMessages || [
responseMessages: specSwagger.responseMessages || swagger.responseMessages || [
{
code: 500,
message: 'Internal Server Error'
Expand Down
1 change: 1 addition & 0 deletions lib/swagger-doc.js
Expand Up @@ -93,6 +93,7 @@ swagger.configure = function(server, options) {
this.apiVersion = options.version || this.server.versions || '1.0.0';
this.basePath = options.basePath;
this.info = options.info;
this.responseMessages = options.responseMessages;

this.server.get(discoveryUrl, function(req, res) {
var result = self._createResponse(req);
Expand Down

0 comments on commit 795aced

Please sign in to comment.