use the jsonschema::RootSchema instead of accidentally inventing our own (#4047)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* empty

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"

This reverts commit 64cee26626.

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jess Frazelle
2024-09-30 12:30:22 -07:00
committed by GitHub
parent bb3f9e0377
commit f74b436e3d
48 changed files with 132559 additions and 112098 deletions

View File

@ -116,15 +116,13 @@ impl crate::docs::StdLibFn for LineTo {
crate::docs::StdLibFnArg {
name: "data".to_string(),
type_: "LineToData".to_string(),
schema: LineToData::json_schema(&mut generator),
schema_definitions: generator.definitions().clone(),
schema: generator.root_schema_for::<LineToData>(),
required: true,
},
crate::docs::StdLibFnArg {
name: "sketch".to_string(),
type_: "Sketch".to_string(),
schema: Sketch::json_schema(&mut generator),
schema_definitions: generator.definitions().clone(),
schema: generator.root_schema_for::<Sketch>(),
required: true,
},
]
@ -134,12 +132,11 @@ impl crate::docs::StdLibFn for LineTo {
let mut settings = schemars::gen::SchemaSettings::openapi3();
settings.inline_subschemas = inline_subschemas;
let mut generator = schemars::gen::SchemaGenerator::new(settings);
let schema = <Sketch>::json_schema(&mut generator);
let schema = generator.root_schema_for::<Sketch>();
Some(crate::docs::StdLibFnArg {
name: "".to_string(),
type_: "Sketch".to_string(),
schema,
schema_definitions: generator.definitions().clone(),
required: true,
})
}