Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Traits fixtures use a target that is not RFC 9535 (`@.x-oai-traits`)

Đang mở Phù hợp với người mới
#415 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, yaml
Lĩnh vực
testing

Hướng nghiên cứu

Cập nhật các mục target trong tests/v1.0/pass/actions-traits-example.yaml, tests/v1.1/pass/actions-traits-example.yaml và tests/v1.2-dev/pass/actions-traits-example.yaml để khớp với ví dụ traits đã được sửa trong đặc tả. Trước tiên, hãy so sánh các fixture đó với ví dụ trong issue, sau đó chạy bộ kiểm thử schema trên các fixture. Hoàn tất khi cả ba đều dùng target đã sửa và chọn các operation mong đợi.

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

Mô tả

The traits fixtures in the schema test suite use a target that is not a valid RFC 9535 query:

  • tests/v1.0/pass/actions-traits-example.yaml
  • tests/v1.1/pass/actions-traits-example.yaml
  • tests/v1.2-dev/pass/actions-traits-example.yaml
- target: $.paths.*.get[[email protected]]

In RFC 9535, a member name in shorthand notation cannot contain - (section 2.5.1.1: name-char = name-first / DIGIT, and name-first excludes -), so @.x-oai-traits is a syntax error; it would have to be @['x-oai-traits']. The fixtures pass because the schema only checks pattern: ^\$ on target. But an implementation that follows the "RFC9535 Compliance" section ("MUST fully implement RFC9535") has to reject these overlays, so the "pass" fixtures cannot be used to test tools.

Even in bracket notation, the target would filter the members of each get operation, not the operations themselves, and paged is an array element, not a member. #229 fixed the same example in the specification text (now in 1.1.0 and 1.2.0) to:

- target: $.paths[?(@.get['x-oai-traits'][?(@ == 'paged')])].get

Suggestion: use that target in the three fixtures, so that they match the specification's traits example.

Found while running the fixtures against an RFC 9535 implementation that passes the JSONPath Compliance Test Suite; the corrected target parses and selects the expected operations on the specification's example description.

Ngôn ngữ chính
JavaScript
Star
122
Fork
38
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
9

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 OAI/Overlay-Specification

Tất cả issue của OAI/Overlay-Specification

Issue tương tự

Thêm issue về JavaScript

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.