Smart Field documentation + Enum support

Is there more info available on the smart field types? Specifically “Address”.

What sort of data-shape and validation is expected and run under the hood?

Also, is it possible to create Enumeration types with pre-filled values? I know that an array is valid JSON, and many SQL engines implement JSON for array types. I know the data builder supports JSON columns with default values, but how would I create something like a “State” field for addresses that is an enum of all possible states?

Another common example are finite-state properties, like a transaction status.

EDIT: Seems like “Switch” data type with “custom” options is what I was looking for as an Enum.

1 Like

Yessir! Switch is the best replacement for enums at the moment, and even making a separate table can work too.

When it comes to address, you can find it in your API Explorer! However, here it is as well:

Smart Address:
  country: String
  street1: String
  street2: String
  zip: String
  city: String
  state: String
1 Like