-
Notifications
You must be signed in to change notification settings - Fork 46
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
[AvoidAdditionalProperties] Current implementation may be overly strict, or causing more noise than value #652
Comments
To clarify, there are two scenarios we should support, from the reference above:
"additionalProperties": true "additionalProperties": {} "additionalProperties": {
"type": "object"
} "additionalProperties": {
"properties": {
"prop1": "string"
}
} |
Rule We should review the history of the rule, both its intentions and the implementation, and compare to the alternate proposal suggested by Mark above. |
For ARM APIs, we consider additionalProperties as an anti-pattern because it allows service teams to add or remove support for certain keys in the dictionary without any warning. The only usecase where we want to allow the pattern is when we are reviewers determine through a scenario discussion that the keys of the dictionary are user defined, the keys are not subject to any validation by the service and that the contents of the dictionary are a pass through for the control plane service. This kind of constraint cannot be specified in swagger, so we want this rule to be flagged as an error that intentionally forces a scenario discussion. |
@rkmanda: Azure SDK will not make any functional changes to this rule until there is consensus with ARM. I did make a recent change to this rule, to only report errors at the source, rather than everywhere the definition is referenced: #700 This should reduce noise while ensuring all instances of |
Describe the bug
False alert for AvoidAdditionalProperties.
To Reproduce
It marked the AdditionalProperties in our dictionary properties in the request body. Based on https://swagger.io/docs/specification/data-models/dictionaries/, additionalProperties is just part of the dictionary syntax, not the real property that named AdditionalProperties.
Expected behavior
It should not raise the flag for our additionalproperties that defined in our dictionary property
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: