I'm working on a middleware using golang. I'm consuming a REST-API which returns a Date in form of a LocalDateTime (e.g. "created": "2022-01-09T00:00:00",) and it should get mapped into an protoc message with the data class google/protobuf/timestamp.proto as we don't want to do the converting in the frontend. But apparently the timestamp.proto only supports DateTime with a timezone (so like that "created": "2022-01-09T00:00:00Z...") but as its an external API I'm consuming I cant change their datatype to DateTime. Does anyone know how to find and elegant solution without doing the complete mapping/unmashalling process manually?
That's the protoc message: google.protobuf.Timestamp created = 7 [json_name = "created"];
That's the unmashaller we're using: err = protojson.Unmarshal(body, protoMessageClass)
That's the error I'm getting: ERROR: proto: (line ...): invalid google.protobuf.Timestamp value "2021-12-07T00:00:00""