[fpc-pascal] Request to make TJSONStreamer.StreamProperty virtual

Michael Van Canneyt michael at freepascal.org
Mon Oct 17 09:48:20 CEST 2022



On Mon, 17 Oct 2022, Michael Van Canneyt via fpc-pascal wrote:

>
>
> On Mon, 17 Oct 2022, Hairy Pixels via fpc-pascal wrote:
>
>> For the JSON RPC library I wanted to supported dynamic arrays but in order 
>> to do this I needed to duplicate TJSONStreamer's ObjectToJSON  and 
>> StreamProperty in order to bypass some exceptions. If StreamProperty was 
>> virtual I could simply override that and stream the dynamic arrays before 
>> calling inherited.
>> 
>> What do you think about that?
>
> It would be a much better idea to implement the streaming of dynamic arrays
> directly. Then the exceptions are maybe not necessary in the first place...

Small follow-up:

If you want to extend it, you can find the necessary code in the restbase
unit. It already implements the necessary code to (de)stream arrays, plus
some other enhancements as well. It's on my TODO list to merge the
implementations taking TJSONStreamer as a base, but if you are busy with 
this maybe you can provide a patch...

Michael.


More information about the fpc-pascal mailing list