lib/swagger/swagger.js
function (yamlJson) {
		if (typeof yamlJson !== 'object') {
			throw new Error("Yaml file was converted to a string");
		}
		
		if (!yamlJson.paths || Object.keys(yamlJson.paths).length === 0) {
			throw new Error("Yaml file is missing api schema");
		}
		
		//loop in path
		for (var onePath in yamlJson.paths) {
			//loop in methods
			for (var oneMethod in yamlJson.paths[onePath]) {
				if (!yamlJson.paths[onePath][oneMethod].summary || yamlJson.paths[onePath][oneMethod].summary === "") {
					throw new Error("Please enter a summary for API " + oneMethod + ": " + onePath + " you want to build.");
				}
			}
		}
	}
function (yamlJson) {
		if (typeof yamlJson !== 'object') {
			throw new Error("Yaml file was converted to a string");
		}
		
		if (!yamlJson.paths || Object.keys(yamlJson.paths).length === 0) {
			throw new Error("Yaml file is missing api schema");
		}
		
		//loop in path
		for (var onePath in yamlJson.paths) {
			//loop in methods
			for (var oneMethod in yamlJson.paths[onePath]) {
				if (!yamlJson.paths[onePath][oneMethod].summary || yamlJson.paths[onePath][oneMethod].summary === "") {
					throw new Error("Please enter a summary for API " + oneMethod + ": " + onePath + " you want to build.");
				}
			}
		}
	}
function ( yamlJson ) { if ( typeof yamlJson !== 'object' ) { throw new Error ( "Yaml file was converted to a string" ) ; } if ( ! yamlJson . paths || Object . keys ( yamlJson . paths ) . length === 0 ) { throw new Error ( "Yaml file is missing api schema" ) ; } //loop in path for ( var onePath in yamlJson . paths ) { //loop in methods for ( var oneMethod in yamlJson . paths [ onePath ] ) { if ( ! yamlJson . paths [ onePath ] [ oneMethod ] . summary || yamlJson . paths [ onePath ] [ oneMethod ] . summary === "" ) { throw new Error ( "Please enter a summary for API " + oneMethod + ": " + onePath + " you want to build." ) ; } } } }
validate that parsed yaml content has the minimum required fields
@param yamlJson
validate that parsed yaml content has the minimum required fields