            String {{ c_name }}Json = STREAM_MAPPER.writeValueAsString({{ param_name }});
            var {{ c_name }}JsonSeg = arena.allocateFrom({{ c_name }}Json);
            MemorySegment {{ c_name }} = (MemorySegment) {{ from_json }}.invoke({{ c_name }}JsonSeg);
            if ({{ c_name }}.equals(MemorySegment.NULL)) { checkLastFfiError(); throw new {{ exception_class }}("{{ method_name }}: failed to marshal {{ param_name }}", (Throwable) null); }
