canNull method

bool canNull(
  1. String name,
  2. SchemaOpenApi schema
)

A schema contains this property A property name

Implementation

bool canNull(String name, SchemaOpenApi schema) {
  if (schema.nullable) return true;
  if ((required ?? const []).contains(name)) return false;
  return true;
}