PowerShellGallery icon indicating copy to clipboard operation
PowerShellGallery copied to clipboard

filter `IsLatestVersion` returns invalid response for package `Microsoft.PowerShell.PSResourceGet`

Open sean-r-williams opened this issue 9 months ago • 13 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest version
  • [X] Search the existing issues.

Steps to reproduce

  • Call FindPackagesById() for package JiraPS via the PSGallery NuGet v2 API - example API call: https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27JiraPS%27&$filter=IsLatestVersion
  • Repeat the same API call for package Microsoft.PowerShell.PSResourceGet - example call: https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27Microsoft.PowerShell.PSResourceGet%27&$filter=IsLatestVersion
  • Repeat the same API call for package Microsoft.PowerShell.PSResourceGet, but this time add a space to the front of the filter string: https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27Microsoft.PowerShell.PSResourceGet%27&$filter=%20IsLatestVersion

Expected behavior

All 3 API calls return one and only one package (with the latest version) for their respective package IDs

Actual behavior

API call #2 returns invalid NuGet XML response, but calls 1 and 3 work as expected

Error details

N/A

Environment data

N/A

Version

N/A

Visuals

XML response from API call number 2 is:

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="https://www.powershellgallery.com/api/v2"
      xmlns="http://www.w3.org/2005/Atom"
      xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
      xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
      xmlns:georss="http://www.georss.org/georss"
      xmlns:gml="http://www.opengis.net/gml">
	<m:count>1</m:count>
	<id>http://schemas.datacontract.org/2004/07/</id>
	<title/>
	<updated>2024-05-15T01:39:20Z</updated>
	<link rel="self"
	      href="https://www.powershellgallery.com/api/v2/Packages"/>
	<author>
		<name/>
	</author>
</feed>

Of particular interest is:

  • <m:count>1</m:count> suggests one <entry> should be present, but there are none.
  • <author> should be under an <entry>, not the <feed>. (It's also null for some reason?)

sean-r-williams avatar May 15 '24 01:05 sean-r-williams