a few tweaks

This commit is contained in:
2026-03-04 17:36:42 -05:00
parent 8d0369c672
commit 2d1fca599b
6 changed files with 12 additions and 12 deletions

View File

@ -121,7 +121,7 @@ impl Database {
if !visited.insert(current_id.clone()) {
break; // Cycle detected
}
if let Some(ref_str) = &schema.obj.ref_string {
if let Some(ref_str) = &schema.obj.r#ref {
current_id = ref_str.clone();
depth += 1;
} else {
@ -136,7 +136,7 @@ impl Database {
fn collect_descendants(&mut self) {
let mut direct_refs: HashMap<String, Vec<String>> = HashMap::new();
for (id, schema) in &self.schemas {
if let Some(ref_str) = &schema.obj.ref_string {
if let Some(ref_str) = &schema.obj.r#ref {
direct_refs
.entry(ref_str.clone())
.or_default()

View File

@ -11,7 +11,7 @@ pub struct SchemaObject {
#[serde(rename = "$id")]
pub id: Option<String>,
#[serde(rename = "$ref")]
pub ref_string: Option<String>,
pub r#ref: Option<String>,
/*
Note: The `Ref` field in the Go struct is a pointer populated by the linker.
In Rust, we might handle this differently (e.g., separate lookup or Rc/Arc),
@ -306,7 +306,7 @@ impl<'de> Deserialize<'de> for Schema {
&& obj.if_.is_none()
&& obj.then_.is_none()
&& obj.else_.is_none()
&& obj.ref_string.is_none()
&& obj.r#ref.is_none()
&& obj.family.is_none();
if is_empty && obj.extensible.is_none() {