Validates those fields that can be used when either building
    a new version (of a local, project-based workflow) or updating
    an existing version (of a global workflow).
439520
def _get_validated_json_for_build_or_update(json_spec, args):
    
    validated = copy.deepcopy(json_spec)

    dxpy.executable_builder.inline_documentation_files(validated, args.src_dir)

    if 'title' not in json_spec:
        logger.warn("dxworkflow.json is missing a title, please add one in the 'title' field")

    if 'summary' not in json_spec:
        logger.warn("dxworkflow.json is missing a summary, please add one in the 'summary' field")
    else:
        if json_spec['summary'].endswith('.'):
            logger.warn("summary {} should be a short phrase not ending in a period".format(json_spec['summary'],))

    return validated
1119004
public static void validateUpdate(FieldMapping oldFieldMapping, FieldMapping newFieldMapping)
            throws TypeUpdateException {
        Map<String, AttributeInfo> newFields = newFieldMapping.fields;
        for (AttributeInfo attribute : oldFieldMapping.fields.values()) {
            if (newFields.containsKey(attribute.name)) {
                AttributeInfo newAttribute = newFields.get(attribute.name);
                //If old attribute is also in new definition, only allowed change is multiplicity change from REQUIRED to OPTIONAL
                if (!newAttribute.equals(attribute)) {
                    if (attribute.multiplicity == Multiplicity.REQUIRED
                            && newAttribute.multiplicity == Multiplicity.OPTIONAL) {
                        continue;
                    } else {
                        throw new TypeUpdateException("Attribute " + attribute.name + " can't be updated");
                    }
                }

            } else {
                //If old attribute is missing in new definition, return false as attributes can't be deleted
                throw new TypeUpdateException("Old Attribute " + attribute.name + " is missing");
            }
        }

        //Only new attributes
        Set<String> newAttributes = new HashSet<>(ImmutableList.copyOf(newFields.keySet()));
        newAttributes.removeAll(oldFieldMapping.fields.keySet());
        for (String attributeName : newAttributes) {
            AttributeInfo newAttribute = newFields.get(attributeName);
            //New required attribute can't be added
            if (newAttribute.multiplicity == Multiplicity.REQUIRED) {
                throw new TypeUpdateException("Can't add required attribute " + attributeName);
            }
        }
    }
685373
def validate_fields
      l = Block.serialize self
      RLP.decode(RLP.encode(l)) == l
    end
756777
private void validateField(FieldDefinition fieldDef) {
        if (fieldDef.isScalarField()) {
            Utils.require(Utils.isEmpty(fieldDef.getAnalyzerName()),
                          "'analyzer' not allowed for OLAP application fields:" + fieldDef);
        } else if (fieldDef.isLinkType()) {
            Utils.require(!fieldDef.isSharded(),
                          "Link and xlink fields cannot be sharded: {}", fieldDef);
        }
    }
575355
def _validate_field_can_be_tagged_with_redactor(self, field):
        
        if is_alias(field.data_type):
            raise InvalidSpec(
                "Redactors can only be applied to alias definitions, not "
                "to alias references.",
                field._ast_node.lineno, field._ast_node.path)

        self._validate_object_can_be_tagged_with_redactor(field)
894305
private void validateConfiguration(ApiSource apiSource) throws GenerateException {
        if (apiSource == null) {
            throw new GenerateException("You do not configure any apiSource!");
        } else if (apiSource.getInfo() == null) {
            throw new GenerateException("`<info>` is required by Swagger Spec.");
        }
        if (apiSource.getInfo().getTitle() == null) {
            throw new GenerateException("`<info><title>` is required by Swagger Spec.");
        }

        if (apiSource.getInfo().getVersion() == null) {
            throw new GenerateException("`<info><version>` is required by Swagger Spec.");
        }

        if (apiSource.getInfo().getLicense() != null && apiSource.getInfo().getLicense().getName() == null) {
            throw new GenerateException("`<info><license><name>` is required by Swagger Spec.");
        }

        if (apiSource.getLocations() == null) {
            throw new GenerateException("<locations> is required by this plugin.");
        }

    }
355528
public static void validateVersion(String name) throws InvalidNameException {
        if (StringUtils.isEmpty(name)) {
            throw ExceptionFactory.invalidVersionException(Messages.i18n.format("FieldValidator.EmptyVersionError")); //$NON-NLS-1$
        }
    }
1174260
def _validate(self):
        
        try:
            out = self._run_tf('version')
        except:
            raise Exception('ERROR: executing \'%s version\' failed; is '
                            'terraform installed and is the path to it (%s) '
                            'correct?' % (self.tf_path, self.tf_path))
        res = re.search(r'Terraform v(\d+)\.(\d+)\.(\d+)', out)
        if res is None:
            logger.error('Unable to determine terraform version; will not '
                         'validate config. Note that this may cause problems '
                         'when using older Terraform versions. This program '
                         'requires Terraform >= 0.6.16.')
            return
        self.tf_version = (
            int(res.group(1)), int(res.group(2)), int(res.group(3))
        )
        logger.debug('Terraform version: %s', self.tf_version)
        if self.tf_version < (0, 6, 16):
            raise Exception('This program requires Terraform >= 0.6.16, as '
                            'that version introduces a bug fix for working '
                            'with api_gateway_integration_response resources; '
                            'see: https://github.com/hashicorp/terraform/pull'
                            '/5893')
        try:
            self._run_tf('validate', ['.'])
        except Exception as ex:
            logger.critical("Terraform config validation failed. "
                            "This is almost certainly a bug in "
                            "webhook2lambda2sqs; please re-run with '-vv' and "
                            "open a bug at <https://github.com/jantman/"
                            "webhook2lambda2sqs/issues>. Exception: %s", ex)
            raise Exception(
                'ERROR: Terraform config validation failed: %s' % ex
            )
