Skip to content
Playground(another site)

bynk.http.form_field_not_stringy

Error A field of a @form body record has a type a form cannot carry.

A form body is a flat set of keys with text values, so each field of a @form or @multipart body record must be one a single value can fill: a String, Int, Bool or Decimal, an enum, or a refined or opaque type over one, optionally in an Option or a List (a repeated key). A multipart body may also have File fields. A nested record, or any other type, is refused; flatten it. A query record follows the same rule: bynk.http.query_field_not_stringy.

Example

type Address = { city: String }
type SignupForm = { email: String, address: Address } // ✗ a form has no nesting
type SignupForm = { email: String, city: String } // ✓ flat keys

In the Book

See also

  • The grammar rule it governs: http_handler.
  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.form_field_not_stringy shows the same from the installed toolchain, without a network.