checker: [3.1] add formatMinimum/formatMaximum diff and breaking-change rules
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ó
- 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
Hướng nghiên cứu
Start with the existing numeric min/max rules, such as request-property-min-set and request-property-max-set, which oasdiff checks lists, and trace how the schema diff reports minimum and maximum changes. Use the base.yaml and revision.yaml reproduction in the issue as a test case, and confirm that the formatMinimum and formatMaximum changes are currently missed. Done means the diff reports these changes and the matching format-min and format-max breaking-change rules fire for the request and response cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
oasdiff (verified on v1.15.3) does not appear to surface changes to the JSON Schema 2020-12 format-assertion keywords formatMinimum, formatMaximum, formatExclusiveMinimum, formatExclusiveMaximum.
These keywords exist specifically so OpenAPI 3.1 / JSON Schema 2020-12 specs can express bounds on format: date, format: time, and format: date-time string values — something that has no equivalent in OpenAPI 3.0 (where minimum/maximum apply only to numerics).
Reproduction
base.yaml:
openapi: 3.1.0
info: { title: t, version: "1" }
paths:
/x:
post:
requestBody:
content:
application/json:
schema:
type: object
properties:
start_date:
type: string
format: date
responses: { "200": { description: ok } }
revision.yaml — same, but adds bounds:
start_date:
type: string
format: date
formatMinimum: "2000-01-01"
formatMaximum: "2099-12-31"
$ oasdiff breaking base.yaml revision.yaml
No breaking changes
$ oasdiff diff base.yaml revision.yaml
# (empty — no change detected)
Expected
Symmetric to the existing numeric rules
(request-property-min-set / request-property-max-set etc.), there
should be:
request-body-format-min-setrequest-body-format-max-setrequest-body-format-min-decreased(breaking when widening)request-body-format-max-increased(breaking when widening)request-parameter-format-min-set(and -max-, -decreased/increased)request-property-format-min-set(etc.)- Corresponding
response-property-format-*rules
Same severity ladder as the numeric counterparts.
oasdiff checks | grep -i format
format-min/format-max returns nothing in v1.15.3; only the integer/numeric min-set/max-set family is present.
Why it matters
Narrowing the accepted date range on a format: date or format: date-time field — e.g. tightening from "any date" to a
specific representable range — is silently invisible to oasdiff, even though it's exactly the kind of breaking change breaking-change detection exists to surface.
- Ngôn ngữ chính
- Go
- Star
- 1.4k
- Fork
- 109
- Merge trung bình
- 12 giờ 11 phút
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của oasdiff/oasdiff
-
Discriminator mapping keys are listed in a random orderCó thể đã có người làm @reuvenharrison đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của oasdiff/oasdiff
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
duplication
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openvibely/openvibely#1443 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
keyxmakerx/Chronicle#1179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
michelangelo-ai/michelangelo#2258 ·
Maintainer thường phản hồi trong vòng 1 ngày