-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Describe the bug
To Reproduce
Given a proxy resource (such as inherited from common type ProxyResource) which has a top-level property location:
model ProxyAccount is ProxyResource<ProxyAccountProperties> {
name: string;
location: ProxyAccountLocation;
}
union ProxyAccountLocation {
Global: "global",
string,
}
@armResourceOperations
interface ProxyAccounts {
get is ArmResourceRead<ProxyAccount>;
create is ArmResourceCreateOrReplaceAsync<ProxyAccount>;
update is ArmResourcePatchAsync<ProxyAccount, ProxyAccountProperties>;
delete is ArmResourceDeleteWithoutOkAsync<ProxyAccount>;
listByResourceGroup is ArmResourceListByParent<ProxyAccount>;
listBySubscription is ArmListBySubscription<ProxyAccount>;
}
What results in the following swagger:
"ProxyAccount": {
"type": "object",
"description": "Proxy account",
"properties": {
"properties": {
"$ref": "#/definitions/ProxyAccountProperties",
"description": "The resource-specific properties for this resource."
},
"location": {
"$ref": "#/definitions/ProxyAccountLocation",
"description": "Proxy account location",
"x-ms-mutability": [
"read",
"create"
]
}
},
"required": [
"location"
],
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
}
]
}triggers the following Linter rule RequestSchemaForTrackedResourcesMustHaveTags
A tracked resource MUST always have tags as a top level optional property. Tracked resource does not have tags in the request schema.
Steps to reproduce the behavior:
Expected behavior
The rule should not infer the resource's type (tracked vs proxy) by the presence of a top-level property location.
Instead, it should check whether the resource inherits a common type first, and only if doesn't then fall back to the current logic.
Metadata
Metadata
Assignees
Labels
No labels