fix minimal api json options not being respected#3378
fix minimal api json options not being respected#3378ItsVeryWindy wants to merge 6 commits intodomaindrivendev:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3378 +/- ##
==========================================
+ Coverage 94.28% 94.31% +0.02%
==========================================
Files 110 114 +4
Lines 3816 3833 +17
Branches 722 722
==========================================
+ Hits 3598 3615 +17
Misses 218 218
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b36b5b3 to
02e924f
Compare
|
I should be able to review this next week. |
4d21b15 to
1938952
Compare
|
Holding this after #3428 is merged so we can bundle the new APIs in the same release. |
7947d48 to
208d419
Compare
208d419 to
8d21851
Compare
|
This pull request is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further changes are made. |
8d21851 to
b0baf6d
Compare
|
This pull request is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further changes are made. |
|
This pull request is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further changes are made. |
|
This pull request is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further changes are made. |
Pull Request
The issue or feature being addressed
Fixes #2293
Details on the issue fix or feature implementation
This changes how it detects which JsonOptions is used. Both sets of JsonOptions default to the same value, so if none are configured it won't make any difference. This attempts to detect which one is in use based on which one has been configured.
In addition I've added some methods to force it one way or the other.
One possible issue with this approach is if for example a library had to configure json options they may opt to do both for broader support and then you're back to not know which one.
As an alternative approach, we could try and detect based on the
ApiDescription, if it's from a controller, use mvc options, or use the other one. This is also not without problems, as if someone used the same types between mvc and minimal apis, depending on the order they're processed in you'd possibly get different results if they are configured differently.