Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions schemas/JSON/manifests/preview/manifest.0.1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
},
"Url": {
"type": [ "string", "null" ],
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"maxLength": 2000
},
"Homepage": {
Expand Down Expand Up @@ -108,8 +107,7 @@
},
"Url": {
"type": "string",
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"maxLength": 2000,
"description": "Url is required. The path to the installer."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"definitions": {
"Url": {
"type": [ "string", "null" ],
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"maxLength": 2000,
"description": "Optional Url type"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,7 @@
},
"InstallerUrl": {
"type": "string",
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"description": "The installer Url"
},
"InstallerSha256": {
Expand Down
3 changes: 1 addition & 2 deletions schemas/JSON/manifests/v1.0.0/manifest.locale.1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"definitions": {
"Url": {
"type": [ "string", "null" ],
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"maxLength": 2000,
"description": "Optional Url type"
},
Expand Down
6 changes: 2 additions & 4 deletions schemas/JSON/manifests/v1.0.0/manifest.singleton.1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
},
"Url": {
"type": [ "string", "null" ],
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"maxLength": 2000,
"description": "Optional Url type"
},
Expand Down Expand Up @@ -316,8 +315,7 @@
},
"InstallerUrl": {
"type": "string",
"format": "uri",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://",
"pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$",
"description": "The installer Url"
},
"InstallerSha256": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PackageIdentifier: AppInstallerCliTest.TestInstaller
PackageVersion: 1.0.0.0
PackageLocale: en-US
PackageName: AppInstaller Test Installer
Publisher: Microsoft Corporation
Moniker: AICLITestExe
Expand Down
259 changes: 164 additions & 95 deletions src/AppInstallerCommonCore/Manifest/YamlParser.cpp

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions src/AppInstallerCommonCore/Public/winget/ManifestValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace AppInstaller::Manifest
const char* const DuplicateInstallerEntry = "Duplicate installer entry found.";
const char* const InstallerTypeDoesNotSupportPackageFamilyName = "The specified installer type does not support PackageFamilyName.";
const char* const InstallerTypeDoesNotSupportProductCode = "The specified installer type does not support ProductCode.";
const char* const IncompleteMultiFileManifest = "The multi file manifest is incomplete.";
const char* const IncompleteMultiFileManifest = "The multi file manifest is incomplete. A multi file manifest must contain at least version, installer and defaultLocale manifest.";
const char* const InconsistentMultiFileManifestFieldValue = "The multi file manifest has inconsistent field values.";
const char* const DuplicateMultiFileManifestType = "The multi file manifest should contain only one file with the particular ManifestType.";
const char* const DuplicateMultiFileManifestLocale = "The multi file manifest contains duplicate PackageLocale.";
Expand Down Expand Up @@ -85,6 +85,13 @@ namespace AppInstaller::Manifest
return error;
}

static ValidationError MessageFieldWithFile(std::string message, std::string field, std::string file)
{
ValidationError error{ message, field };
error.FileName = file;
return error;
}

static ValidationError MessageFieldValueWithFile(std::string message, std::string field, std::string value, std::string file)
{
ValidationError error{ message, field, value };
Expand Down Expand Up @@ -115,7 +122,10 @@ namespace AppInstaller::Manifest
if (m_errors.empty())
{
// Syntax error, yaml parser error is stored in FailureInfo
m_manifestErrorMessage = Utility::ConvertToUTF8(GetFailureInfo().pszMessage);
if (GetFailureInfo().pszMessage)
{
m_manifestErrorMessage = Utility::ConvertToUTF8(GetFailureInfo().pszMessage);
}
}
else
{
Expand Down