Skip to content

Version 3.1

Compare
Choose a tag to compare
@JensBorrisholt JensBorrisholt released this 20 Jan 06:16
· 39 commits to master since this release
2e119a4

Features

  • Upgrade to Delphi 12
  • Added Clone function on TJsonDTO class
  • More interceptors where published in a new repo: https://github.com/JensBorrisholt/Json-Interceptors
  • Added the possibility to download Pkg.Json.DTO.pas from www.Json2Delphi.com
  • Added ASP.NET interface: www.Json2Delphi.com
  • Source code included
  • New property attribute : [SuppressZero]
    Delphi doesn't support Nullable types, so use this attribute to strip TDateTime property where value is 0.
    A Small example:
type
  TDateTimeDTO = class(TJsonDTO)
  private
    [SuppressZero]
    FSuppressDate: TDateTime;
    FNoSuppressDate: TDateTime;
  public
    property DateSuppress: TDateTime read FSuppressDate write FSuppressDate;
    property NoDateSuppress: TDateTime read FNoSuppressDate write FNoSuppressDate;
  end;

The above class will generate the following JSON, if both properties is 0

  {
    "suppressDate":"",
    "noSuppressDate":"1899-12-30T00:00:00.000Z"
  }

NOTE: You can turn off this feature in the settings form

  • Added unit tests for updating elements in lists.

Bugs:

  • Unittest TestDateTime didnt pass under Delphi 12
  • Added missing Reserved words
  • Wrong type detection. '2019-08-29' wasn't recognized as a Date, but a string
  • All unittests didn't pass
  • In the generator main form, the correct JSON wans't allways read from the MEMO
  • In the generator main form, the JSON wasn't allways updated
  • An error message occured when switching between the diffrent demo files
  • Dates without timestamp wasn't recognized within the RegEx
  • Compile error in unit tests
  • Updated elements in a list wasn't applied to the generated json.
  • Issue #2 Out of memory error and High CPU usage - Thank You MarkRSill
  • The same class name could appear multiple times:

E.g this JSON generated faulty code:

{
    "/": {
        "readonly": true
    },
    "\\": {
        "readonly": true
    }
}