aboutsummaryrefslogtreecommitdiffstats
path: root/src/schema.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/schema.rs')
-rw-r--r--src/schema.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/schema.rs b/src/schema.rs
index a44f6f8..8b20777 100644
--- a/src/schema.rs
+++ b/src/schema.rs
@@ -66,6 +66,9 @@ pub struct SlotSpec {
pub required: bool,
#[serde(default)]
pub secret: bool,
+ /// The name the slot had in an earlier schema (docs/design.md, section 6).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub renamed_from: Option<String>,
}
fn yes() -> bool {
@@ -123,6 +126,10 @@ impl Schema {
name::check("channel", channel)?;
for (slot, spec) in &mut spec.slots {
name::check("slot", slot)?;
+ if let Some(old) = &spec.renamed_from {
+ name::check("slot", old)
+ .with_context(|| format!("slot {channel}/{slot}: renamedFrom"))?;
+ }
spec.media_type = media::normalize(&spec.media_type)
.with_context(|| format!("slot {channel}/{slot}"))?;
}