            var {{ cname }}Json = {{ name }} != null ? MAPPER.writeValueAsString({{ name }}) : null;
            var {{ cname }}JsonSeg = {{ cname }}Json != null ? arena.allocateFrom({{ cname }}Json) : MemorySegment.NULL;
            var {{ cname }} = {{ cname }}Json != null
                ? (MemorySegment) {{ from_json_handle }}.invoke({{ cname }}JsonSeg)
                : MemorySegment.NULL;
            if ({{ cname }}Json != null && {{ cname }}.equals(MemorySegment.NULL)) {
                checkLastError();
                throw new IllegalStateException("failed to create {{ name }} from JSON");
            }
