function generateGenericInstance(schemaId) {
	// Use the object generator function to generate the instance of the specified schema
	if (schemaId in schemas) { 
		// Only build top-level properties that are required
		thisSchema = schemas[schemaId];
		outputSchema = {};
		for (propName in thisSchema || {}) {
			if (propName == "properties") {
				outputSchema.properties = {};
				for (property in thisSchema.properties || {}) {
					if (thisSchema.properties[property].hasOwnProperty("required") && thisSchema.properties[property].required) {
						outputSchema.properties[property] = thisSchema.properties[property];
					}
				}				
			} else {
				outputSchema[propName] = thisSchema[propName];
			}
		}
		return objectGenerator(outputSchema); 
	} 
	else { return null; }
}
// Create a generic instance of a given schema 
Create a generic instance of a given schema
Create a generic instance of a given schema
function generateGenericInstance(schemaId) {
	if (schemaId in schemas) { 
		thisSchema = schemas[schemaId];
		outputSchema = {};
		for (propName in thisSchema || {}) {
			if (propName == "properties") {
				outputSchema.properties = {};
				for (property in thisSchema.properties || {}) {
					if (thisSchema.properties[property].hasOwnProperty("required") && thisSchema.properties[property].required) {
						outputSchema.properties[property] = thisSchema.properties[property];
					}
				}				
			} else {
				outputSchema[propName] = thisSchema[propName];
			}
		}
		return objectGenerator(outputSchema); 
	} 
	else { return null; }
}
function generateGenericInstance ( schemaId ) { if ( schemaId in schemas ) { thisSchema = schemas [ schemaId ] ; outputSchema = { } ; for ( propName in thisSchema || { } ) { if ( propName == "properties" ) { outputSchema . properties = { } ; for ( property in thisSchema . properties || { } ) { if ( thisSchema . properties [ property ] . hasOwnProperty ( "required" ) && thisSchema . properties [ property ] . required ) { outputSchema . properties [ property ] = thisSchema . properties [ property ] ; } } } else { outputSchema [ propName ] = thisSchema [ propName ] ; } } return objectGenerator ( outputSchema ) ; } else { return null ; } }
Create a generic instance of a given schema
Create a generic instance of a given schema
// Use the object generator function to generate the instance of the specified schema // Only build top-level properties that are required