diff --git a/.gitignore b/.gitignore
index 7e4a920..6fbd31e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,4 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
+**/.idea
\ No newline at end of file
diff --git a/yaserde/tests/namespace.rs b/yaserde/tests/namespace.rs
index c6b5151..dce4606 100644
--- a/yaserde/tests/namespace.rs
+++ b/yaserde/tests/namespace.rs
@@ -468,3 +468,33 @@ fn struct_bad_namespace() {
Err("bad namespace for book, found http://www.sample.com/ns/domain2".to_string())
);
}
+
+#[test]
+fn struct_default_namespace_no_prefix() {
+ init();
+
+ #[derive(Debug, PartialEq, YaDeserialize, YaSerialize)]
+ #[yaserde(
+ rename = "book",
+ namespace = "http://www.sample.com/ns/domain"
+ )]
+ pub struct Book {
+ author: String,
+ title: String,
+ }
+
+ let content = r#"
+
+ Antoine de Saint-Exupéry
+ Little prince
+
+ "#;
+
+ let model = Book {
+ author: "Antoine de Saint-Exupéry".to_owned(),
+ title: "Little prince".to_owned(),
+ };
+
+ serialize_and_validate!(model, content);
+ deserialize_and_validate!(content, model, Book);
+}
\ No newline at end of file
diff --git a/yaserde_derive/src/common/attribute.rs b/yaserde_derive/src/common/attribute.rs
index 6494844..1deb334 100644
--- a/yaserde_derive/src/common/attribute.rs
+++ b/yaserde_derive/src/common/attribute.rs
@@ -9,7 +9,7 @@ pub struct YaSerdeAttribute {
pub default: Option,
pub default_namespace: Option,
pub flatten: bool,
- pub namespaces: BTreeMap,
+ pub namespaces: BTreeMap