raml-typesystem
Advanced tools
Comparing version 0.0.69 to 0.0.70
@@ -1229,11 +1229,2 @@ "use strict"; | ||
FileTypes.prototype.check = function (i) { | ||
if (!Array.isArray(i)) { | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY, this); | ||
} | ||
for (var _i = 0, i_1 = i; _i < i_1.length; _i++) { | ||
var s = i_1[_i]; | ||
if (typeof (s) != "string") { | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY, this); | ||
} | ||
} | ||
return ts.ok(); | ||
@@ -1256,5 +1247,17 @@ }; | ||
FileTypes.prototype.checkValue = function () { | ||
if (!Array.isArray(this._value)) { | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY, this); | ||
} | ||
for (var _i = 0, _a = this._value; _i < _a.length; _i++) { | ||
var s = _a[_i]; | ||
if (typeof (s) != "string") { | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY, this); | ||
} | ||
} | ||
return ts.ok(); | ||
}; | ||
FileTypes.prototype.toString = function () { | ||
if (!this.checkValue().isOk()) { | ||
return "invalid 'fileTypes' facet value"; | ||
} | ||
return "supported file types: " + this._value.join(", "); | ||
@@ -1261,0 +1264,0 @@ }; |
@@ -309,2 +309,12 @@ /// <reference path="../typings/main.d.ts" /> | ||
tryParseJSON(content, true); | ||
if (this.jsonSchema.id) { | ||
var schemaId = this.jsonSchema.id; | ||
if (schemaId.charAt(schemaId.length - 1) == "#") { | ||
var schemaId1 = schemaId.substring(0, schemaId.length - 1); | ||
alreadyAccepted.push({ | ||
reference: schemaId1, | ||
content: this.jsonSchema | ||
}); | ||
} | ||
} | ||
} | ||
@@ -398,2 +408,12 @@ var exampleObject = JSON.parse(content); | ||
var validator = jsonUtil.getValidator(); | ||
if (alreadyAccepted.length == 0 && this.jsonSchema.id) { | ||
var schemaId = this.jsonSchema.id; | ||
if (schemaId.charAt(schemaId.length - 1) == "#") { | ||
var schemaId1 = schemaId.substring(0, schemaId.length - 1); | ||
alreadyAccepted.push({ | ||
reference: schemaId1, | ||
content: this.jsonSchema | ||
}); | ||
} | ||
} | ||
alreadyAccepted.forEach(function (accepted) { return validator.setRemoteReference(accepted.reference, accepted.content); }); | ||
@@ -400,0 +420,0 @@ try { |
@@ -410,2 +410,3 @@ /// <reference path="../../typings/main.d.ts" /> | ||
isUnion(): boolean; | ||
isObject(): boolean; | ||
restrictions(): OrRestriction[]; | ||
@@ -412,0 +413,0 @@ label(): string; |
@@ -308,3 +308,4 @@ "use strict"; | ||
minLength: 1, | ||
maxLength: 2000 | ||
maxLength: 2000, | ||
example: "some JSON content" | ||
} | ||
@@ -323,2 +324,3 @@ } | ||
fileTypes: ["applicaiton/json"], | ||
example: "some JSON content", | ||
minLength: "1", | ||
@@ -325,0 +327,0 @@ maxLength: 2000 |
{ | ||
"name": "raml-typesystem", | ||
"version": "0.0.69", | ||
"version": "0.0.70", | ||
"main": "dist/src/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1262,10 +1262,2 @@ /// <reference path="../typings/main.d.ts" /> | ||
check(i:any):ts.Status{ | ||
if (!Array.isArray(i)) { | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY,this); | ||
} | ||
for(var s of i){ | ||
if(typeof(s) != "string"){ | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY,this); | ||
} | ||
} | ||
return ts.ok() | ||
@@ -1291,5 +1283,16 @@ } | ||
checkValue():ts.Status{ | ||
if (!Array.isArray(this._value)) { | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY,this); | ||
} | ||
for(var s of this._value){ | ||
if(typeof(s) != "string"){ | ||
return ts.error(messageRegistry.FILE_TYPES_SHOULD_BE_AN_ARRAY,this); | ||
} | ||
} | ||
return ts.ok(); | ||
} | ||
toString(){ | ||
if(!this.checkValue().isOk()){ | ||
return "invalid 'fileTypes' facet value"; | ||
} | ||
return "supported file types: " + this._value.join(", "); | ||
@@ -1296,0 +1299,0 @@ } |
@@ -408,2 +408,12 @@ /// <reference path="../typings/main.d.ts" /> | ||
tryParseJSON(content,true); | ||
if(this.jsonSchema.id){ | ||
let schemaId = this.jsonSchema.id; | ||
if(schemaId.charAt(schemaId.length-1)=="#"){ | ||
let schemaId1 = schemaId.substring(0,schemaId.length-1); | ||
alreadyAccepted.push({ | ||
reference: schemaId1, | ||
content: this.jsonSchema | ||
}); | ||
} | ||
} | ||
} | ||
@@ -521,2 +531,12 @@ | ||
var validator = jsonUtil.getValidator(); | ||
if(alreadyAccepted.length==0&&this.jsonSchema.id){ | ||
let schemaId = this.jsonSchema.id; | ||
if(schemaId.charAt(schemaId.length-1)=="#"){ | ||
let schemaId1 = schemaId.substring(0,schemaId.length-1); | ||
alreadyAccepted.push({ | ||
reference: schemaId1, | ||
content: this.jsonSchema | ||
}); | ||
} | ||
} | ||
@@ -523,0 +543,0 @@ alreadyAccepted.forEach(accepted => validator.setRemoteReference(accepted.reference, accepted.content)); |
@@ -360,3 +360,4 @@ import ps= require("./actualParse") | ||
minLength:1, | ||
maxLength:2000 | ||
maxLength:2000, | ||
example: "some JSON content" | ||
} | ||
@@ -377,2 +378,3 @@ | ||
fileTypes:["applicaiton/json"], | ||
example: "some JSON content", | ||
minLength:"1", | ||
@@ -379,0 +381,0 @@ maxLength:2000 |
@@ -37,3 +37,2 @@ { | ||
"build" : "npm run build", | ||
"gitBranch": "develop", | ||
"gitUrl" : "https://github.com/mulesoft-labs/yaml-ast-parser.git" | ||
@@ -40,0 +39,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2288333
50084