Nothing checks that what a declaration says a value looks like is what it is written as
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
The rule belongs in the WireShape.Testing project, alongside the existing WireShape.OpenApi.Testing rule that reads Format. Start by reading how ISerializer.WriteAsText and ReadFromText are defined, since the issue depends on #9 and #11 for them. The work is design-heavy across Kind, Format, Pattern and closed lists, so it is not a first contribution; done means every declared value is checked or reported as uncheckable.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
A declaration says what a value looks like once written — its Kind, its Format, for a text its Pattern, and for an enumeration the closed list of what each of its values travels as — and a document writes each of them into the schema of the value. None of it is checked against what is written. The only rule that reads Format (WireShape.OpenApi.Testing) compares the declaration with the document, never with the writer, so a declaration and the wire can say two different things and every test passes. #9 is what that looked like: three carriers of time shipped with a Format that the text they are written as does not have.
A document saying one thing while the wire writes another must not happen, and nothing guarantees it today.
Proposal
A rule in WireShape.Testing that writes values of every form a wire declares with the writer of that wire, through ISerializer.WriteAsText (#9), and reports every value whose written form contradicts what is declared about it. It is complete: every declared value is checked, and one that cannot be checked is reported, never skipped.
What is checked of each value
Kind: aTextis written as a text, anIntegeras a number with no fractional part, aDecimalas a number, aBooleanas a truth. This needs the writer to say what it wrote, and not only its text, which is what #11 adds to writing a value: a value written whole with itsValueKind, or one written with members or as a list.Format: the text satisfies the format as the OpenAPI format registry defines it.Pattern: the text matches it.- A closed list (#11): each value of the enumeration is written as the word or the number the list gives it, and nothing the list does not hold is written for any of them.
Where the values come from
| Form | Values written |
|---|---|
A carrier of Carrier.Known |
Values the rule makes itself, covering what changes the text: each DateTimeKind of a DateTime, an offset of zero and one that is not, a time of day and a moment with and without a fraction, a negative span, the bounds of each number, -0 |
| A type declared to travel as one of those carriers | The same values of its carrier, read into the declared type with ReadFromCarrier and written as the declared type, so that the converter of the application is what is checked |
An enumeration declared or worked out as AsText or AsInteger with a closed list |
Every value of the enumeration, which the type itself lists, so no example is needed |
A text declared with Shape.AsText, or a carrier of one's own |
Examples the declaration itself carries, read with the converter of the wire and written back. Nothing else can make one: a text in a format can only be written by someone who already knows the format, and writing it back unread would prove nothing |
So Shape.AsText and Carrier can carry examples. A declaration with a Format or a Pattern and no examples is reported as one that cannot be checked.
What it knows how to check
Every format a carrier of Carrier.Known declares, after #9: uuid, int32, int64, float, double, decimal, date, date-time, time-local. A Format it has no check for is reported as one that cannot be checked, so that a word nobody verifies — email, or date-tme — does not pass in silence. Adding a format means adding its check.
Expected Behavior
- Over the wire of the documentation, with every declaration as it is meant to be, it reports nothing.
- A carrier declared
timeand written without an offset is reported, naming the type, the format and the text written. - A value declared as an
Integerand written as a string is reported. - A text declared with a
Patternwhose example is written in a form the pattern does not match is reported. - A value of an enumeration written as a word or a number other than the one its closed list gives it is reported, naming the member, what the list says and what was written.
- A declaration with a
Formator aPatternand no examples is reported as one that cannot be checked. - A
Formatthe rule has no check for is reported as one that cannot be checked. - A converter of the application that changes how a carrier is written — a
TimeOnlywith an offset — is checked as what it writes, not as what the carrier says.
Depends on
- #9, for
ISerializer.WriteAsTextandReadFromText, and for the formats of time that the rule would otherwise report. - #11, for what writing a value says it wrote, and for the closed lists of
AsTextandAsInteger.
- Ngôn ngữ chính
- C#
- Star
- 0
- Fork
- 0
- Merge trung bình
- 20 giờ 34 phút
- Pull request đã merge (30 ngày)
- 5
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 iokode/WireShape
-
An enumeration is asked what it travels as by a way of its own, beside the form of every other typeĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
Tất cả issue của iokode/WireShape
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
area:repo elsa 3 prio low triaged type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
elsa-workflows/elsa-core#9258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
iokode/OpinionatedFramework#140 ·
-
accessibility effort: small enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pedersebastian/CustomBossChallenge#185 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100