-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add tests to account for tenant level APIs for all RPC rule for PUT operations #632
Conversation
docs/repeated-path-info.md
Outdated
Information in the URI should not be repeated in the request body (i.e. subscription ID, resource group name, resource name). | ||
|
||
## CreatedAt | ||
The '{property name}' already appears in the URI, please don't repeat it in the request body. Information in the URI must not be repeated in the request body (i.e. subscription ID, resource group name, resource name). |
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.
The '{property name}' already appears in the URI, please don't repeat it in the request body. Information in the URI must not be repeated in the request body (i.e. subscription ID, resource group name, resource name). | |
The '{property name}' property is in the URI, so it must not be in the request body. Information in the URI must not be repeated in the request body (i.e., subscription ID, resource group name, resource name). | |
``` #Resolved |
|
||
|
||
## Why the rule is important | ||
A PUT or Patch request must always have a request body defined. This rule applies to all ARM resources (Tracked and proxy). PUT and patch operations using an empty payload is not allowed in ARM. |
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.
A PUT or Patch request must always have a request body defined. This rule applies to all ARM resources (Tracked and proxy). PUT and patch operations using an empty payload is not allowed in ARM. | |
A PUT or PATCH request must always have a request body defined. This rule applies to all ARM resources (Tracked and Proxy). PUT and PATCH operations using an empty payload are not allowed in ARM. | |
``` #Resolved |
|
||
## How to fix the violation | ||
Add a request body for every PUT or Patch operation defined in your swagger. This request body must also match the response body of the PUT or Patch operation. |
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.
Add a request body for every PUT or Patch operation defined in your swagger. This request body must also match the response body of the PUT or Patch operation. | |
Add a request body for every PUT or PATCH operation defined in your swagger. This request body must also match the response body of the PUT or PATCH operation. | |
``` #Resolved |
## Bad example 2 | ||
|
||
Put without a request body | ||
Another Put operation without a request body |
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.
Another Put operation without a request body | |
Another PUT operation without a request body: | |
``` #Resolved |
## Bad example 1 | ||
|
||
Put without a request body | ||
PUT without a request body |
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.
PUT without a request body | |
PUT without a request body: | |
``` #Resolved |
|
||
## Bad examples | ||
|
||
```json |
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.
I noticed this in some other file, maybe it would remove the syntax error highlighting?
```json | |
```json5 | |
``` #Resolved |
## Output Message | ||
|
||
The tracked resource {resourceName} is beyond third level of nesting. | ||
|
||
## Description | ||
|
||
Tracked resources must not be used beyond the third level of nesting. |
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.
Should this be beyond the second level of nesting? Meaning tracked is ok for first (parent) and second level (child) resources, but not third level (grandchild). Make sure this is consistent with line 21.
Tracked resources must not be used beyond the third level of nesting. | |
Tracked resources must not be used beyond the second level of nesting. | |
``` #Resolved |
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.
Ah the description is inconsistent with the how to fix section. I will fix it.
|
||
Avoid the third level nested tracked resource, you should try to decrease the nested levels. | ||
Avoid the third level nested tracked resource. You may model such resources as proxy resources instead. Having a tracked resource beyond the third level may lead to a loss of functionality in ARM. |
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.
Third level is "beyond the second level".
Avoid the third level nested tracked resource. You may model such resources as proxy resources instead. Having a tracked resource beyond the third level may lead to a loss of functionality in ARM. | |
Avoid the third level nested tracked resource. You may model such resources as proxy resources instead. Having a tracked resource beyond the second level may lead to a loss of functionality in ARM. | |
``` #Resolved |
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.
Thats correct and thats the reason the third level must be avoided.
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.
Ah the description is inconsistent with the how to fix section. I will fix it.
docs/tracked-resource-schema-tags.md
Outdated
## Why the rule is important | ||
|
||
ARM requires all tracked resources to support taggability. | ||
Every tracked resource MUST support tags as an optional property. The specified tracked resource either does not have tags mentioned as a property or it is mentioned but marked as required. |
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.
Every tracked resource MUST support tags as an optional property. The specified tracked resource either does not have tags mentioned as a property or it is mentioned but marked as required. | |
Every tracked resource **must** support `tags` as an **optional** property. The specified tracked resource either does not have `tags` as a property or has `tags` marked as required. | |
``` #Resolved |
|
||
Adding the put operation for tracked resource, or remove the resource definition if it's useless. | ||
Add the PUT operation for a tracked resource or make the resource proxy if it cannot be created by the end user. |
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.
Add the PUT operation for a tracked resource or make the resource proxy if it cannot be created by the end user. | |
Add a PUT operation for the tracked resource or make the resource's routing type proxy if it cannot be created by the end user. | |
``` #Resolved |
This PR is to ensure coverage of all the RC rules for PUT operations for tenant level APIs. No changes to the rules were necessary and a bunch of tests were added to test for coverage wherever relevant.