diff --git a/src/AppInstallerCLITests/RestClient.cpp b/src/AppInstallerCLITests/RestClient.cpp index d044975052..d15178c6d4 100644 --- a/src/AppInstallerCLITests/RestClient.cpp +++ b/src/AppInstallerCLITests/RestClient.cpp @@ -49,7 +49,8 @@ TEST_CASE("GetSupportedInterface", "[RestSource]") Version version{ "1.0.0" }; REQUIRE(RestClient::GetSupportedInterface(utility::conversions::to_utf8string(TestRestUri), {}, info, version)->GetVersion() == version); - Version invalid{ "1.2.0" }; + // Update this test to next version so that we don't forget to add to supported versions before rest e2e tests are available. + Version invalid{ "1.5.0" }; REQUIRE_THROWS(RestClient::GetSupportedInterface(utility::conversions::to_utf8string(TestRestUri), {}, info, invalid)); } diff --git a/src/AppInstallerRepositoryCore/Rest/RestClient.cpp b/src/AppInstallerRepositoryCore/Rest/RestClient.cpp index 5edf2afc8c..7f2e9af901 100644 --- a/src/AppInstallerRepositoryCore/Rest/RestClient.cpp +++ b/src/AppInstallerRepositoryCore/Rest/RestClient.cpp @@ -4,6 +4,7 @@ #include "RestClient.h" #include "Rest/Schema/1_0/Interface.h" #include "Rest/Schema/1_1/Interface.h" +#include "Rest/Schema/1_4/Interface.h" #include "Rest/Schema/HttpClientHelper.h" #include #include "Rest/Schema/InformationResponseDeserializer.h" @@ -17,7 +18,7 @@ using namespace AppInstaller::Utility; namespace AppInstaller::Repository::Rest { // Supported versions - std::set WingetSupportedContracts = { Version_1_0_0, Version_1_1_0 }; + std::set WingetSupportedContracts = { Version_1_0_0, Version_1_1_0, Version_1_4_0 }; constexpr std::string_view WindowsPackageManagerHeader = "Windows-Package-Manager"sv; constexpr size_t WindowsPackageManagerHeaderMaxLength = 1024; @@ -130,6 +131,10 @@ namespace AppInstaller::Repository::Rest { return std::make_unique(api, information, additionalHeaders); } + else if (version == Version_1_4_0) + { + return std::make_unique(api, information, additionalHeaders); + } THROW_HR(APPINSTALLER_CLI_ERROR_RESTSOURCE_INVALID_VERSION); }