mirror of
https://github.com/deepseek-ai/deepseek-recipe.git
synced 2026-10-28 17:17:08 +08:00
Keep reference definition maps indirect to bound schema enum size
This commit is contained in:
parent
b16ceebbd8
commit
53d89eb101
@ -64,9 +64,9 @@ pub(crate) enum JsonSchemaType {
|
||||
description: Option<String>,
|
||||
// Retain legacy `$def` as well as the standard definition containers.
|
||||
#[serde(rename = "$defs", skip_serializing_if = "Option::is_none")]
|
||||
defs: Option<IndexMap<String, Box<JsonSchema>>>,
|
||||
defs: Option<Box<IndexMap<String, Box<JsonSchema>>>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
definitions: Option<IndexMap<String, Box<JsonSchema>>>,
|
||||
definitions: Option<Box<IndexMap<String, Box<JsonSchema>>>>,
|
||||
#[serde(rename = "$def", skip_serializing_if = "Option::is_none")]
|
||||
def: Option<IndexMap<String, Box<JsonSchema>>>,
|
||||
},
|
||||
@ -209,7 +209,11 @@ impl JsonSchemaType {
|
||||
for value in properties.values_mut() {
|
||||
value.normalize(false)?;
|
||||
}
|
||||
for definitions in [def, defs, definitions].into_iter().flatten() {
|
||||
for definitions in def
|
||||
.iter_mut()
|
||||
.chain(defs.iter_mut().map(Box::as_mut))
|
||||
.chain(definitions.iter_mut().map(Box::as_mut))
|
||||
{
|
||||
for value in definitions.values_mut() {
|
||||
value.normalize(false)?;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user