@@ -884,19 +884,19 @@ public static bool TryConvertFromContainerRegistryJson(
884884 metadata [ "NormalizedVersion" ] = parsedNormalizedVersion . ToNormalizedString ( ) ;
885885
886886 // License Url
887- if ( rootDom . TryGetProperty ( "LicenseUrl" , out JsonElement licenseUrlElement ) || rootDom . TryGetProperty ( "licenseUrl" , out licenseUrlElement ) || rootDom . TryGetProperty ( "LicenseUri" , out licenseUrlElement ) )
887+ if ( rootDom . TryGetProperty ( "LicenseUrl" , out JsonElement licenseUrlElement ) || rootDom . TryGetProperty ( "licenseUrl" , out licenseUrlElement ) )
888888 {
889889 metadata [ "LicenseUrl" ] = ParseHttpUrl ( licenseUrlElement . ToString ( ) ) as Uri ;
890890 }
891891
892892 // Project Url
893- if ( rootDom . TryGetProperty ( "ProjectUrl" , out JsonElement projectUrlElement ) || rootDom . TryGetProperty ( "projectUrl" , out projectUrlElement ) || rootDom . TryGetProperty ( "ProjectUri" , out projectUrlElement ) )
893+ if ( rootDom . TryGetProperty ( "ProjectUrl" , out JsonElement projectUrlElement ) || rootDom . TryGetProperty ( "projectUrl" , out projectUrlElement ) )
894894 {
895895 metadata [ "ProjectUrl" ] = ParseHttpUrl ( projectUrlElement . ToString ( ) ) as Uri ;
896896 }
897897
898898 // Icon Url
899- if ( rootDom . TryGetProperty ( "IconUrl" , out JsonElement iconUrlElement ) || rootDom . TryGetProperty ( "iconUrl" , out iconUrlElement ) || rootDom . TryGetProperty ( "IconUri" , out iconUrlElement ) )
899+ if ( rootDom . TryGetProperty ( "IconUrl" , out JsonElement iconUrlElement ) || rootDom . TryGetProperty ( "iconUrl" , out iconUrlElement ) )
900900 {
901901 metadata [ "IconUrl" ] = ParseHttpUrl ( iconUrlElement . ToString ( ) ) as Uri ;
902902 }
@@ -995,17 +995,17 @@ public static bool TryConvertFromContainerRegistryJson(
995995 if ( rootDom . TryGetProperty ( "PrivateData" , out JsonElement privateDataElement ) && privateDataElement . TryGetProperty ( "PSData" , out JsonElement psDataElement ) )
996996 {
997997 // some properties that may be in PrivateData.PSData: LicenseUri, ProjectUri, IconUri, ReleaseNotes
998- if ( ! ( metadata . ContainsKey ( "LicenseUrl" ) || metadata . ContainsKey ( "licenseUrl" ) ) && psDataElement . TryGetProperty ( "LicenseUri" , out JsonElement psDataLicenseUriElement ) )
998+ if ( ! metadata . ContainsKey ( "LicenseUrl" ) && psDataElement . TryGetProperty ( "LicenseUri" , out JsonElement psDataLicenseUriElement ) )
999999 {
10001000 metadata [ "LicenseUrl" ] = ParseHttpUrl ( psDataLicenseUriElement . ToString ( ) ) as Uri ;
10011001 }
10021002
1003- if ( ! ( metadata . ContainsKey ( "ProjectUrl" ) || metadata . ContainsKey ( "ProjectUrl" ) ) && psDataElement . TryGetProperty ( "ProjectUri" , out JsonElement psDataProjectUriElement ) )
1003+ if ( ! metadata . ContainsKey ( "ProjectUrl" ) && psDataElement . TryGetProperty ( "ProjectUri" , out JsonElement psDataProjectUriElement ) )
10041004 {
10051005 metadata [ "ProjectUrl" ] = ParseHttpUrl ( psDataProjectUriElement . ToString ( ) ) as Uri ;
10061006 }
10071007
1008- if ( ! ( metadata . ContainsKey ( "IconUrl" ) || metadata . ContainsKey ( "IconUrl" ) ) && psDataElement . TryGetProperty ( "IconUri" , out JsonElement psDataIconUriElement ) )
1008+ if ( ! metadata . ContainsKey ( "IconUrl" ) && psDataElement . TryGetProperty ( "IconUri" , out JsonElement psDataIconUriElement ) )
10091009 {
10101010 metadata [ "IconUrl" ] = ParseHttpUrl ( psDataIconUriElement . ToString ( ) ) as Uri ;
10111011 }
@@ -1014,6 +1014,29 @@ public static bool TryConvertFromContainerRegistryJson(
10141014 {
10151015 metadata [ "ReleaseNotes" ] = psDataReleaseNotesElement . ToString ( ) ;
10161016 }
1017+
1018+ if ( ! metadata . ContainsKey ( "Tags" ) && psDataElement . TryGetProperty ( "Tags" , out JsonElement psDataTagsElement ) )
1019+ {
1020+ string [ ] pkgTags = Utils . EmptyStrArray ;
1021+ if ( psDataTagsElement . ValueKind == JsonValueKind . Array )
1022+ {
1023+ var arrayLength = psDataTagsElement . GetArrayLength ( ) ;
1024+ List < string > tags = new List < string > ( arrayLength ) ;
1025+ foreach ( var tag in psDataTagsElement . EnumerateArray ( ) )
1026+ {
1027+ tags . Add ( tag . ToString ( ) ) ;
1028+ }
1029+
1030+ pkgTags = tags . ToArray ( ) ;
1031+ }
1032+ else if ( psDataTagsElement . ValueKind == JsonValueKind . String )
1033+ {
1034+ string tagStr = psDataTagsElement . ToString ( ) ;
1035+ pkgTags = tagStr . Split ( Utils . WhitespaceSeparator , StringSplitOptions . RemoveEmptyEntries ) ;
1036+ }
1037+
1038+ metadata [ "Tags" ] = pkgTags ;
1039+ }
10171040 }
10181041
10191042 var additionalMetadataHashtable = new Dictionary < string , string >
0 commit comments