@@ -836,7 +836,8 @@ public static bool TryConvertFromContainerRegistryJson(
836836
837837 // Version
838838 // For scripts (i.e with "Version" property) the version can contain prerelease label
839- if ( rootDom . TryGetProperty ( "Version" , out JsonElement scriptVersionElement ) )
839+ // For nupkg only based packages the .nuspec's metadata attributes will be lowercase
840+ if ( rootDom . TryGetProperty ( "Version" , out JsonElement scriptVersionElement ) || rootDom . TryGetProperty ( "version" , out scriptVersionElement ) )
840841 {
841842 versionValue = scriptVersionElement . ToString ( ) ;
842843 pkgVersion = ParseHttpVersion ( versionValue , out string prereleaseLabel ) ;
@@ -883,25 +884,25 @@ public static bool TryConvertFromContainerRegistryJson(
883884 metadata [ "NormalizedVersion" ] = parsedNormalizedVersion . ToNormalizedString ( ) ;
884885
885886 // License Url
886- if ( rootDom . TryGetProperty ( "LicenseUrl" , out JsonElement licenseUrlElement ) )
887+ if ( rootDom . TryGetProperty ( "LicenseUrl" , out JsonElement licenseUrlElement ) || rootDom . TryGetProperty ( "licenseUrl" , out licenseUrlElement ) )
887888 {
888889 metadata [ "LicenseUrl" ] = ParseHttpUrl ( licenseUrlElement . ToString ( ) ) as Uri ;
889890 }
890891
891892 // Project Url
892- if ( rootDom . TryGetProperty ( "ProjectUrl" , out JsonElement projectUrlElement ) )
893+ if ( rootDom . TryGetProperty ( "ProjectUrl" , out JsonElement projectUrlElement ) || rootDom . TryGetProperty ( "projectUrl" , out projectUrlElement ) )
893894 {
894895 metadata [ "ProjectUrl" ] = ParseHttpUrl ( projectUrlElement . ToString ( ) ) as Uri ;
895896 }
896897
897898 // Icon Url
898- if ( rootDom . TryGetProperty ( "IconUrl" , out JsonElement iconUrlElement ) )
899+ if ( rootDom . TryGetProperty ( "IconUrl" , out JsonElement iconUrlElement ) || rootDom . TryGetProperty ( "iconUrl" , out iconUrlElement ) )
899900 {
900901 metadata [ "IconUrl" ] = ParseHttpUrl ( iconUrlElement . ToString ( ) ) as Uri ;
901902 }
902903
903904 // Tags
904- if ( rootDom . TryGetProperty ( "Tags" , out JsonElement tagsElement ) )
905+ if ( rootDom . TryGetProperty ( "Tags" , out JsonElement tagsElement ) || rootDom . TryGetProperty ( "tags" , out tagsElement ) )
905906 {
906907 string [ ] pkgTags = Utils . EmptyStrArray ;
907908 if ( tagsElement . ValueKind == JsonValueKind . Array )
@@ -937,7 +938,7 @@ public static bool TryConvertFromContainerRegistryJson(
937938 }
938939
939940 // Author
940- if ( rootDom . TryGetProperty ( "Authors" , out JsonElement authorsElement ) )
941+ if ( rootDom . TryGetProperty ( "Authors" , out JsonElement authorsElement ) || rootDom . TryGetProperty ( "authors" , out authorsElement ) )
941942 {
942943 metadata [ "Authors" ] = authorsElement . ToString ( ) ;
943944
@@ -948,19 +949,19 @@ public static bool TryConvertFromContainerRegistryJson(
948949 }
949950
950951 // Copyright
951- if ( rootDom . TryGetProperty ( "Copyright" , out JsonElement copyrightElement ) )
952+ if ( rootDom . TryGetProperty ( "Copyright" , out JsonElement copyrightElement ) || rootDom . TryGetProperty ( "copyright" , out copyrightElement ) )
952953 {
953954 metadata [ "Copyright" ] = copyrightElement . ToString ( ) ;
954955 }
955956
956957 // Description
957- if ( rootDom . TryGetProperty ( "Description" , out JsonElement descriptiontElement ) )
958+ if ( rootDom . TryGetProperty ( "Description" , out JsonElement descriptiontElement ) || rootDom . TryGetProperty ( "description" , out descriptiontElement ) )
958959 {
959960 metadata [ "Description" ] = descriptiontElement . ToString ( ) ;
960961 }
961962
962963 // ReleaseNotes
963- if ( rootDom . TryGetProperty ( "ReleaseNotes" , out JsonElement releaseNotesElement ) )
964+ if ( rootDom . TryGetProperty ( "ReleaseNotes" , out JsonElement releaseNotesElement ) || rootDom . TryGetProperty ( "releaseNotes" , out releaseNotesElement ) )
964965 {
965966 metadata [ "ReleaseNotes" ] = releaseNotesElement . ToString ( ) ;
966967 }
0 commit comments