Skip to content
Playground(another site)

bynk.http.query_field_not_stringy

Error A field of an HTTP handler's query record has a type a query string cannot carry.

A typed query record is filled from a query string, a set of keys with text values, so each field 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 nested record or any other type is refused. Flatten the record, or take query: RequestQuery and read the keys yourself. A @form body has the same rule: bynk.http.form_field_not_stringy.

Example

type Range = { from: Int, to: Int }
type Filter = { range: Range } // ✗ a query string has no nesting
type Filter = { from: Int, to: Int } // ✓ 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.query_field_not_stringy shows the same from the installed toolchain, without a network.