Skip to content

Commit

Permalink
chore: adding annotation to shorten error message (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagojez authored Jul 23, 2024
1 parent 0c9f29b commit 9c000a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions integrationos-domain/src/domain/schema/common_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,10 @@ impl CommonModel {
)
}

/// Generates a zod schema for the model in TypeScript
/// Generates an effect schema for the model in TypeScript
fn as_typescript_schema(&self) -> String {
format!(
"export const {} = Schema.Struct({{ {} }});\n",
"export const {} = Schema.Struct({{ {} }}).annotations({{ title: '{}' }});\n",
replace_reserved_keyword(&self.name, Lang::TypeScript)
.replace("::", "")
.pascal_case(),
Expand All @@ -680,7 +680,8 @@ impl CommonModel {
.collect::<HashSet<String>>()
.into_iter()
.collect::<Vec<_>>()
.join(",\n ")
.join(",\n "),
self.name
)
}

Expand Down

0 comments on commit 9c000a8

Please sign in to comment.