Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/api/struct_enum.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::BTreeMap;

use anyhow::{Context as _, bail, ensure};
use schemars::schema::{ObjectValidation, Schema, SchemaObject};

Expand Down Expand Up @@ -87,7 +85,7 @@ fn get_content(variant: &ObjectValidation) -> anyhow::Result<(String, EnumVarian
for (p_name, p) in &variant.properties {
let schema_obj = get_schema_obj(p)?;
if let Some(obj) = &schema_obj.object {
let ty = TypeData::from_object_schema(*obj.clone(), BTreeMap::new(), None)?;
let ty = TypeData::from_object_schema(*obj.clone(), schemars::Map::new(), None)?;
let TypeData::Struct { fields } = ty else {
bail!("Expected obj to be a struct");
};
Expand Down
2 changes: 1 addition & 1 deletion src/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub enum TypeData {
impl TypeData {
pub(super) fn from_object_schema(
obj: ObjectValidation,
extensions: BTreeMap<String, serde_json::Value>,
extensions: schemars::Map<String, serde_json::Value>,
subschemas: Option<Box<SubschemaValidation>>,
) -> anyhow::Result<Self> {
ensure!(
Expand Down
Loading