function validateSchema( schema ) {
	var section;
	var keys;
	var obj;
	var i;

	keys = objectKeys( schema );
	for ( i = 0; i < keys.length; i++ ) {
		section = keys[ i ];
		obj = schema[ section ];
		if ( !isPlainObject( obj ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an object containing properties having values which are objects. Option: `%s`.', 'schema', JSON.stringify( obj ) ) );
		}
		if ( hasOwnProp( obj, 'required' ) ) {
			if ( !isStringArray( obj.required ) && !isEmptyArray( obj.required ) ) { // eslint-disable-line max-len
				return new TypeError( format( 'invalid option. `%s` option must be an object having %s `%s` property which is an array of strings. Option: `%s`.', 'schema', 'a', section+'.required', JSON.stringify( obj ) ) );
			}
		} else {
			return new TypeError( format( 'invalid option. `%s` option must be an object having %s `%s` property which is an array of strings. Option: `%s`.', 'schema', 'a', section+'.required', JSON.stringify( obj ) ) );
		}
		if ( hasOwnProp( obj, 'optional' ) ) {
			if ( !isStringArray( obj.optional ) && !isEmptyArray( obj.optional ) ) { // eslint-disable-line max-len
				return new TypeError( format( 'invalid option. `%s` option must be an object having %s `%s` property which is an array of strings. Option: `%s`.', 'schema', 'a', section+'.optional', JSON.stringify( obj ) ) );
			}
		} else {
			return new TypeError( format( 'invalid option. `%s` option must be an object having %s `%s` property which is an array of strings. Option: `%s`.', 'schema', 'a', section+'.optional', JSON.stringify( obj ) ) );
		}
	}
	return null;
}
Validates a schema object.

@private
@param {Object} schema - schema object
@returns {(Error|null)} null or an error object