-
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 ProtectionMode to Microsoft.Security applicationWhitelistings #7243
Conversation
In Testing, Please Ignore[Logs] (Generated from 16c7d5f, Iteration 10)
|
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Can one of the admins verify this patch? |
Automation for azure-sdk-for-goA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, |
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.
This seems to represent a mapping from file type (enum) to protection mode which seems like an enum also. Generally, using additionalProperties
is discouraged because it makes APIs harder to use. In you case, you could model each file type as an optional property in this object and let the value be a protection mode enum type. This option would preserve the current shape of the object over the wire.
Another option would be to model this as an array of objects with 2 properties: file type and protection mode.
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.
@majastrz , Done
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.
There are few potential new ARM errors, property names should be camel case. See this report https://dev.azure.com/azure-sdk/public/_build/results?buildId=114422&view=logs
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.
Added a comment. Please take a look.
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.
Signed off from ARM side.
@anuchandy can you please complete the merge ? |
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.
Please review linter errors related to not using camelcase for property names
i cant make the properties camelCase because they are a defined Enum |
@erelh The json "property names/keys" over the wire is suppose to follow camelCase. In the server code, it can be camelCase, PasalCase or any format but over wire it is suppose to be in camelCase. For example: This is valid (
But below one not, because
This is based on ARM rule 3016. Adding @majastrz to comment. |
While the property names are logically values of the enum, you can still make them lowerCaseCamelCase. In the backend, you can have case-insensitive parsing, so it shouldn't really be a problem. |
in C#, Enum parsing is case sensitive can you please suggest a different method of defining this property ? as it is a key-value |
In general, there is some control in C# over enum parsing. Unfortunately, that's not possible if you're deserializing as Regardless of that, the API should be designed up-front and the service should then be implemented ot match - not the other way as you're trying here. ARM is expecting property names to be case insensitive for the most part, so if we made your API case-sensitive, it will be inconsistent. You should change the service to be case-insensitive. One way to do this would be to get rid of the dictionary since you have a small set of properties and simply model it as 4 properties: |
OK, changed |
Latest improvements:
MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.
Contribution checklist:
ARM API Review Checklist
Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs.
Please follow the link to find more details on API review process.