Add support for payloads without 'aliases'

pull/9/head
Baptiste Gelez 5 years ago
parent 82e6d7e3f0
commit bc88621d74

@ -19,6 +19,7 @@ pub struct Webfinger {
pub subject: String,
/// A list of aliases for this WebFinger result.
#[serde(default)]
pub aliases: Vec<String>,
/// Links to places where you may find more information about this resource.

@ -72,6 +72,24 @@ fn test_resolve() {
m.assert();
}
#[test]
fn test_no_aliases() {
let json = r#"
{
"subject": "acct:blog@wedistribute.org",
"links": [
{
"rel": "self",
"type": "application\/activity+json",
"href": "https:\/\/wedistribute.org\/wp-json\/pterotype\/v1\/actor\/-blog"
}
]
}
"#;
assert!(serde_json::from_str::<Webfinger>(json).is_ok());
}
#[test]
fn test_webfinger_parsing() {
let valid = r#"

Loading…
Cancel
Save