swagger-tools
Advanced tools
Comparing version 0.1.2 to 0.1.3
17
index.js
@@ -54,2 +54,3 @@ /* | ||
var docsUrl; | ||
var primitives; | ||
var schemasUrl; | ||
@@ -62,2 +63,14 @@ | ||
docsUrl = 'https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md'; | ||
// Manually maintained list due to the related JSON Schema files not being complete or used | ||
primitives = [ | ||
'integer', | ||
'long', | ||
'float', | ||
'double', | ||
'string', | ||
'byte', | ||
'boolean', | ||
'date', | ||
'dateTime' | ||
]; | ||
schemasUrl = 'https://github.com/wordnik/swagger-spec/tree/master/schemas/v1.2'; | ||
@@ -72,2 +85,3 @@ | ||
this.options = options; | ||
this.primitives = primitives; | ||
this.schemasUrl = schemasUrl; | ||
@@ -170,4 +184,3 @@ this.version = version; | ||
var modelRefs = {}; | ||
var primitives = _.union(spec.schemas['dataType.json'].definitions.primitiveType.properties.type.enum, | ||
['array', 'void', 'File']); | ||
var primitives = _.union(spec.primitives, ['array', 'void', 'File']); | ||
var addModelRef = function (modelId, modelRef) { | ||
@@ -174,0 +187,0 @@ if (Object.keys(modelRefs).indexOf(modelId) === -1) { |
{ | ||
"name": "swagger-tools", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Various tools for using and integrating with Swagger.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -54,3 +54,3 @@ /* global describe, it */ | ||
describe('metadata', function () { | ||
it('should have proper docsUrl, options, schemasUrl and verison properties', function () { | ||
it('should have proper docsUrl, primitives, options, schemasUrl and verison properties', function () { | ||
assert.deepEqual(spec.options, { | ||
@@ -65,2 +65,13 @@ validator: { | ||
assert.strictEqual(spec.docsUrl, 'https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md'); | ||
assert.deepEqual(spec.primitives, [ | ||
'integer', | ||
'long', | ||
'float', | ||
'double', | ||
'string', | ||
'byte', | ||
'boolean', | ||
'date', | ||
'dateTime' | ||
]); | ||
assert.strictEqual(spec.schemasUrl, 'https://github.com/wordnik/swagger-spec/tree/master/schemas/v1.2'); | ||
@@ -67,0 +78,0 @@ assert.strictEqual(spec.version, '1.2'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80907
2158