I noticed there is a problem with dumpwallet option. It does not seem to dump segwit addresses ("3"), and dumps only the standard one ("1"). Is it a bug or work as intended? How can I perform full dump of an wallet then?
fRescan = request.params[2].get_bool();
    if (fRescan && fPruneMode)
        throw JSONRPCError(RPC_WALLET_ERROR, "Rescan is disabled in pruned mode");
    if (!IsHex(request.params[0].get_str()))
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey must be a hex string");
    std::vector<unsigned char> data(ParseHex(request.params[0].get_str()));
    CPubKey pubKey(data.begin(), data.end());
    if (!pubKey.IsFullyValid())
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey is not a valid public key");
    LOCK2(cs_main, pwallet->cs_wallet);
    ImportAddress(pwallet, pubKey.GetID(), strLabel);
    ImportScript(pwallet, GetScriptForRawPubKey(pubKey), strLabel, false);
    if (fRescan)
    {
        pwallet->RescanFromTime(TIMESTAMP_MIN, true );
        pwallet->ReacceptWalletTransactions();
    }
    return NullUniValue;
}
UniValue importwallet(const JSONRPCRequest& request)
{
    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
        return NullUniValue;
    }
    if (request.fHelp || request.params.size() != 1)
        throw std::runtime_error(
            "importwallet \"filename\"\n"
            "\nImports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.\n"
            "\nArguments:\n"