-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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 UserMetricsModel to exception list for missing readOnly attribute. #4003
Conversation
Automation for azure-sdk-for-jsNothing to generate for azure-sdk-for-js |
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-javaNothing to generate for azure-sdk-for-java |
Automation for azure-sdk-for-nodeThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-rubyThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-goNothing to generate for azure-sdk-for-go |
Can one of the admins verify this patch? |
- suppress: RequiredPropertiesMissingInResourceModel | ||
reason: This will cause breaking changes in .NET SDK | ||
from: trafficmanager.json | ||
where: $.definitions.UserMetricsModel |
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.
@tatlicioglu - this is to suppress the following ARMViolation I guess:
RequiredPropertiesMissingInResourceModel/R2020/ARMViolation: Model definition 'UserMetricsModel' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly.
Looking at the definition of UserMetricsModel it does have name, id and type
in the hierarchy (UserMetricsModel -> ProxyResource -> Resource), but id
is not readonly.
As mentioned in the suppression reason, adding readonly attribute for Resource::id will cause breaking change in the SDK (e.g. ctr for UserMetricsModel will break) that requires a major version bump for the SDK. A major version upgrade of SDK for such a small change doesn't worth.
So we might want add the work of marking id as readonly
as a TODO in major version upgrade work items. At this point i'm not sure when that happens. Maybe we should introduce a process of cleaning the swaggers once in a semester or so where we fix all these issues and do a major version upgrade. Something that needs to be discussed within the team.
It looks like there are bunch of other models (Endpoint, Profile, TrafficManagerGeographicHierarchy & HeatMapModel) inherits from Resource has RequiredPropertiesMissingInResourceModel
. Any reason not to suppress violations for those models?
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.
Reviewed
@dsgouda looks like we merged this, but my question on models is not addressed. What's exactly this PR solves by suppress ing violation on one model when there exits other models with similar violation? |
@anuchandy We discussed these concerns with @tatlicioglu and @RyanBensonMSFT and decided to move forward with this change as a hotfix. Moving forward the TrafficManager RP will be modelling these models in a way that it doesn't violate rules around Resources |
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger