Check that the entry has the required fields.
960521
def check(self):
        """"""
        # Make sure there is a schema key in dict
        if self._KEYS.SCHEMA not in self:
            self[self._KEYS.SCHEMA] = self.catalog.SCHEMA.URL
        # Make sure there is a name key in dict
        if (self._KEYS.NAME not in self or len(self[self._KEYS.NAME]) == 0):
            raise ValueError("Entry name is empty:\n\t{}".format(
                json.dumps(
                    self, indent=2)))
        return
91085
public function check() {
		foreach ( $this->requirements as $requirement ) {
			// Match against config.
			$requirementFulfilled = $this->requirementIsFulfilled( $requirement );

			if ( $requirementFulfilled ) {
				continue;
			}

			$this->addMissingRequirementMessage( $requirement );
		}
	}
1183719
protected boolean validateForRequired() {

        if(isRequired() && isInputEmpty()) {
            errors.createFieldError(fieldName, getMessageKeyRequired())
                .address(getPosition())
                .label(getLabel())
                .variables("validatedValue", getValue())
                .buildAndAddError();
            return false;
        }

        return true;

    }
378277
public function isRequired($field_key)
    {
        $field = (is_array($field_key)) ? $field_key : $this->getField($field_key);
        return (is_array($field) && array_key_exists('required', $field) && $field['required']);
    }
255497
def validate_required(self, value):
        ''' 
        '''
        if self.required and (value is None or value==''):
            raise MissingFieldError(self.name)
769362
def as_required_fields(self, fields=[]):
        
        fields = self.filter_fields(fields)
        for f in fields:
            f = self.fields[f.name]
            f.required = True
499148
function checkValueSubmitted(submittedField, fieldDefinition, visible, cb) {
        if (!fieldDefinition.required) {
          return cb(undefined, null);
        }

        var valueSubmitted = submittedField && submittedField.fieldValues && (submittedField.fieldValues.length > 0);
        //No value submitted is only an error if the field is visible.

        //If the field value has been marked as not required, then don't fail a no-value submission
        var valueRequired = requiredFieldMap[fieldDefinition._id] && requiredFieldMap[fieldDefinition._id].valueRequired;

        if (!valueSubmitted && visible && valueRequired) {
          return cb(undefined, "No value submitted for field " + fieldDefinition.name);
        }
        return cb(undefined, null);

      }
1051191
public function isValid()
    {
        // get the submitted value
        $value = $this->field->getForm()->getFieldValue($this->field->getName());

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if multiple values are returned and if this is allowed.
        if (is_array($value) && !$this->field->isMultiple()) {
            return false;
        }

        // check if the submitted value(s) are in the options value's
        $options = $this->field->getOptions();

        if (!is_array($value)) {
            $value = (array)$value;
        }

        // check if the selected options exist
        if (!$this->checkIfOptionsExists($value, $options)) {
            return false;
        }

        return true;
    }
927130
def _ensure_field(self, key):
        """"""
        if self._has_field:
            self._size += 2  # comma, space
        self._has_field = True

        self._size += len(key) + 4
578397
def _validate_annotation(self, annotation):
        ''''''
        required_keys = set(self._required_keys)
        keys = set(key for key, val in annotation.items() if val)
        missing_keys = required_keys.difference(keys)
        if missing_keys:
            error = 'Annotation missing required fields: {0}'.format(
                missing_keys)
            raise AnnotationError(error)
226571
protected function setRequiredFieldsConditional()
    {
        $requiredParamsIbanSwiftCode = ['iban', 'swift_code'];

        $requiredFieldsConditional = [
            'billing_country' => [
                'AE' => $requiredParamsIbanSwiftCode,
                'AT' => $requiredParamsIbanSwiftCode,
                'AU' => ['account_number', 'branch_code'],
                'BE' => $requiredParamsIbanSwiftCode,
                'BG' => ['iban'],
                'CA' => ['account_number', 'branch_code', 'bank_code', 'bank_name'],
                'CY' => $requiredParamsIbanSwiftCode,
                'CZ' => ['iban'],
                'DE' => $requiredParamsIbanSwiftCode,
                'DK' => ['account_number', 'bank_code'],
                'EE' => $requiredParamsIbanSwiftCode,
                'ES' => $requiredParamsIbanSwiftCode,
                'FI' => $requiredParamsIbanSwiftCode,
                'FR' => $requiredParamsIbanSwiftCode,
                'GB' => ['account_number', 'bank_code'],
                'GF' => $requiredParamsIbanSwiftCode,
                'GP' => $requiredParamsIbanSwiftCode,
                'GR' => $requiredParamsIbanSwiftCode,
                'HU' => ['account_number'],
                'IE' => $requiredParamsIbanSwiftCode,
                'IT' => $requiredParamsIbanSwiftCode,
                'LT' => $requiredParamsIbanSwiftCode,
                'LU' => $requiredParamsIbanSwiftCode,
                'LV' => $requiredParamsIbanSwiftCode,
                'MC' => $requiredParamsIbanSwiftCode,
                'MQ' => $requiredParamsIbanSwiftCode,
                'MT' => $requiredParamsIbanSwiftCode,
                'MX' => ['iban', 'bank_name'],
                'NL' => $requiredParamsIbanSwiftCode,
                'PL' => ['iban'],
                'PT' => $requiredParamsIbanSwiftCode,
                'RE' => $requiredParamsIbanSwiftCode,
                'SE' => ['iban'],
                'SI' => $requiredParamsIbanSwiftCode,
                'SK' => $requiredParamsIbanSwiftCode
            ]
        ];

        $this->requiredFieldsConditional = \Genesis\Utils\Common::createArrayObject($requiredFieldsConditional);
    }
537428
public function validate()
    {
        foreach ($this->fieldSet as $name => $field) {
            $field->validate();

            if (!$field->isValid()) {
                $this->valid = false;
            }
        }

        $this->validated = true;
    }
255191
def _get_implicit_requirements(
        self,
        fields,
        requirements
    ):
        """"""
        for name, field in six.iteritems(fields):
            source = field.source
            # Requires may be manually set on the field -- if not,
            # assume the field requires only its source.
            requires = getattr(field, 'requires', None) or [source]
            for require in requires:
                if not require:
                    # ignore fields with empty source
                    continue

                requirement = require.split('.')
                if requirement[-1] == '':
                    # Change 'a.b.' -> 'a.b.*',
                    # supporting 'a.b.' for backwards compatibility.
                    requirement[-1] = '*'
                requirements.insert(requirement, TreeMap(), update=True)
767788
def validate_presence_of_required_fields form, fields
      absent_fields = []
      fields.each_pair do |key, opts|
        next  unless opts[:required]
        if !form.has_key?(key) || form[key].nil?
          absent_fields << key
        end
      end
      unless absent_fields.empty?
        raise RegApi2::ContractError.new(
          "Required fields missed: #{absent_fields.join(', ')}",
          absent_fields
        )
      end
      nil
    end
257976
def get_required_fields(self):
    """"""
    return [m.name for m in self._ast_node.members if m.member_schema.required]
963775
def valid?
      REQUIRED_FIELDS[type].all? do |f|
        f.is_a?(Array) ? !(f & fields.keys).empty? : !fields[f].nil?
      end
    end
1027149
protected function checkRequired()
    {
        $missing = array();
        foreach ($this->validFields as $field => $params) {
            if (isset($params['required']) && $params['required']) {
                if ($params['type'] == "single") {
                    if (!isset($this->formData[$field])) {
                        $missing[] = $field;
                        $this->errorMessage[] = 'Missing field: ' . $field;
                    }
                } elseif ($params['type'] == "product") {
                    foreach ($this->products as $prod) {
                        $paramName = $params['paramName'];
                        if (!isset($prod[$paramName])) {
                            $missing[] = $field;
                            $this->errorMessage[] = 'Missing field: ' . $field;
                        }
                    }
                }
            }
        }
        $this->missing = $missing;
        return true;
    }