name-prop (#1)

Reviewed-on: #1
Co-authored-by: ari <git@astrid.email>
Co-committed-by: ari <git@astrid.email>
This commit was merged in pull request #1.
This commit is contained in:
2026-02-13 13:09:30 +00:00
committed by astrid
parent a2adf2b517
commit 18fdbce8b0
36 changed files with 349 additions and 52 deletions

View File

@@ -70,6 +70,12 @@ pub struct InstanceMetadata {
/// A schema provided via a JSON file, if one exists. Will be `None` for
/// all non-JSON middleware.
pub schema: Option<String>,
/// A custom name specified via meta.json or model.json files. If present,
/// this name will be used for the instance while the filesystem name will
/// be slugified to remove illegal characters.
#[serde(skip_serializing_if = "Option::is_none")]
pub specified_name: Option<String>,
}
impl InstanceMetadata {
@@ -82,6 +88,7 @@ impl InstanceMetadata {
specified_id: None,
middleware: None,
schema: None,
specified_name: None,
}
}
@@ -130,6 +137,13 @@ impl InstanceMetadata {
pub fn schema(self, schema: Option<String>) -> Self {
Self { schema, ..self }
}
pub fn specified_name(self, specified_name: Option<String>) -> Self {
Self {
specified_name,
..self
}
}
}
impl Default for InstanceMetadata {