fix: Data was not allowed in an interface

Co-authored-by: rvcas <x@rvcas.dev>
This commit is contained in:
Kasey White 2023-03-01 21:34:36 -05:00
parent 0c1c7da16f
commit 413a056c08
1 changed files with 11 additions and 0 deletions

View File

@ -296,6 +296,17 @@ impl Annotated<Schema> {
description,
annotated: data,
}),
Annotated {
title: Some(title),
description,
annotated: Schema::Data(None),
} if title == "Data" => Ok(Annotated {
title: Some(title),
description,
annotated: Data::AnyOf(vec![]),
}),
_ => Err(Error::new(ErrorContext::ExpectedData, type_info)),
}
}