Validate configuration for a single property
333520
function validatePropertyConfig(property) {  
  /** If name is missing or not a string, throw error */
  if ( typeof property.name !== 'string' )
    throw new Error(`ezobjects.validatePropertyConfig(): Property configured with missing or invalid 'name'.`);

  /** If type is missing or not a string, throw error */
  if ( typeof property.type !== 'string' && typeof property.instanceOf !== 'string' )
    throw new Error(`ezobjects.validatePropertyConfig(): Property '${property.name}' configured with missing or invalid 'type' and/or 'instanceOf', one of them is required.`);
  
  /** If the original type has not yet been recorded */
  if ( property.type && typeof property.originalType !== 'string' ) {
    /** Store original type with preserved case */
    property.originalType = property.type;
    
    /** Convert type to lower-case for comparison to ezobjectsTypes */
    property.type = property.type.toLowerCase();
  }
  
  /** Attach arrayOf 'ezobjectType' if property type is 'array' */
  if ( property.type == 'array' ) {
    /** If type is 'ARRAY' with no 'arrayOf', throw error */
    if ( typeof property.arrayOf !== 'object' || property.arrayOf.constructor.name != 'Object' )
      throw new Error(`ezobjects.validatePropertyConfig(): Property '${property.name}' of type ${property.type} with missing or invalid 'arrayOf'.`);

    /** If type is 'ARRAY' with 'arrayOf' containing bad or missing type, throw error */
    if ( typeof property.arrayOf.type != 'string' && typeof property.arrayOf.instanceOf != 'string' )
      throw new Error(`ezobjects.validatePropertyConfig(): Property '${property.name}' of type ${property.type} with missing or invalid 'arrayOf.type' and/or 'arrayOf.instanceOf', one of them is required.`);

    /** If it's a standard EZ Object type, attach 'ezobjectType' to property for later use */
    property.ezobjectType = ezobjectTypes.find(x => x.type == property.type && x.arrayOfType == property.arrayOf.type );

    /** If no standard type was found, use 'other' type for other objects */
    if ( !property.ezobjectType )
      property.ezobjectType = ezobjectTypes.find(x => x.type == 'array' && x.arrayOfType == 'other' );
    
    /** If it's a standard EZ Object type, attach 'ezobjectType' to property arrayOf type for later use */
    property.arrayOf.ezobjectType = ezobjectTypes.find(x => x.type == property.arrayOf.type);

    /** If no standard type was found, use 'other' type for other objects */
    if ( !property.arrayOf.ezobjectType )
      property.arrayOf.ezobjectType = ezobjectTypes.find(x => x.type == 'other');
    
    /** Fully determine whether to allow nulls for this property */
    if ( typeof property.arrayOf.allowNull !== `boolean` && property.arrayOf.ezobjectType.type != 'other' )
      property.arrayOf.allowNull = false;
    else if ( typeof property.arrayOf.allowNull !== `boolean` )
      property.arrayOf.allowNull = true;
  } else {
    /** If it's a standard EZ Object type, attach 'ezobjectType' to property for later use */
    property.ezobjectType = ezobjectTypes.find(x => x.type == property.type);

    /** If no standard type was found, use 'other' type for other objects */
    if ( !property.ezobjectType )
      property.ezobjectType = ezobjectTypes.find(x => x.type == 'other');
  }
  
  /** Create default transform function that doesn't change the input */
  const defaultTransform = x => x;
  
  /** If there is no setter transform, set to default */
  if ( typeof property.setTransform !== `function` )
    property.setTransform = typeof property.ezobjectType == 'object' && typeof property.ezobjectType.setTransform == 'function' ? property.ezobjectType.setTransform : defaultTransform;

  /** If there is no save transform, set to default */
  if ( typeof property.saveTransform !== `function` )
    property.saveTransform = typeof property.ezobjectType == 'object' && typeof property.ezobjectType.saveTransform == 'function' ? property.ezobjectType.saveTransform : defaultTransform;

  /** If there is no load transform, set to default */
  if ( typeof property.loadTransform !== `function` )
    property.loadTransform = typeof property.ezobjectType == 'object' && typeof property.ezobjectType.loadTransform == 'function' ? property.ezobjectType.loadTransform : defaultTransform;
      
  /** Fully determine whether to allow nulls for this property */
  if ( typeof property.allowNull !== `boolean` && property.ezobjectType.type != 'other' )
    property.allowNull = false;
  else if ( typeof property.allowNull !== `boolean` )
    property.allowNull = true;
}
42434
function validateConfig(config, parentPath) {
    if (parentPath === void 0) { parentPath = ''; }
    // forEach doesn't iterate undefined values
    for (var /** @type {?} */ i = 0; i < config.length; i++) {
        var /** @type {?} */ route = config[i];
        var /** @type {?} */ fullPath = getFullPath(parentPath, route);
        validateNode(route, fullPath);
    }
}
819673
def validate(self, data):
        '''
        
        '''
        for prop in self.properties:
            if prop.id in data:
                if prop.type == 'string':
                    if not isinstance(data[prop.id], basestring):
                        raise PresetFieldTypeException("property '{}' must be of type string".format(prop.id))
                elif prop.type == 'enum':
                    if not isinstance(data[prop.id], basestring):
                        raise PresetFieldTypeException("property '{}' must be of type string".format(prop.id))
                    if data[prop.id] not in prop.values:
                        raise PresetException("property '{}' can be one of {}".format(prop.id, prop.values))
            else:
                if prop.required:
                    raise PresetMissingFieldException("missing required property: '{}'".format(prop.id))
