fix: blueprints gen failing on List
closes #569 * added new methods to Definitions it doesn't use expect * lookup was failing for the special map/pair case when resolving list generics Co-authored-by: Pi <pi@sundaeswap.finance>
This commit is contained in:
@@ -89,27 +89,29 @@ impl Validator {
|
||||
|
||||
let mut definitions = Definitions::new();
|
||||
|
||||
let parameters = params
|
||||
.iter()
|
||||
.map(|param| {
|
||||
Annotated::from_type(modules.into(), ¶m.tipo, &mut definitions)
|
||||
.map(|schema| Parameter {
|
||||
title: Some(param.arg_name.get_label()),
|
||||
schema,
|
||||
})
|
||||
.map_err(|error| Error::Schema {
|
||||
error,
|
||||
location: param.location,
|
||||
source_code: NamedSource::new(
|
||||
module.input_path.display().to_string(),
|
||||
module.code.clone(),
|
||||
),
|
||||
})
|
||||
})
|
||||
.collect::<Result<_, _>>()?;
|
||||
|
||||
Ok(Validator {
|
||||
title: format!("{}.{}", &module.name, &func.name),
|
||||
description: None,
|
||||
parameters: params
|
||||
.iter()
|
||||
.map(|param| {
|
||||
Annotated::from_type(modules.into(), ¶m.tipo, &mut definitions)
|
||||
.map(|schema| Parameter {
|
||||
title: Some(param.arg_name.get_label()),
|
||||
schema,
|
||||
})
|
||||
.map_err(|error| Error::Schema {
|
||||
error,
|
||||
location: param.location,
|
||||
source_code: NamedSource::new(
|
||||
module.input_path.display().to_string(),
|
||||
module.code.clone(),
|
||||
),
|
||||
})
|
||||
})
|
||||
.collect::<Result<_, _>>()?,
|
||||
description: func.doc.clone(),
|
||||
parameters,
|
||||
datum: datum
|
||||
.map(|datum| {
|
||||
Annotated::from_type(modules.into(), &datum.tipo, &mut definitions).map_err(
|
||||
|
||||
Reference in New Issue
Block a user