OxL Reference

error secret-json

error Standard: [§9.3]

What it means#

secret<T> fields travel only in the binary format (over TLS, or in an encrypted journal). The JSON encoder rejects them: when the format is statically known (Format.Json, formats.json, toJson, fromJson) it is a compile error, otherwise encode returns EncodeError.Secret at run time.

Example#

oxl✓ checked in CI
use std.ser { toJson }

data Login {
  user: str
  pass: secret<str>
}

fn dump(l: &Login) {
  let s = toJson(l)      // <- secret-json
}
error
secret-json

How to fix#

Encode in the binary format, or serialize a view of the type without the secret field.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides