Trim string values before checking if the property is required