Skip to content

Commit

Permalink
removed catch all
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-palakurthi committed Aug 7, 2024
1 parent 52df798 commit 44866bc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions engine/baml-lib/parser-database/src/walkers/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{

use super::{ClassWalker, Walker};

use baml_types::TypeValue;
use internal_baml_schema_ast::ast::{self, FieldType, Identifier, WithName, WithSpan};
use serde_json::json;

Expand Down Expand Up @@ -112,13 +113,15 @@ impl<'db> WithSerializeableContent for (&ParserDatabase, &FieldType) {
"inner": (self.0, ft.deref()).serialize_data( db),
}),
FieldType::Primitive(arity, t, ..) => json!({
"rtype": match t.to_string().as_str() {
"string" => "string",
"int" => "int",
"float" => "float",
"bool" => "bool",
// "null" => "null",
_ => "unknown",
"rtype": match t {
TypeValue::String => "string",
TypeValue::Int => "int",
TypeValue::Float => "float",
TypeValue::Bool => "bool",
TypeValue::Image => "image",
TypeValue::Audio => "audio",
TypeValue::Null => "null",

},
"optional": arity.is_optional(),
}),
Expand Down

0 comments on commit 44866bc

Please sign in to comment.