more recursive docs types (#4028)
* more recursive Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates; Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * add the format Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * get the descriptions again Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- 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:
@ -108,34 +108,38 @@ impl crate::docs::StdLibFn for LineTo {
|
||||
vec![]
|
||||
}
|
||||
|
||||
fn args(&self) -> Vec<crate::docs::StdLibFnArg> {
|
||||
fn args(&self, inline_subschemas: bool) -> Vec<crate::docs::StdLibFnArg> {
|
||||
let mut settings = schemars::gen::SchemaSettings::openapi3();
|
||||
settings.inline_subschemas = true;
|
||||
settings.inline_subschemas = inline_subschemas;
|
||||
let mut generator = schemars::gen::SchemaGenerator::new(settings);
|
||||
vec![
|
||||
crate::docs::StdLibFnArg {
|
||||
name: "data".to_string(),
|
||||
type_: "LineToData".to_string(),
|
||||
schema: LineToData::json_schema(&mut generator),
|
||||
schema_definitions: generator.definitions().clone(),
|
||||
required: true,
|
||||
},
|
||||
crate::docs::StdLibFnArg {
|
||||
name: "sketch".to_string(),
|
||||
type_: "Sketch".to_string(),
|
||||
schema: Sketch::json_schema(&mut generator),
|
||||
schema_definitions: generator.definitions().clone(),
|
||||
required: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
fn return_value(&self) -> Option<crate::docs::StdLibFnArg> {
|
||||
fn return_value(&self, inline_subschemas: bool) -> Option<crate::docs::StdLibFnArg> {
|
||||
let mut settings = schemars::gen::SchemaSettings::openapi3();
|
||||
settings.inline_subschemas = true;
|
||||
settings.inline_subschemas = inline_subschemas;
|
||||
let mut generator = schemars::gen::SchemaGenerator::new(settings);
|
||||
let schema = <Sketch>::json_schema(&mut generator);
|
||||
Some(crate::docs::StdLibFnArg {
|
||||
name: "".to_string(),
|
||||
type_: "Sketch".to_string(),
|
||||
schema: <Sketch>::json_schema(&mut generator),
|
||||
schema,
|
||||
schema_definitions: generator.definitions().clone(),
|
||||
required: true,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user