Decodes a JSON integer, or throws E_PARAMS. Used by generated code.
E_PARAMS
int decodeInt(Object? v, String f) => v is int ? v : throw BridgeError(BridgeErrorCode.params, '$f: expected an int');