More numeric types baby steps (#5388)

* Add units to Paths

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add some NumericType combination functions

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Fix docs/json/snippets generation from schemas

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-02-20 10:12:37 +13:00
committed by GitHub
parent b2e1d21d45
commit 45707d2974
83 changed files with 40831 additions and 18188 deletions

View File

@ -112,7 +112,9 @@ impl crate::docs::StdLibFn for Show {
vec![crate::docs::StdLibFnArg {
name: "args".to_string(),
type_: "number".to_string(),
schema: generator.root_schema_for::<Option<f64>>(),
schema: crate::docs::cleanup_number_tuples_root(
generator.root_schema_for::<Option<f64>>(),
),
required: false,
label_required: true,
description: String::new().to_string(),
@ -124,7 +126,7 @@ impl crate::docs::StdLibFn for Show {
let mut settings = schemars::gen::SchemaSettings::openapi3();
settings.inline_subschemas = inline_subschemas;
let mut generator = schemars::gen::SchemaGenerator::new(settings);
let schema = generator.root_schema_for::<f64>();
let schema = crate::docs::cleanup_number_tuples_root(generator.root_schema_for::<f64>());
Some(crate::docs::StdLibFnArg {
name: "".to_string(),
type_: "number".to_string(),