update RA calls to new version#2031
Conversation
|
If code is regenerated using this tag, code will have breaking changes. This problem can be avoided if a new tag for Refers to: specification/authorization/resource-manager/readme.md:34 in 2996419. [](commit_id = 2996419, deletion_comment = False) |
| }, | ||
| "description": "Provider operations metadata list" | ||
| }, | ||
| "RoleAssignmentPropertiesWithScope": { |
There was a problem hiding this comment.
RoleAssignmentPropertiesWithScope [](start = 5, length = 33)
Removing operations from an existing API version will cause breaking changes on generated code.
It is better to create a file with the operations that will be modified in the next API version, so the tag for 2015 version calls this two files (operations that wont change, and operations that will change), and the tag for 2017 version calls the other two files (the one with the unmodified operations and the one with the modified operations).
There was a problem hiding this comment.
Since we would need the 2017 tag's[as per above] generated files for sdk-for-net.How would this work if we have two tags?
which generated files will be used by sdk-for net then?
There was a problem hiding this comment.
In the Basic Information section you can specify which tag is the default one to generate.
There was a problem hiding this comment.
thanks,will update the pr as per the comments then
|
@mcardosos Also since there wasnt any examples files before,is it mandatory in this pr to include those files for the build to pass? |
|
@darshanhs90 I would prefer for the examples to be included here. |
|
@mcardosos Have added the examples for all,but there seems to be some error in the build stating message: 'Equivalent path already exists: /{roleDefinitionId}',even though there is only one path like that. |
|
@mcardosos DO let me know if there is anything else that needs to be done for the PR to get merged #Resolved |
| "description": "Role definition properties." | ||
| }, | ||
| "RoleDefinition": { | ||
| "properties": { |
There was a problem hiding this comment.
Are id, name and type properties readonly?
There was a problem hiding this comment.
no,made the changes in the specs
There was a problem hiding this comment.
What I mean here, because of ARM rules on APIs, this 3 properties shouls be marked as "readonly": true
| "description": "Role assignment properties with scope." | ||
| }, | ||
| "RoleAssignment": { | ||
| "properties": { |
There was a problem hiding this comment.
Same here:
Are id, name and type properties readonly?
There was a problem hiding this comment.
no,made the changes in the specs
|
Added some more comments about readonly properties. |
|
@mcardosos updated the examples,so that the model validation errors are fixed.Also the readonly field has been modified as per the comments |
|
@darshanhs90 I will add more comments on the new API swaggers based on this errors found by the linter. {
"type": "Error",
"code": "OperationsAPIImplementation",
"message": "Operations API must be implemented for '/providers/Microsoft.Authorization/operations'.",
"id": "R3023",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:38: 2 ($.paths)",
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:38: 2 ($.paths)"
]
}
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Only 'application/json' content-type is supported by ARM.",
"id": "R2004",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:14: 4 ($.consumes[1])"
]
}
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Only 'application/json' content-type is supported by ARM.",
"id": "R2004",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:18: 4 ($.produces[1])"
]
}
{
"type": "Warning",
"code": "OperationIdNounConflictingModelNames",
"message": "OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ProviderOperationsMetadataModel'. Consider using the plural form of 'ProviderOperationsMetadata' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.",
"id": "R2063",
"validationCategory": "SDKViolation",
"providerNamespace": "Microsoft.Authorization",
"resourceType": "providerOperations",
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:191: 8 ($.paths[\"/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}\"].get.operationId)"
]
}
{
"type": "Warning",
"code": "OperationIdNounConflictingModelNames",
"message": "OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ProviderOperationsMetadataModel'. Consider using the plural form of 'ProviderOperationsMetadata' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.",
"id": "R2063",
"validationCategory": "SDKViolation",
"providerNamespace": "Microsoft.Authorization",
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:237: 8 ($.paths[\"/providers/Microsoft.Authorization/providerOperations\"].get.operationId)"
]
}
{
"type": "Error",
"code": "RequiredPropertiesMissingInResourceModel",
"message": "Model definition 'RoleDefinition' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly.",
"id": "R2020",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:709: 4 ($.definitions.RoleDefinition)"
]
}
{
"type": "Error",
"code": "RequiredPropertiesMissingInResourceModel",
"message": "Model definition 'RoleAssignment' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly.",
"id": "R2020",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:529: 4 ($.definitions.RoleAssignment)"
]
}
{
"type": "Warning",
"code": "AvoidNestedProperties",
"message": "Consider using x-ms-client-flatten to provide a better end user experience",
"id": "R2001",
"validationCategory": "SDKViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:524: 8 ($.definitions.ClassicAdministrator.properties.properties)"
]
}
{
"type": "Warning",
"code": "AvoidNestedProperties",
"message": "Consider using x-ms-client-flatten to provide a better end user experience",
"id": "R2001",
"validationCategory": "SDKViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:600: 8 ($.definitions.ProviderOperation.properties.properties)"
]
}
{
"type": "Warning",
"code": "AvoidNestedProperties",
"message": "Consider using x-ms-client-flatten to provide a better end user experience",
"id": "R2001",
"validationCategory": "SDKViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization.json:726: 8 ($.definitions.RoleDefinition.properties.properties)"
]
}
{
"type": "Warning",
"code": "EnumInsteadOfBoolean",
"message": "Booleans are not descriptive and make them hard to use. Consider using string enums with allowed set of values defined. Property: canDelegate",
"id": "R3018",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:501: 8 ($.definitions.RoleAssignmentFilter.properties.canDelegate)"
]
}
{
"type": "Warning",
"code": "EnumInsteadOfBoolean",
"message": "Booleans are not descriptive and make them hard to use. Consider using string enums with allowed set of values defined. Property: canDelegate",
"id": "R3018",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:522: 8 ($.definitions.RoleAssignmentPropertiesWithScope.properties.canDelegate)"
]
}
{
"type": "Warning",
"code": "AvoidNestedProperties",
"message": "Consider using x-ms-client-flatten to provide a better end user experience",
"id": "R2001",
"validationCategory": "SDKViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:546: 8 ($.definitions.RoleAssignment.properties.properties)"
]
}
{
"type": "Warning",
"code": "EnumInsteadOfBoolean",
"message": "Booleans are not descriptive and make them hard to use. Consider using string enums with allowed set of values defined. Property: canDelegate",
"id": "R3018",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:579: 8 ($.definitions.RoleAssignmentProperties.properties.canDelegate)"
]
}
{
"type": "Warning",
"code": "AvoidNestedProperties",
"message": "Consider using x-ms-client-flatten to provide a better end user experience",
"id": "R2001",
"validationCategory": "SDKViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:588: 8 ($.definitions.RoleAssignmentCreateParameters.properties.properties)"
]
}
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Only 'application/json' content-type is supported by ARM.",
"id": "R2004",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:14: 4 ($.consumes[1])"
]
}
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Only 'application/json' content-type is supported by ARM.",
"id": "R2004",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///C:/azure-rest-api-specs/specification/authorization/resource-manager/Microsoft.Authorization/2017-10-01-preview/authorization-RACalls.json:18: 4 ($.produces[1])"
]
} |
| ], | ||
| "consumes": [ | ||
| "application/json", | ||
| "text/json" |
There was a problem hiding this comment.
"text/json" [](start = 4, length = 11)
According to the linter, ARM does not support consuming and producing "test/json"
| "readOnly":false, | ||
| "description": "The role assignment type." | ||
| }, | ||
| "properties": { |
There was a problem hiding this comment.
properties [](start = 9, length = 10)
This model could provide a better user experience if this property used x-ms-client-flatten
| "type": "string", | ||
| "description": "The type of the administrator." | ||
| }, | ||
| "properties": { |
There was a problem hiding this comment.
"properties": [](start = 8, length = 13)
Same comment here, if this property is marked with x-ms-client-flatten user experience on the SDK would improve
There was a problem hiding this comment.
Added the x-ms-client-flatten in all the places the linter tool showed as warning
| "type": "string", | ||
| "description": "The operation origin." | ||
| }, | ||
| "properties": { |
There was a problem hiding this comment.
"properties" [](start = 8, length = 12)
And here too, x-ms-client-flatten can improve generated code.
There was a problem hiding this comment.
Added the x-ms-client-flatten in all the places the linter tool showed as warning
| }, | ||
| "RoleAssignmentCreateParameters": { | ||
| "properties": { | ||
| "properties": { |
There was a problem hiding this comment.
properties [](start = 9, length = 10)
This property can also benefit from being flattened
There was a problem hiding this comment.
Added the x-ms-client-flatten in all the places the linter tool showed as warning
| ], | ||
| "consumes": [ | ||
| "application/json", | ||
| "text/json" |
There was a problem hiding this comment.
"text/json" [](start = 4, length = 11)
According to the linter, this is not supported by ARM
| "type": "string", | ||
| "description": "Returns role assignment of the specific principal." | ||
| }, | ||
| "canDelegate":{ |
There was a problem hiding this comment.
canDelegate [](start = 9, length = 11)
Linter is suggesting using an enum instead of a bool here. What do you think?
There was a problem hiding this comment.
since the values are either true or false which gets passed on to the service,bool is more apt in this case
| } | ||
| }, | ||
| "/providers/Microsoft.Authorization/providerOperations": { | ||
| "get": { |
There was a problem hiding this comment.
question for @ravbhatnagar
Is this allowed? The linter marks an error on this swaggers because they are not providing an operatin that lists all available operations in the API. I found this other operation that looks like does exactly that. Is it mandatory to use the exact same path that is provided by the linter error?
There was a problem hiding this comment.
No, this is fine for this RP. For all other RPs, the path that linter points is correct.
|
Looks good. Signing Off!! |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
@mcardosos Fixed all the above issues |
|
No modification for AutorestCI/azure-sdk-for-node |
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-versionin the path should match theapi-versionin the spec).Quality of Swagger