public function isRequired()
    {
        $isRequired = false;

        // see if on the first level of fields we have a required=true in the definition
        foreach ($this->fields as $field) {
            if ($field instanceof JsonDefinitionField &&
                $field->getDef() instanceof Field &&
                $field->getDef()->getRequired() === true
            ) {
                $isRequired = true;
            }
        }

        return $isRequired;
    }