[wpiutil] Add nested struct schemas before parent schema (#7935)

When adding struct schemas, the current logic is to add the parent/outer schema, and then add the schemas for any nested inner schemas.  This reverses that order to make it easier for tools to process.

Matches C++ logic.
This commit is contained in:
Jonah Snider
2025-04-29 20:52:27 -07:00
committed by GitHub
parent f14af97dc7
commit a4572a01b7

View File

@@ -451,10 +451,10 @@ public class DataLog implements AutoCloseable {
if (!seen.add(typeString)) {
throw new UnsupportedOperationException(typeString + ": circular reference with " + seen);
}
addSchema(typeString, "structschema", struct.getSchema(), timestamp);
for (Struct<?> inner : struct.getNested()) {
addSchemaImpl(inner, timestamp, seen);
}
addSchema(typeString, "structschema", struct.getSchema(), timestamp);
seen.remove(typeString);
}