Ignore undeclared element when a $value field is present
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
- 35/100
Hướng nghiên cứu
Start by reading the deserialization handling for the rename="$value" field and compare it with the $text path; the issue provides a minimal Rust example that reproduces the UnexpectedStart error for <Foo/>. Determine whether undeclared elements should be ignored in this case, then add a regression test for the chosen behavior. The issue has had no comment for over three years, so check for maintainer guidance before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The default behaviour of ignoring XML elements that are not declared is very useful when dealing with XML that follows an extensible schema. However, including a rename="$value" field changes this behaviour, and undeclared elements generate an UnexpectedStart parse error.
#[derive(Debug, Default, Serialize, Deserialize)]
struct Root {
#[serde(rename = "$value")]
content: Option<String>,
}
let xml = r#"<Root><Foo/></Root>"#;
let r1: Result<Root, quick_xml::DeError> = quick_xml::de::from_str(xml);
// Parse error: UnexpectedStart([70, 111, 111])
If the rename = "$value" is replaced by rename = "$text" then the problem does not arise (parsing is successful and the Foo element is ignored). Is this the intended behaviour?
- Ngôn ngữ chính
- Rust
- Star
- 1.6k
- Fork
- 299
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 tafia/quick-xml
-
Parser accepts an empty element or attribute nameCó thể đã có người làm @ychampion đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytesCó thể đã có người làm @emschwartz đã nhận 4 ngày trước. Đang mởbug encoding
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
tafia/quick-xml#1040 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
encoding optimization
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
tafia/quick-xml#1039 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
optimization question
Độ 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
-
enhancement
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 53/100
tafia/quick-xml#1035 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của tafia/quick-xml
Issue tương tự
-
comp-formats
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 64/100
ClickHouse/ClickHouse#131694 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
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 72/100
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 68/100
Copperpour/Copperpour#500 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
state:triage-needed
Độ khó 1/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