Open kant2002 opened 3 years ago
Did you ever happen to find out more about it, @kant2002? Hitting the same issue here, it seems.
@MarcStoecker I suspect this is due to fact that multiple content type specified in GET.
Thanks for the hint! Looks like you are right. I tried to step through and patch it but it seems to involve a fair bit more that just a few tweaks. 😞
Okay, upon further investigation I am very certain, that [FromBody] and expecially [FromForm] cause this. Doesn't matter if using built-in or custom bindings.
Can confirm that [FromForm] causes this, I just stumbled across this too
We don't support GroupSchema in https://github.com/Azure/autorest.csharp/blob/feature/v3/src/AutoRest.CSharp/Common/Generation/Types/TypeFactory.cs#L43.
Here is a minimum swagger repo case: https://gist.github.com/chamons/6937d8370a47340680565e0e362d7231
If you remove:
"x-ms-parameter-grouping": {
"postfix": "Options"
}
then I don't crash here (it gets angry from my hacking and slashing the response type to get a small sample).
And on the original is down to this: https://gist.github.com/chamons/56487bf0c7d0aa7c96927d377976f644
Experience crash in AutoRest
Yaml file
Swagger.json attached.
sample.txt