885126
def validate_prop(value):
    """"""
    if (
            isinstance(value, CLASS_TYPES) and
            issubclass(value, HasProperties)
    ):
        value = Instance('', value)
    if not isinstance(value, basic.Property):
        raise TypeError('Contained prop must be a Property instance or '
                        'HasProperties class')
    if value.default is not utils.undefined:
        warn('Contained prop default ignored: {}'.format(value.default),
             RuntimeWarning)
    return value
921460
function validateProperties(object, name, required, optional) {
    // validates object properties exist or not
    var properties = _.keys(object);
    var missing = _.difference(required, properties);
    var extra = _.difference(properties, required, optional);
    var errorOrNull = null;
    if (missing.length) {
        errorOrNull = new VError("%s is missing required properties (%j)",
                               name, missing);
        errorOrNull.missing = missing;
        errorOrNull.required = required;
        errorOrNull.object = object;
    } else if (extra.length) {
        errorOrNull = new VError("%s has extra (unexpected) properties (%j)",
                               name, extra);
        errorOrNull.extra = extra;
        errorOrNull.required = required;
        errorOrNull.optional = optional;
        errorOrNull.object = object;
    }
    return errorOrNull;
}
596823
function validateConfigSchema(config, source = null) {
    validateSchema = validateSchema || ajv.compile(configSchema);

    if (!validateSchema(config)) {
        throw new Error(`ESLint configuration in ${source} is invalid:\n${formatErrors(validateSchema.errors)}`);
    }

    if (Object.hasOwnProperty.call(config, "ecmaFeatures")) {
        emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
    }
}
803497
def validate(config):
    '''
    
    '''
    # Must be a list of dicts.
    if not isinstance(config, list):
        return False, 'Configuration for napalm beacon must be a list.'
    for mod in config:
        fun = mod.keys()[0]
        fun_cfg = mod.values()[0]
        if not isinstance(fun_cfg, dict):
            return False, 'The match structure for the {} execution function output must be a dictionary'.format(fun)
        if fun not in __salt__:
            return False, 'Execution function {} is not availabe!'.format(fun)
    return True, 'Valid configuration for the napal beacon!'
