#1 2017-09-15 09:13:04

mwore
Member
Registered: 2017-09-15
Posts: 5

Service Method Parameters JSON format

Hello,

service method parameter TDateTime is currently transmitted as JSON number.
Is it possible to transmit TDateTime as ISO 8601 text?

I want to use Synopse as a custom REST server for JavaScript client and it would be more convenient to transmit all date/time values as ISO 8601 text.

Thanks!

Last edited by mwore (2017-09-15 14:16:04)

Offline

#2 2017-09-18 09:36:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: Service Method Parameters JSON format

Are you talking about interface-based service?

In this case, you should do the text conversion by hand, and define the parameter as RawUTF8.
You may define your own type:

type TMyIso8601 = type RawUTF8;

Offline

#3 2017-09-18 10:01:21

mwore
Member
Registered: 2017-09-15
Posts: 5

Re: Service Method Parameters JSON format

So there is no way to override default TDateTime formatting without defining my own type? I was hoping to reuse my existing classes without any type modifications.

Thanks!

Offline

#4 2017-09-18 11:53:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: Service Method Parameters JSON format

Currently, there is no such possibility.

I will try to add this feature soon.

Offline

Board footer

Powered by FluxBB