fix(codegen): fixed nested all_of

This commit is contained in:
pyrite 2025-12-03 13:55:15 +01:00
parent 2e60e0a24f
commit 06c766b7ec
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
7 changed files with 265 additions and 81 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "torn-api-codegen"
authors = ["Pyrit [2111649]"]
version = "0.8.0"
version = "0.8.1"
edition = "2021"
description = "Contains the v2 torn API model descriptions and codegen for the bindings"
license = { workspace = true }

View file

@ -473,7 +473,11 @@ impl Object {
} else {
r#type
};
let obj = Self::from_schema_object(name, r#type, schemas, warnings.child("variant"));
let obj = if let Some(types) = &r#type.all_of {
Self::from_all_of(name, types, schemas, warnings.child("variant"))
} else {
Self::from_schema_object(name, r#type, schemas, warnings.child("variant"))
};
result.description = result.description.or(obj.description);
result.properties.extend(obj.properties);