Returns all fields including embedded objects fields
List<Field> getAllFields() => [...fields, ...embedded.map((e) => e.getAllFields()).flattened];