279368
function validateConfig(config) {
    // appId and versionId are not validated here since
    // not all operations require these to be present.
    // Validation of specific params are done in the
    // ServiceBase.js
    const { authoringKey, region } = config;
    const messageTail = `is missing from the configuration.\n\nDid you run ${chalk.cyan.bold('luis init')} yet?`;

    assert(typeof authoringKey === 'string', `The authoringKey  ${messageTail}`);
    assert(typeof region === 'string', `The region ${messageTail}`);
    assert(args.region == 'westus' || args.region == 'westeurope' || args.region == 'australiaeast' || args.region == 'virginia', `${args.region} is not a valid authoring region.  Valid values are [westus|westeurope|australiaeast|virginia]`);
}
530307
def validate(config):
    """"""
    with open(config) as fh:
        data = utils.yaml_load(fh.read())
        jsonschema.validate(data, CONFIG_SCHEMA)
1019351
def validate(config):
    """"""
    with open(config) as fh:
        content = fh.read()

    try:
        data = yaml.safe_load(content)
    except Exception:
        log.error("config file: %s is not valid yaml", config)
        raise

    try:
        jsonschema.validate(data, CONFIG_SCHEMA)
    except Exception:
        log.error("config file: %s is not valid", config)
        raise

    log.info("config file valid, accounts:%d", len(data['accounts']))
    return data
320208
def _validate_allowed_settings(self, application_id, application_config, allowed_settings):
		""""""

		for setting_key in application_config.keys():
			if setting_key not in allowed_settings:
				raise ImproperlyConfigured(
					"Platform {}, app {} does not support the setting: {}.".format(
						application_config["PLATFORM"], application_id, setting_key
					)
				)
788639
function validatePropertyKey(name, element, parentType) {
  if (!NUMERIC_PROPERTY_REGEX.test(name)) {
    return;
  }
  warnAndMonitorForKeyUse(
    'Child objects should have non-numeric keys so ordering is preserved.',
    element,
    parentType
  );
}
252914
def validate(config):
    '''
    
    '''
    if not isinstance(config, list):
        return False, ('Configuration for network_settings '
                       'beacon must be a list.')
    else:
        _config = {}
        list(map(_config.update, config))

        interfaces = _config.get('interfaces', {})
        if isinstance(interfaces, list):
            #Old syntax
            return False, ('interfaces section for network_settings beacon'
                           ' must be a dictionary.')

        for item in interfaces:
            if not isinstance(_config['interfaces'][item], dict):
                return False, ('Interface attributes for network_settings beacon'
                               ' must be a dictionary.')
            if not all(j in ATTRS for j in _config['interfaces'][item]):
                return False, ('Invalid attributes in beacon configuration.')
    return True, 'Valid beacon configuration'
222573
@Override
    public void validate() throws ConfigurationException {
        if (host == null || host.length() == 0) {
            this.host = "localhost";
        }
        if (port == null || port.length() == 0) {
            this.port = "12345";
        }
    }
576399
public void validate(String path, Schema schema, Object value, List<ValidationResult> results) {
		String name = path != null ? path : "value";
		List<String> found = new ArrayList<String>();

		for (String property : _properties) {
			Object propertyValue = ObjectReader.getProperty(value, property);
			if (propertyValue != null)
				found.add(property);
		}

		if (found.size() == 0) {
			results.add(new ValidationResult(path, ValidationResultType.Error, "VALUE_NULL",
					name + " must have at least one property from " + _properties, _properties, null));
		}
	}
823274
def _validate_config(self, config):
        
        required_keys = [
            self.KEY_IDP_CONFIG,
            self.KEY_ENDPOINTS,
        ]

        if not config:
            raise ValueError("No configuration given")

        for key in required_keys:
            try:
                _val = config[key]
            except KeyError as e:
                raise ValueError("Missing configuration key: %s" % key) from e
1292750
static <T> void validateTenantConfigurationDataType(final TenantConfigurationKey configurationKey,
            final Class<T> propertyType) {

        if (!configurationKey.getDataType().isAssignableFrom(propertyType)) {
            throw new TenantConfigurationValidatorException(
                    String.format("Cannot parse the database value of type %s into the type %s.",
                            configurationKey.getDataType(), propertyType));
        }
    }