google-discovery-to-swagger
Advanced tools
Comparing version 1.0.3 to 1.1.0
{ | ||
"name": "google-discovery-to-swagger", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Script for converting Google Discovery format into Swagger 2.0", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -41,3 +41,3 @@ 'use strict'; | ||
var swagger = { | ||
var swagger = _.assign({ | ||
swagger: '2.0', | ||
@@ -57,7 +57,6 @@ info: { | ||
schemes: [rootUrl.scheme()], | ||
paths: processResource(data, srGlobalRefParameters), | ||
definitions: processDefinitions(data.schemas), | ||
parameters: srGlobalParameters, | ||
securityDefinitions: processAuth(data.auth) | ||
}; | ||
}, processResource(data, srGlobalRefParameters)); | ||
@@ -162,2 +161,3 @@ if (data.documentationLink) | ||
function processResource(data, srGlobalRefParameters) { | ||
var srTags = []; | ||
var srPaths = processMethodList(data); | ||
@@ -171,2 +171,5 @@ | ||
_.each(srSubPaths, function (srPath) { | ||
if (!_.some(srTags, ['name', name])) | ||
srTags.push({name: name}); | ||
_.each(srPath, function (srOperation) { | ||
@@ -185,3 +188,3 @@ srOperation.tags = [name]; | ||
}); | ||
return srPaths; | ||
return {paths: srPaths, tags: srTags}; | ||
} | ||
@@ -188,0 +191,0 @@ |
18280
325