-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Do not omit type and name while serializing the resource object. #4007
Conversation
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-jsNothing to generate for azure-sdk-for-js |
Automation for azure-sdk-for-javaNothing to generate for azure-sdk-for-java |
Automation for azure-sdk-for-nodeThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-rubyThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-goNothing to generate for azure-sdk-for-go |
Can one of the admins verify this patch? |
@@ -1456,12 +1456,10 @@ | |||
}, | |||
"name": { | |||
"type": "string", | |||
"readOnly": true, |
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.
Just to be sure, are all resources here supposed to have name
, id
and type
as settable properties here?
If yes, please remove the x-ms-azure-resource
flag her, if not, please identify those resources which do have name
, id
and type
as settable and create a separate Resource
definition for them.
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.
name, id and type should all be readonly. These fields should be generated from the URI on resource creation and are not required as input from the user. Is this not the case for the RP runtime, which requires these to be writable?
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.
We talked offline, approved
There is no description as to why this change is needed, and as such I'm having a hard time understanding what the broken scenario is. The change looks odd to me as the name and id property of a tracked resource is indeed read-only. |
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.
We talked offline, approved
@@ -1456,12 +1456,10 @@ | |||
}, | |||
"name": { | |||
"type": "string", | |||
"readOnly": true, |
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.
We talked offline, approved
Since this may cause breaking changes in generated SDKs, I'd like to better understand the justification. @RyanBensonMSFT, @tatlicioglu, can you please share why this is needed? |
Typically performing CRUD operations on nested resources within the context of a parent resource isn't supported across ARM. If you look at MS.Compute/VM/Extensions, they're returned in the Get of a parent VM (as an optimized read) but you can't change them from that context, you have to perform CRUD on each extension directly. This allows for native support of core ARM constructs like RBAC, template deployment, policy... |
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.
LGTM
But this affects more than deep put scenarios, no? It also makes the properties at the parent resource become non-read-only? |
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger