forked from domaindrivendev/Swashbuckle.AspNetCore
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UseOneOfForPolymorphism (domaindrivendev#3155)
Fix second+ level inheritance for `UseAllOf`.
- Loading branch information
Showing
9 changed files
with
493 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/Swashbuckle.AspNetCore.TestSupport/Fixtures/BaseSecondLevelType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Swashbuckle.AspNetCore.TestSupport | ||
{ | ||
public class BaseSecondLevelType | ||
{ | ||
public string BaseProperty { get; set; } | ||
} | ||
|
||
public class SubSecondLevelType : BaseSecondLevelType | ||
{ | ||
public int Property1 { get; set; } | ||
} | ||
|
||
public class SubSubSecondLevelType : SubSecondLevelType | ||
{ | ||
public int Property2 { get; set; } | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
test/WebSites/NswagClientExample/Controllers/SecondLevelController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Swashbuckle.AspNetCore.Annotations; | ||
|
||
namespace NswagClientExample.Controllers | ||
{ | ||
[ApiController] | ||
[Route("[controller]")] | ||
public class SecondLevelController : ControllerBase | ||
{ | ||
[HttpPost] | ||
public int Create([FromBody]BaseType input) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
[SwaggerDiscriminator("discriminator")] | ||
[SwaggerSubType(typeof(SubSubType), DiscriminatorValue = nameof(SubSubType))] | ||
public abstract class BaseType | ||
{ | ||
public string Property { get; set; } | ||
} | ||
|
||
public abstract class SubType : BaseType | ||
{ | ||
} | ||
|
||
public class SubSubType : SubType | ||
{ | ||
public string Property2 { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.