-
Notifications
You must be signed in to change notification settings - Fork 35
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
[v3] Skip flattening if properties would clash #3016
Draft
thomas11
wants to merge
5
commits into
master
Choose a base branch
from
tkappler/flatten-without-conflict
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
thomas11
requested review from
danielrbradley,
mjeffryes,
a team and
mikhailshilkov
January 12, 2024 17:45
Does the PR have any schema changes?Found 123 breaking changes: Resources
New resources:
New functions:
|
thomas11
force-pushed
the
tkappler/flatten-without-conflict
branch
from
January 12, 2024 20:18
1cea3da
to
7d47186
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, in principle the approach looks good for a breaking change in the next release.
Did you managed to identify is this is the same approach taken by official Azure tools when encountering the conflicts with flattening?
thomas11
added a commit
that referenced
this pull request
Jan 24, 2024
…3007) Support DefenderForStorageSettings resource by adding the default state to reset it to on delete, since it doesn't have an actual delete operation. Without the hard-coded exception in the last commit, the generated schema is incorrect. The cause is unrelated to the PR. What's happening is that [the Azure spec](https://github.com/Azure/azure-rest-api-specs/blob/fa8683f6725e5447cc808420c4542ce8375f0325/specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/defenderForStorageSettings.json) is defined as such (unrelated properties omitted): ```json "properties": { "isEnabled": { "type": "boolean", "description": "Indicates whether Defender for Storage is enabled on this storage account." }, "sensitiveDataDiscovery": { "x-ms-client-flatten": true, "$ref": "#/definitions/SensitiveDataDiscoveryProperties" } } ``` Where SensitiveDataDiscoveryProperties is: ```json "properties": { "isEnabled": { "type": "boolean", "description": "Indicates whether Sensitive Data Discovery should be enabled." } } ``` The nested object is annotated with x-ms-client-flatten, causing the object to be flattened, causing the two identical `isEnabled` properties to collide. #3016 will fix this in v3. In the meantime, I added a manual exception. Resolves #2996
thomas11
changed the title
Skip flattening if properties would clash
[v3] Skip flattening if properties would clash
Feb 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. The purpose of the PR is mainly to illustrate the SDK changes that would result.
Note: remember to remove exception added in #3007.