Liam
Liam

Reputation: 1199

Swashbuckle.AspNetCore stop using allOf

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

Answers (2)

sorosh_sabz
sorosh_sabz

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

Liam
Liam

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

Related Questions