danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.
Apache License 2.0
1.23k stars 356 forks source link

Fixes serialization of enumerations from dataset #755

Closed zaniniflz closed 3 months ago

zaniniflz commented 4 months ago

@danieleteti

I found a problem serializing datasets for classes that contain enumerators.

By default, enumerators in Delphi can have 1, 2, or 4 bytes when stored in memory, depending on their values.

In the current implementation, the value is typecast to Integer, which has 4 bytes. If the enumerator has only 1 byte, the memory will be overwritten, causing values from other fields to be lost.