Improve XML compatibility
This commit is contained in:
parent
6ca0b5368a
commit
9abf1812a8
1 changed files with 13 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
|||
use reqwest::header::HeaderValue;
|
||||
use serde::Deserialize;
|
||||
|
||||
/// A [host-meta document].
|
||||
/// A [host-meta document] in JRD representation.
|
||||
///
|
||||
/// [host-meta document]: https://datatracker.ietf.org/doc/html/rfc6415
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
@ -15,7 +15,7 @@ pub struct HostMetaDocument {
|
|||
pub subject: Option<String>,
|
||||
|
||||
/// Links established between the [`Self::subject`] and other resources.
|
||||
#[serde(alias = "Links")]
|
||||
#[serde(alias = "Link")]
|
||||
pub links: Vec<HostMetaLink>,
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,20 @@ pub struct HostMetaDocument {
|
|||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct HostMetaLink {
|
||||
/// The kind of relation established by the subject with the attached resource.
|
||||
#[serde(alias = "@rel")]
|
||||
pub rel: String,
|
||||
|
||||
/// The resource put in relation with the subject resource.
|
||||
pub href: String,
|
||||
#[serde(alias = "@href")]
|
||||
pub href: Option<String>,
|
||||
|
||||
/// Template to fill to get the resource put in relation with the subject resource.
|
||||
#[serde(alias = "@template")]
|
||||
pub template: Option<String>,
|
||||
|
||||
/// The `Content-Type` of the resource put in relation.
|
||||
#[serde(alias = "@type")]
|
||||
pub r#type: Option<String>,
|
||||
}
|
||||
|
||||
impl HostMetaDocument {
|
||||
|
|
Loading…
Add table
Reference in a new issue