Azure / Azure/autorest.cli

[MM] Parameter type is wrong when resource contains Update method

Open
#76 4 comments 0 reactions 1 assignee Claimed by @chunyu3 View on GitHub
Dominant language
TypeScript
Stars
8
Forks
18
PR merge metrics
No merged PRs in 30d

Description

I am generating `api.yaml` file using `autorest.cli` with input file: `azure-rest-api-specs\specification\compute\resource-manager\readme.md`

# Tag in use
`package-2019-07`.

# Cli section added in `readme.md`

``` yaml $(cli)
cli:
cli-name: compute
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.compute
package-name: azure-mgmt-compute
clear-output-folder: false
debug: true
disable-azure-cli: true
```

# Problem encountered

The parameter type of create method in `computevirtualmachinescaleset/api.yaml` is wrong.

```
create: !ruby/object:Api::Azure::SDKOperationDefinition
async: true
go_func_name: CreateOrUpdate
python_func_name: create_or_update
request:
'resourceGroupName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject
id_portion: resourceGroups
go_variable_name: resourceGroup
python_parameter_name: resource_group_name
python_variable_name: resource_group
'vmScaleSetName': !ruby/object:Api::Azure::SDKTypeDefinition::StringObject
id_portion: virtualMachineScaleSets
go_variable_name: name
python_parameter_name: vm_scale_set_name
python_variable_name: name
'/': !ruby/object:Api::Azure::SDKTypeDefinition::ComplexObject
go_variable_name: parameters
go_type_name: VirtualMachineScaleSetUpdate
python_parameter_name: parameters
python_variable_name: parameters
```

The `go_type_name` of `'/'` is `VirtualMachineScaleSetUpdate`, and it should be `VirtualMachineScaleSet` for create, `VirtualMachineScaleSetUpdate` for update.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.