decodeKeys function

void decodeKeys(
  1. Map<String, Object?> m,
  2. Set<String> allowed,
  3. String f
)

Rejects any field the schema does not declare. Used by generated code.

Implementation

void decodeKeys(Map<String, Object?> m, Set<String> allowed, String f) {
  for (final k in m.keys) {
    if (!allowed.contains(k)) throw BridgeError(BridgeErrorCode.params, '$f.$k: unknown field');
  }
}