Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of JsonPolymorphic and JsonDerivedType attributes #3170

Merged
merged 6 commits into from
Nov 25, 2024

Conversation

k0ka
Copy link
Contributor

@k0ka k0ka commented Nov 23, 2024

The issue or feature being addressed

supersedes #2671

Details on the issue fix or feature implementation

  • Added checks for System.Text.Json polymorphic attributes in the same handlers, where swagger native attributes are handled. Swagger attributes have priority over System.Text.Json ones.

  • Added this case to NSwagClientExample integration test

  • Refactored the way Basic and NSwagClientExample tests run. They both have different outputs for .net6 and .net8/9. I made a different theory for such tests in .net6 mode. The redudant SwaggerEndpoint_ReturnsValidSwaggerJson_Basic_DotNet_8 was deleted, as it is handled by the main SwaggerEndpoint_ReturnsValidSwaggerJson

Fix integration Basic and NSwagClientExample tests to have different outputs for .net6
k0ka and others added 3 commits November 23, 2024 15:00
fix `SwaggerEndpoint_ReturnsValidSwaggerJson_DotNet6` test - it wasn't using parameters
@martincostello martincostello added this to the v7.0.1 milestone Nov 24, 2024
@martincostello
Copy link
Collaborator

Before I merge this, could you copy-over the changes to the README about how this works please?

https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/2671/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

@k0ka
Copy link
Contributor Author

k0ka commented Nov 24, 2024

added Readme

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@martincostello
Copy link
Collaborator

Resolves #2571.

@martincostello martincostello merged commit a87fb1d into domaindrivendev:master Nov 25, 2024
9 checks passed
@martincostello martincostello linked an issue Nov 25, 2024 that may be closed by this pull request
@alainkaiser
Copy link

Yeah, this is actually nice! Thanks guys!

@schnerring
Copy link
Contributor

Thanks for picking up my PR and finishing the work. Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Text.JSON polymorphic behaviour not supported
4 participants