Skip to content

Added TMatrix<T> and TObjectMatrix<T> to the Delphi runtime for two-dimensional scalar and object arrays.

Latest

Choose a tag to compare

@JensBorrisholt JensBorrisholt released this 14 Aug 12:04

Features

  • Renamed the historical Pkg.* units to the product-oriented
    JsonToDelphi.* namespace. The Pkg prefix originated from the initials of
    Petar Georgiev, who created the original project. Since the codebase has been
    substantially rewritten and expanded, its unit names now describe the
    product and their architectural role instead of an individual developer.
  • Renamed the former Lib directory to Runtime because these units are
    dependencies of the generated Delphi code. Existing projects must update
    their unit references, for example from Pkg.Json.DTO to
    JsonToDelphi.Runtime.DTO.
  • Added centralized type unification in
    JsonToDelphi.Generator.Core.TypeUnification. The model builder now handles
    numeric promotion, nullability, nested arrays and structural object merging,
    while validation remains responsible for JSON syntax and source locations.
  • Added TMatrix<T> and TObjectMatrix<T> to the Delphi runtime for
    two-dimensional scalar and object arrays. Both types own their row lists,
    while TObjectMatrix<T> also owns the objects contained in each row.
  • Added C# matrix generation through a self-contained Matrix<T> type derived
    from List<List<T>>. The type works directly with System.Text.Json without
    requiring a custom converter.
  • Added type-unification and matrix demo files covering numeric promotion,
    nullable values, structural object merging, scalar matrices, object
    matrices, empty rows and jagged matrices.
  • Simplified the generated demo project's JSON tree view from six legacy units
    to one shared VCL and FMX implementation while preserving the original JSON
    visualization features.

Fixes

  • Pasting JSON into the input editor no longer causes the application to become
    unresponsive due to recursive syntax highlighting.
  • Fixed memory leaks in generated two-dimensional object arrays. Generated
    Delphi code now uses TObjectMatrix<T> so both row lists and their objects
    have explicit ownership.
  • Added explicit Delphi JSON mapping for object matrices because Delphi's REST
    serializer cannot reliably deserialize TArray<TArray<TObject>> directly.
  • Fixed C# string properties being emitted as object instead of string.
  • Updated the demo-project template to include all required runtime units.
  • Updated the end-to-end project unit search paths for the reorganized
    generator library.