Closed mbursill closed 1 month ago
Hi @mbursill Thanks for using kiota and for reaching out. Can you share the description/schema for that model please?
The schema: swagger.json
It was generated from a C# API with a very simple model:
public class UpdateWidgetRequest
{
public UpdateWidgetRequest() { }
public string? Name { get; set; }
public int? Size { get; set; }
public DateOnly? InspectionDate { get; set; }
public int? Mass { get; set; }
}
It was tested on Kiota 1.13, 1.14 and the latest preview.
Thanks for the additional information. It appears the generated OAS description is not what kiota would expect here. Instead of having a component schema for DateOnly being used as the referenced schema for InspectionDate, the property should be of type string and format date. See the OAS format registry
Maybe @captainsafia can help us here (from the ASP.net team)
Looks like this got a recent fix:
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/2799
The latest 6.6.1 release of Swashbuckle.AspNetCore generates the correct OAS.
Thanks for the additional information. So the right code gets generated now? Good to close?
Yes, all good now.
Generated code for a model that includes a DateOnly type (from C#) is including the following fields:
However, the
deserializeIntoDateOnly
call is expecting aPartial<DateOnly>
where theDateOnly
ends up being seen as the one from the abstractions library. The abstractions version doesn't contain the above fields. This is a name conflict on the generated DateOnly type vs the class from the abstractions library.