Closed mikeharder closed 1 month ago
Rule AvoidAdditionalProperties raised an error for the following swagger:
AvoidAdditionalProperties
"vmTags": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Hashtable that lists key/value pair tags to apply to the VMs" },
Currently, additionalProperties is only automatically allowed under properties named exactly tags:
additionalProperties
tags
https://github.com/Azure/azure-openapi-validator/blob/b95d5eb121c47ab3e110c97da23e583ebfd637ee/packages/rulesets/src/spectral/az-arm.ts#L297-L306
The proposal is to broaden the range of allowed properties, to anything matching regex [Tt]ags (or something similar that would allow vmTags).
[Tt]ags
vmTags
We may also need to align with RPC-Policy-V1-05 and RPC-Put-V1-23 which are mentioned here:
RPC-Policy-V1-05
RPC-Put-V1-23
https://github.com/Azure/azure-openapi-validator/blob/b95d5eb121c47ab3e110c97da23e583ebfd637ee/docs/avoid-additional-properties.md#related-arm-guideline-code
The status quo is to require suppressions for properties with names similar to (but not exactly) tags.
Spec PR: https://github.com/Azure/azure-rest-api-specs/pull/29101/checks?check_run_id=25631949240
CC: @markcowl, @almat-msft
We believe the root cause is more related to #652 than the name of the property.
Rule
AvoidAdditionalProperties
raised an error for the following swagger:Currently,
additionalProperties
is only automatically allowed under properties named exactlytags
:https://github.com/Azure/azure-openapi-validator/blob/b95d5eb121c47ab3e110c97da23e583ebfd637ee/packages/rulesets/src/spectral/az-arm.ts#L297-L306
The proposal is to broaden the range of allowed properties, to anything matching regex
[Tt]ags
(or something similar that would allowvmTags
).We may also need to align with
RPC-Policy-V1-05
andRPC-Put-V1-23
which are mentioned here:https://github.com/Azure/azure-openapi-validator/blob/b95d5eb121c47ab3e110c97da23e583ebfd637ee/docs/avoid-additional-properties.md#related-arm-guideline-code
The status quo is to require suppressions for properties with names similar to (but not exactly)
tags
.Spec PR: https://github.com/Azure/azure-rest-api-specs/pull/29101/checks?check_run_id=25631949240
CC: @markcowl, @almat-msft