ManifestSchemaValidation.h (946B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include "ManifestCommon.h" 5 #include "ManifestValidation.h" 6 7 #include <json/json.h> 8 9 namespace AppInstaller::Manifest::YamlParser 10 { 11 // Forward declarations 12 struct YamlManifestInfo; 13 14 // Load manifest schema as parsed json doc 15 Json::Value LoadSchemaDoc(const ManifestVer& manifestVersion, ManifestTypeEnum manifestType); 16 17 // Validate a list of individual manifests against schema 18 std::vector<ValidationError> ValidateAgainstSchema( 19 const std::vector<YamlManifestInfo>& manifestList, 20 const ManifestVer& manifestVersion); 21 22 // Validate the schema header of a list of manifests 23 std::vector<ValidationError> ValidateYamlManifestsSchemaHeader( 24 const std::vector<YamlManifestInfo>& manifestList, 25 const ManifestVer& manifestVersion, 26 bool treatErrorAsWarning = true); 27 }