From 12130a293b7bb5334dba6a701e2fff89d8c774dc Mon Sep 17 00:00:00 2001 From: Brandon Lax Date: Sat, 12 Oct 2024 17:17:25 -0400 Subject: [PATCH] Fix bug in type check --- schemars_derive/src/schema_exprs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/schemars_derive/src/schema_exprs.rs b/schemars_derive/src/schema_exprs.rs index 44b367c6..feeefdf0 100644 --- a/schemars_derive/src/schema_exprs.rs +++ b/schemars_derive/src/schema_exprs.rs @@ -152,9 +152,8 @@ fn expr_for_internally_tagged_newtype_field(field: &Field) -> SchemaExpr { <#ty as schemars::JsonSchema>::json_schema(#GENERATOR) } else { let subschema = <#ty as schemars::JsonSchema>::json_schema(#GENERATOR); - dbg!(); if let Some(type_val) = subschema.get("type") { - if (type_val.as_str().unwrap() != "None") { + if (type_val.as_str().unwrap() != "null") { let mut map = schemars::_private::serde_json::Map::new(); map.insert( #keyword.into(),