diff --git a/packages/td-tools/src/td-parser.ts b/packages/td-tools/src/td-parser.ts index 6c9d2d2f7..0c19a2992 100644 --- a/packages/td-tools/src/td-parser.ts +++ b/packages/td-tools/src/td-parser.ts @@ -241,9 +241,9 @@ export function serializeTD(thing: Thing): string { } else if (copy.properties != null) { // add mandatory fields (if missing): observable, writeOnly, and readOnly for (const prop of Object.values(copy.properties)) { - prop.readOnly ??= false; - prop.writeOnly ??= false; - prop.observable ??= false; + adjustBooleanField(prop, "readOnly") + adjustBooleanField(prop, "writeOnly") + adjustBooleanField(prop, "observable") } }