Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/body-top-level-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ARM OpenAPI(swagger) specs
## Description

Top level properties should be one of `name`, `type`, `id`, `location`, `properties`, `tags`, `plan`, `sku`, `etag`,
`managedBy`, `identity`, `systemData`, `extendedlocation`. Per [ARM guidelines](https://github.com/cloud-and-ai-microsoft/resource-provider-contract/blob/master/v1.0/resource-api-reference.md),
`managedBy`, `managedByExtended`, `identity`, `kind`, `zones`, `systemData`, `extendedLocation`. Per [ARM guidelines](https://github.com/cloud-and-ai-microsoft/resource-provider-contract/blob/master/v1.0/resource-api-reference.md),
top level properties of a resource should be only ones from the allowed set.

## How to fix
Expand Down
2 changes: 1 addition & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Please refer to [body-properties-names-camel-case.md](./body-properties-names-ca
### BodyTopLevelProperties

Top level properties should be one of `name`, `type`, `id`, `location`, `properties`, `tags`, `plan`, `sku`, `etag`,
`managedBy`, `identity`, `systemData`, `extendedlocation`. Per [ARM guidelines](https://github.com/cloud-and-ai-microsoft/resource-provider-contract/blob/master/v1.0/resource-api-reference.md),
`managedBy`, `managedByExtended`, `identity`, `kind`, `zones`, `systemData`, `extendedLocation`. Per [ARM guidelines](https://github.com/cloud-and-ai-microsoft/resource-provider-contract/blob/master/v1.0/resource-api-reference.md),
top level properties of a resource should be only ones from the allowed set.

Please refer to [body-top-level-properties.md](./body-top-level-properties.md) for details.
Expand Down
5 changes: 5 additions & 0 deletions packages/rulesets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log - @microsoft.azure/openapi-validator-rulesets

## 2.2.3

### Patches

- [BodyTopLevelProperties] Add "managedByExtended" to allowed list of top-level properties
## 2.2.2

### Patches
Expand Down
2 changes: 1 addition & 1 deletion packages/rulesets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft.azure/openapi-validator-rulesets",
"version": "2.2.2",
"version": "2.2.3",
"description": "Azure OpenAPI Validator",
"main": "dist/index.js",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function* armResourcePropertiesBag(openapiSection: any, options: {}, ctx:
"sku",
"etag",
"managedby",
"managedbyextended",
"identity",
"kind",
"zones",
Expand Down Expand Up @@ -144,6 +145,7 @@ export function* bodyTopLevelProperties(openapiSection: any, options: {}, ctx: R
"sku",
"etag",
"managedby",
"managedbyextended",
"identity",
"kind",
"zones",
Expand All @@ -155,7 +157,7 @@ export function* bodyTopLevelProperties(openapiSection: any, options: {}, ctx: R
if (!allowedBodyTopLevelProperties.includes(propName.toLowerCase())) {
yield {
location: ["definitions", re.modelName],
message: `Top level properties should be one of name, type, id, location, properties, tags, plan, sku, etag, managedBy, identity, zones. Model definition '${re.modelName}' has extra properties ['${propName}'].`,
message: `Top level properties should be one of name, type, id, location, properties, tags, plan, sku, etag, managedBy, managedByExtended, identity, kind, zones, systemData, extendedLocation. Model definition '${re.modelName}' has extra properties ['${propName}'].`,
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@
"type": "string",
"description": "The escaped name of the namespace."
},
"managedByExtended": {
"type": "array",
"items": {
"type": "string"
},
"description": "The fully qualified resource IDs of the resources that manage this resource"
},
"classification": {
"$ref": "#/definitions/NamespaceClassification",
"description": "Kind of namespace"
Expand Down
Loading