Reputation: 1199
I am using autorest to on my swagger.json file. I have run into a problem where autorest does not like my swagger.json file.
The issue is that the swagger.json file contains
"parentType": {
"allOf": [
{
"$ref": "#/definitions/MyClass"
}
]
}
It works as
"parentType": {
"$ref": "#/definitions/MyClass"
}
Is there anyway I can get swashbuckle to generate the later code?
Upvotes: 1
Views: 1078
Reputation: 3003
In newer version of Swashbuckle.AspNetCore
for disabling allof
you can remove
options.UseAllOfToExtendReferenceSchemas();
in Swagger configuration in Startup
or Program.cs
. as you can see in new comments on https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1488 and https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/issues/13
Upvotes: 0
Reputation: 1199
It seems to be a breaking change from RC5 of swashbuckle to v5
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1488
Upvotes: 2