docs: def to_schema(self):
          """Return field schema for this field."""
          if not self.name or not self.process:
              raise ValueError("field is not registered with process")
  
          schema = {
              'name': self.name,
              'type': self.get_field_type(),
          }
          if self.required is not None:
              schema['required'] = self.required
          if self.label is not None:
              schema['label'] = self.label
          if self.description is not None:
              schema['description'] = self.description
          if self.default is not None:
              schema['default'] = self.default
          if self.hidden is not None:
              schema['hidden'] = self.hidden
          if self.choices is not None:
              for choice, label in self.choices:
                  schema.setdefault('choices', []).append({
                      'label': label,
                      'value': choice,
                  })
  
          return schema