How to customize validation functions for some field? I have the standard node add or edit form.
The edited node has several fields.
How can I customize validation functions for a field ?
For example, I need to switch off or change validation function for some field.
How can I do it ?
In order to add a validation for a entity field and that validation can work in any form you can use entity validation constraints, and add programatic validations.

/**
 * Implements hook_entity_base_field_info_alter().
 */
function foo_entity_base_field_info_alter(array &amp;$fields, EntityTypeInterface $entity_type) {
  // Add Bar constraint to the user name.
  /** @var \Drupal\Core\TypedData\DataDefinitionInterface[] $fields **/
  if ($entity_type-&gt;id() == 'user' &amp;&amp; !empty($fields['name'])) {
    $fields['name']-&gt;addConstraint('Bar');
  }
}