Spectrum Technology Platform

 View Only
  • 1.  Posting DateTime data in JSON Rest Service

    Posted 11-26-2021 16:41
    Hello,

    We use Spectrum MDM / DQ version 2020.1.0.

    I published a spectrum service that has JSON as input. I tried to post a DateTime value in the json file (using multiple date format : yyyy-MM-dd hhh:mm:ss, MM/dd/yyyy ..... ) but unfortunately I got the same error message :

    Message :
    Cannot construct instance of `com.pb.spectrum.api.datetime.DateTime` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('2021-01-01 00:00:00')

    Regards

    ------------------------------
    mamraoui mamraoui
    Knowledge Community Shared Account
    ------------------------------


  • 2.  RE: Posting DateTime data in JSON Rest Service

    Employee
    Posted 11-29-2021 03:40
    Edited by Eric Hubert 11-29-2021 04:03
    Hi Merouane
    Try the below json message  that should feed the DateTimeServiceInput DateTime variable of your service.
     
    {"Input": {"Row":
    [{
    "DateTimeServiceInput": {
                    "year": 2021,
                    "month": 11,
                    "day": 26,
                    "hour": 18,
                    "minute": 0,
                    "seconds": 0
                }
    }]
    }}

    Date variable will work in similar way with year,month,day.
    Another option is to use a String variable that you can then transform into date type in your DF

    ------------------------------
    Eric Hubert
    Sales Engineer
    Precisely