Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
GET Request "lt" operator not working for a string in ProGet v2024.16
-
Hi, we are currently testing the upgrade from version ProGet 6.0.20 to 2024.16 on a test ProGet instance. One of the tests resulted in an error relating to a simple GET request:
An error occurred processing a GET request to https://test-endpoint/nuget/auto-int-cps/Packages()?$filter=Id eq 'CPS.Regression' and Version lt '9.1' and IsPrerelease eq 'False'&$top=1&$orderby=Version desc: The binary operator LessThan is not defined for the types 'System.String' and 'System.String'
Note: Our test endpoint points to our test ProGet instance. If I change the test endpoint to our prod endpoint (pointing to our prod instance sitting on version 6.0.20), the same GET request works.
Did the filter stop working in the newer version of ProGet? If so, what is the workaround?
-
Hi @sneh-patel_0294 ,
This API has been deprecated for a long time. It sounds like you're doing your own, custom queries.... ProGet only supports the queries made by certain clients like NuGet. See NuGet ODATA (v2) API.
While we haven't touched the ODATA (v2) code in many years, there must have been some other change that caused this behavior to happen. As you might imagine, we don't want to open up that code and risk introducing another regression, so it'd be best for you to work-around this issue.
Your best bet is to switch to the Packages API; you can also use the NuGet v3 API, which is well documented and supported by ProGet, but it's a lot harder to use.
Cheers,
Alana
-
@atripp said in GET Request "lt" operator not working for a string in ProGet v2024.16:
ou can also use the NuGet v3 AP
Thank you for your response. Could you please point me to the NuGet v3 API documentation you are referring to? Also, how would I use the Packages API to do what the GET request is doing? The documentation for the Packages API is a bit confusing.
-
Hi @sneh-patel_0294 ,
Here is the NuGet API Documentation:
https://learn.microsoft.com/en-us/nuget/api/overviewHere is the Packages API query you would want:
https://docs.inedo.com/docs/proget/reference-api/proget-api-packages/proget-api-packages-list-versions#http-response-specificationRegardless of what APi you use, you'll need to change your query strategy:
- Get a list of all versions of
CPS.Regression
from the server - From that list, filter by
9.1
and then sort by latest that's not prerelease
There are some sample scripts that might be helpful on our docs as well:
https://docs.inedo.com/docs/proget/reference-api/proget-api-packages/proget-api-packages-list-versions#list-all-non-prerelease-versions-powershellThanks,
Alana
- Get a list of all versions of