API - Filter by version - `$filter=NormalizedVersion gt '9'` does not return any newer major versions

Đang mở
#269 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
powershell
Lĩnh vực
api

Hướng nghiên cứu

Start by tracing how the PowerShell Gallery API applies filters and ordering to the Version and NormalizedVersion fields for package queries. Reproduce the supplied Az query and compare its results with the expected major-version behavior; done means the query returns the newest version at or above major version 9, including versions 10 and 11.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

If you want to specify a minimum major version to return, you can do $filter=NormalizedVersion gt '9'.

If the module you're searching for has newer major versions than 9, say 10, the API won't return it.

Example request for Az, where I want the newest version returned, but at least major version 9:

More human friendly view:

# Filter on Version
[uri]::EscapeUriString(
    'https://www.powershellgallery.com/api/v2/Packages()?' +
    "`$filter=Id eq 'Az' and Version ge '9'&" +
    '$orderby=Version desc&' +
    '$top=1&' +
    '$select=NormalizedVersion,Version'
).Replace("'",'%27') | Set-Clipboard


# Filter on NormalizedVersion
[uri]::EscapeUriString(
    'https://www.powershellgallery.com/api/v2/Packages()?' +
    "`$filter=Id eq 'Az' and NormalizedVersion ge '9'&" +
    '$orderby=NormalizedVersion desc&' +
    '$top=1&' +
    '$select=NormalizedVersion,Version'
).Replace("'",'%27') | Set-Clipboard
Expected behavior
  • Example returns newest version, but at least version 9.
  • I expected (as of writing) v11.5.0.
Actual behavior

Example returns version v9.7.1; the newest v9 version before major jumped to v10 and beyond.

Error details

No response

Environment data
Not relevant, API
Version

Not relevant, API

Visuals

No response

Ngôn ngữ chính
PowerShell
Star
289
Fork
83
Merge trung bình
1 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/PowerShellGallery

Tất cả issue của PowerShell/PowerShellGallery

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.