OpenAPI 3.0 spec pattern constant validation

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

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
42/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend-api-design

Hướng nghiên cứu

No file or test is named in the issue. Start by reproducing the validator behavior with the two pattern examples, then locate the OpenAPI 3.0 pattern validation entry point. Done means slash-delimited ECMA 262 patterns are accepted while the undelimited form is rejected.

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

Mô tả

Description

According to the OpenAPI 3.0 specification for the pattern attribute of a schema object, the pattern provided should comply with ECMA 262 regular expression syntax. The syntax defined in that specification defines regular expression literals as being preceded and trailed by a '/' character, as they are in Javascript/ECMAscript.

Expected behaviour

Pattern specified in a specification as:

pattern: /regular expression/

should be valid, patterns specified without the leading and trailing '/' characters should not.

Actual Behavior

Both

pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

and

pattern: ^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$

are valid pattern constants according to the validator. The second should not be valid, unless I'm misreading the two specification documents linked above.

This is a follow up on Connexion issue number 871.

Ngôn ngữ chính
Python
Star
409
Fork
73
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 python-openapi/openapi-spec-validator

Tất cả issue của python-openapi/openapi-spec-validator

Issue tương tự

Thêm issue về Python

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.