You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This implementation should be replaced with a more accurate one ;-)
See the following example of an older version of the editor:
functionvalidate(uri,type,json,cb){if(json.$schema==="http://json-schema.org/draft-04/schema#"){cb("ok","I don't validate schemas");return;}console.log(json)functiondoValidate(base,segments){$.get(base).done(function(data){segments=segments[0]==="" ? segments.splice(1) : segments;if(segments.length===0){if(data.$schema&&data.$schema==="http://json-schema.org/draft-04/schema#"){varresult=tv4.validateMultiple(json,data)if(result.valid){cb("ok","Great, this JSON is valid against schema <a target='_blank' href='/demo/server/pages/editor.html#"+base+"'>"+base+"</a>");}else{cb("error","Oops, this JSON is not valid");$.each(result.errors,function(k,error){cb("error","<b>"+error.message+"</b> at "+error.dataPath+"<br>Schema path: "+error.schemaPath);});cb("error","Using schema: <a target='_blank' href='/demo/server/pages/editor.html#"+base+"'>"+base+"</a>");}}else{cb("warn","No schema for "+uri+" ("+type+")");}}else{varnewBase=base;varlist=data[base.replace(/\/$/,"").split("/").splice(-1)[0]]+"/";if(list){if(list.indexOf(segments[0]+"/")>-1){newBase+=segments[0]+"/";doValidate(newBase,segments.splice(1));}elseif(list.indexOf("_/")>-1){newBase+="_/";doValidate(newBase,segments.splice(1));}else{cb("warn","No schema for "+uri+" ("+type+")");}}else{cb("warn","No schema for "+uri+" ("+type+")");}}}).fail(function(xhr,status){cb("warn","Could not get path "+base);});}doValidate("/demo/schemas/apis/",(uri.replace(/^\//,"")+"/"+type).split("/"));}
The text was updated successfully, but these errors were encountered:
The current implementation of the editor contains an a json validation which always returns true:
This implementation should be replaced with a more accurate one ;-)
See the following example of an older version of the editor:
The text was updated successfully, but these errors were encountered: