-
I have a semi-weird case where a third party API spec has defined it schema as string and "date-time", and kiota correctly interprets this as a DateTimeOffset. HOWEVER, the API Spec specifically states that the format string MUST be "Z" and NOT +00:00 (or any other offset for that matter). Is there ANY way to change my implementation so that the JSON we generate use the format required by the API? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hi @esbenbach Which language are you using? |
Beta Was this translation helpful? Give feedback.
-
Since we already create a HttpClientRequestAdapter our solution is currently to do as follows: var jsonSerializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);
jsonSerializerOptions.Converters.Add(new CustomDateTimeOffsetConverter());
var ctx = new KiotaJsonSerializationContext(jsonSerializerOptions);
var serializationWriterFactory = new JsonSerializationWriterFactory(ctx);
var adapter = new HttpClientRequestAdapter(authentication, serializationWriterFactory: serializationWriterFactory, httpClient: this.httpClient)
{
BaseUrl = $"{account.BaseUrl}"
}; I have no idea if this is the most appropriate way, nor do I have any idea what the approach would be if using the default request adapter. |
Beta Was this translation helpful? Give feedback.
Since we already create a HttpClientRequestAdapter our solution is currently to do as follows:
I have no idea if this is the most appropriat…