3366
@Override
  public void validateUpdate(ResourcePool newPool) {
    // Replacement must be of the same ResourceType
    if (!this.getType().equals(newPool.getType())) {
      throw new IllegalArgumentException("ResourceType " + newPool.getType() + " can not replace " + this.getType());
    }
    // Replacement must have the same persistence
    if (this.isPersistent() != newPool.isPersistent()) {
      throw new IllegalArgumentException("ResourcePool for " + newPool.getType() + " with isPersistent="
          + newPool.isPersistent() + " can not replace isPersistent=" + this.isPersistent());
    }
  }
1065428
private void validate() {
        List<String> missingElements = new LinkedList<>();
        if (host == null) {
            missingElements.add("host");
        }

        if (protocol != null
            && !protocol.equalsIgnoreCase("noop")
            && !protocol.equalsIgnoreCase("out")) {

            if (publicKey == null) {
                missingElements.add("public key");
            }
            if (projectId == null || projectId.isEmpty()) {
                missingElements.add("project ID");
            }
        }

        if (!missingElements.isEmpty()) {
            throw new InvalidDsnException("Invalid DSN, the following properties aren't set '" + missingElements + "'");
        }
    }
1359523
def validate_presence_of(field_name, type)
      type || raise(::ArgumentError, I18n.t('errors.invalid.type_required', field_name: field_name))
    end
154731
def check_unknown_fields(self, data, original_data):
        """"""
        if isinstance(original_data, list):
            for elem in original_data:
                self.check_unknown_fields(data, elem)
        else:
            for key in original_data:
                if key not in [
                        self.fields[field].attribute or field
                        for field in self.fields
                ]:
                    raise ValidationError(
                        'Unknown field name {}'.format(key), field_names=[key])
697427
@SuppressWarnings("unchecked")
	private static ValidationFail performFieldValidations(Context context, FieldInfo fieldInfo, View view) {
		// first, we need to check if condition is not applied for all validations on field
		if (fieldInfo.condition != null && fieldInfo.condition.validationAnnotation().equals(Condition.class)) {
			// condition is applied to all validations on field
			boolean evaluation = evaluateCondition(view, fieldInfo.condition);
			if (! evaluation) {
				// go to next field
				return null;
			}
		}

		// field validations
		for (ValidationInfo valInfo : fieldInfo.validationInfoList) {
			final Annotation annotation = valInfo.annotation;
			if (fieldInfo.condition != null && fieldInfo.condition.validationAnnotation().equals(annotation.annotationType())) {
				boolean evaluation = evaluateCondition(view, fieldInfo.condition);

				if (! evaluation) {
					// continue to next annotation
					continue;
				}
			}
			final IFieldAdapter adapter = FieldAdapterFactory.getAdapterForField(view, annotation);
			if (adapter == null) {
				throw new NoFieldAdapterException(view, annotation);
			}

			final Object value = adapter.getFieldValue(annotation, view);
			final boolean isValid = valInfo.validator.validate(annotation, value);

			if (! isValid) {
				final String message = valInfo.validator.getMessage(context, annotation, value);
				final int order = valInfo.validator.getOrder(annotation);

				// no more validations on this field
				return new ValidationFail(view, message, order);
			}
		}
		return null;
	}
892542
def validate_version(self, where=None):
        
        if where is not None:
            if (self.version[0] <= 0 and self.version[1] <= 10 and
                    self.version[2] < 1):
                ws = incompatibility_doc % '.'.join(
                    [str(x) for x in self.version])
                warnings.warn(ws, IncompatibilityWarning)
512216
public void updateField(Field field) {
        this.name = field.getName();
        this.obj = TypeCheckUtil.isObjClass(field);
        this.list = TypeCheckUtil.isListClass(field);
        this.number = TypeCheckUtil.isNumberClass(field);
        this.enumType = field.getType().isEnum();
        this.typeClass = field.getType();
        this.type = field.getType().getSimpleName();

        if (this.list) {
            this.innerClass = ValidationObjUtil.getListInnerClassFromGenericType(field.getGenericType());
            this.type += "<" + this.innerClass.getSimpleName() + ">";
        }
    }
615575
def validate_current_versions(self):  # type: () -> bool
        
        versions = self.all_current_versions()
        for _, version in versions.items():
            if "Invalid Semantic Version" in version:
                logger.error(
                    "Invalid versions, can't compare them, can't determine if in sync"
                )
                return False

        if not versions:
            logger.warning("Found no versions, will use default 0.1.0")
            return True

        if not self.all_versions_equal(versions):
            if self.almost_the_same_version([x for x in versions.values()]):
                # TODO: disable with strict option
                logger.warning("Version very by a patch level, will use greater.")
                return True
            logger.error("Found various versions, how can we rationally pick?")
            logger.error(unicode(versions))
            return False

        for _ in versions:
            return True
        return False
1090737
def validate_condition!(condition, tag)
      tag = VersionString.new(tag)
      tag.validate!("The version condition, #{condition}, is not valid!")
      tag
    end