[v3] Skip flattening if properties would clash#3801
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
f614057 to
a34074d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3801 +/- ##
==========================================
- Coverage 57.00% 56.87% -0.13%
==========================================
Files 78 78
Lines 12035 12078 +43
==========================================
+ Hits 6860 6869 +9
- Misses 4675 4709 +34
Partials 500 500 ☔ View full report in Codecov by Sentry. |
mikhailshilkov
left a comment
There was a problem hiding this comment.
Is there a way to see the effects in 3.0?
There should be, by combining this change and the v3 branch and running schemagen, but at the moment that fails for unrelated reasons. |
|
codecov actually indicates a few lines that might be interesting to check out, but I live up to you to decide what's worth it. |
8bd9e5a to
d74d472
Compare
danielrbradley
left a comment
There was a problem hiding this comment.
I'm also struggling to parse the diff. I also wonder if a first refactor commit to pull out a function could make the actual change more clear and remove the need for the extra level of nesting.
d74d472 to
b5b0a21
Compare
656fb9b to
03eb873
Compare
03eb873 to
0bc1091
Compare
I don't think this is a good investment of time. The code is quite convoluted and half of it (v2) will be removed soon anyways. It's more important here that there is a single code block to remove post v3 for simple cleanup, as Mikhail also pointed out above. |
|
Superseded by #3839 |
Skip the flattening of nested properties indicated by [x-ms-client-flatten](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-client-flatten) if it would lead to overwriting a property, creating incorrect schema and SDKs. This case happens when inner and outer property have the same name. For a report on all occurrences see #3013. This change is breaking and could therefore only be applied to v3 of the provider. The PR is written to be reviewed commit by commit. It supersedes the previous #3801. **I recommend hiding whitespace when reviewing since the level of indentation of otherwise unaffected code changed.** Resolves #3195
Skip the flattening of nested properties indicated by x-ms-client-flatten if it would lead to overwriting a property, creating incorrect schema and SDKs. This case happens when inner and outer property have the same name. For a report on all occurrences see #3013.
This change is breaking and could therefore only be applied to v3 of the provider.
Resolves #3195