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

Runtime expression `name` rule inconsistent with path template grammar

Đang mở
#5,285 10 bình luận 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
markdown

Hướng nghiên cứu

Đọc các quy tắc ABNF của biểu thức runtime cho name và token cùng với ngữ pháp mẫu đường dẫn của OpenAPI 3.2. Xác định xem tên query rỗng có được chủ ý cho phép hay không trước khi quyết định liệu name có nên yêu cầu một ký tự hay không; công việc được xem là hoàn tất khi ngữ pháp và phần văn bản xung quanh trong đặc tả nhất quán trong việc ghi lại quyết định này.

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

Mô tả

The runtime expression ABNF grammar defines:

name = *( char )
token = 1*tchar

The * (zero or more) quantifier on name means expressions like $request.query. and $request.path. with empty names are syntactically valid per the grammar.

The OpenAPI spec states that the Parameter Object's name field is REQUIRED:

REQUIRED. The name of the parameter. Parameter names are case-sensitive.

A required field with an empty string value is arguably not meaningful, though the spec doesn't explicitly say "non-empty".

For path parameters specifically, this is inconsistent with the path template grammar introduced in OpenAPI 3.2.0:

template-expression-param-name = 1*( %x00-7A / %x7C / %x7E-10FFFF )

The 1* quantifier requires at least one character for path parameter names. So {userId} is valid but {} is not. Yet the runtime expression $request.path. (empty name) is accepted by the grammar.

For query parameters, the situation is less clear — HTTP technically allows empty query parameter keys (?=value), though this is extremely uncommon.

For consistency with the path template grammar and the token = 1*tchar rule (which already requires at least one character for headers), consider changing:

name = *( char )

to:

name = 1*( char )

This would require at least one character for query and path parameter names, aligning the runtime expression grammar with the path template grammar.

Ngôn ngữ chính
Markdown
Star
31.2k
Fork
9.2k
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
17

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/OpenAPI-Specification

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

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.