OpenApi fails to use a model with a property named Aliases
See original GitHub issueHi guys, so, I have this model in my solution:
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
public List<Aliases> Aliases { get; set; }
}
public class Aliases
{
public DateTime Date { get; set; }
}
}
If I try to add this property to the Function:
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "text/plain", bodyType: typeof(List<WeatherForecast>), Summary = "The response", Description = "This returns a weatherList")]
And if I try to check the Function Swagger, I get this error:
If I change the name, the error disappears. For example, If I change the property name to Alias I have no problem, but if I make it Aliases it just gives me that error.
Can someone confirm whether or not this word is somehow reserved or is being used in the code and it’s giving this error?
I don’t know if this is actually related to this, but the azure functions open API extension solution has these 2 js Swagger Files that might be excluding the name:
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (10 by maintainers)
Top GitHub Comments
Thanks for the confirmation. Let me have a look.
That’s interesting! I will try this issue, but i’m not sure that solve or not.