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

Do not omit type and name while serializing the resource object. #4007

Merged
merged 1 commit into from
Sep 26, 2018
Merged

Do not omit type and name while serializing the resource object. #4007

merged 1 commit into from
Sep 26, 2018

Conversation

ttlcgl
Copy link
Contributor

@ttlcgl ttlcgl commented Sep 26, 2018

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

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Sep 26, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2899

@AutorestCI
Copy link

AutorestCI commented Sep 26, 2018

Automation for azure-sdk-for-js

Nothing to generate for azure-sdk-for-js

@AutorestCI
Copy link

AutorestCI commented Sep 26, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

@AutorestCI
Copy link

AutorestCI commented Sep 26, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#3708

@AutorestCI
Copy link

AutorestCI commented Sep 26, 2018

Automation for azure-sdk-for-ruby

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-ruby#1581

@AutorestCI
Copy link

AutorestCI commented Sep 26, 2018

Automation for azure-sdk-for-go

Nothing to generate for azure-sdk-for-go

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@@ -1456,12 +1456,10 @@
},
"name": {
"type": "string",
"readOnly": true,
Copy link
Contributor

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.

Copy link
Contributor

@ryansbenson ryansbenson Sep 26, 2018

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked offline, approved

@dsgouda dsgouda added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Sep 26, 2018
@johanste
Copy link
Member

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.

Copy link
Contributor

@ryansbenson ryansbenson left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked offline, approved

@johanste
Copy link
Member

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?

@ryansbenson
Copy link
Contributor

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...
After talking to Mehmet, I understand where you are now and understand this mitigation.

@KrisBash KrisBash added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Sep 26, 2018
Copy link
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dsgouda dsgouda merged commit 07af8ad into Azure:master Sep 26, 2018
@johanste
Copy link
Member

But this affects more than deep put scenarios, no? It also makes the properties at the parent resource become non-read-only?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants