More propagation of numeric types (#6177)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-04-07 19:02:41 +12:00
committed by GitHub
parent bc22d888ee
commit be05dd7ba1
24 changed files with 631 additions and 350 deletions

View File

@ -709,7 +709,7 @@ fn add_to_types(
return Err(anyhow::anyhow!("Empty type name"));
}
if DECLARED_TYPES.contains(&name) {
if DECLARED_TYPES.contains(&name) || name == "TyF64" {
return Ok(());
}
@ -769,7 +769,7 @@ fn generate_type(
}
// Skip over TagDeclarator and TagIdentifier since they have custom docs.
if name == "TagDeclarator" || name == "TagIdentifier" || name == "TagNode" {
if name == "TagDeclarator" || name == "TagIdentifier" || name == "TagNode" || name == "TyF64" {
return Ok(());
}
@ -930,7 +930,7 @@ fn recurse_and_create_references(
schema: &schemars::schema::Schema,
types: &BTreeMap<String, schemars::schema::Schema>,
) -> Result<schemars::schema::Schema> {
if DECLARED_TYPES.contains(&name) {
if DECLARED_TYPES.contains(&name) || name == "TyF64" {
return Ok(schema.clone());
}
@ -944,7 +944,7 @@ fn recurse_and_create_references(
if let Some(reference) = &o.reference {
let mut obj = o.clone();
let reference = reference.trim_start_matches("#/components/schemas/");
if DECLARED_TYPES.contains(&reference) {
if DECLARED_TYPES.contains(&reference) || reference == "TyF64" {
return Ok(schema.clone());
}