Skip to content
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

[MM] [unknown-primary[object]] appears in properties #53

Open
ArcturusZhang opened this issue Nov 6, 2019 · 1 comment
Open

[MM] [unknown-primary[object]] appears in properties #53

ArcturusZhang opened this issue Nov 6, 2019 · 1 comment
Assignees
Milestone

Comments

@ArcturusZhang
Copy link
Member

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

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

In the generated magic-module-input files computevirtualmachine, some properties are generated as:

            - !ruby/object:Api::Azure::Type::[unknown-primary[object]]
              name: 'settings'
              description: 'Json formatted public settings for the extension.'
              required: false
              azure_sdk_references: ['/resources/settings', '/resources/properties/settings']
            - !ruby/object:Api::Azure::Type::[unknown-primary[object]]
              name: 'protectedSettings'
              description: 'The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.'
              required: false
              azure_sdk_references: ['/resources/protectedSettings', '/resources/properties/protectedSettings']
@chunyu3 chunyu3 self-assigned this Nov 6, 2019
@chunyu3 chunyu3 added this to the assigned milestone Nov 6, 2019
@chunyu3
Copy link
Member

chunyu3 commented Nov 6, 2019

the 'setting' and 'protectedSettings' does not define it primary type.
It may define object type as following in swagger json file:

"settings": {
"type": "object",
"description": "Json formatted public settings for the extension.",
"additionalProperties": {
"type": "string"
}
},
"protectedSettings": {
"type": "object",
"description": "The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.",
"additionalProperties": {
"type": "string"
}
},

Otherwise autorest cannot figure out the primary type, that means in autorest.cli input file, there is no primary type defined, and autorest.cli cannot correctly dispose it.

@chunyu3 chunyu3 modified the milestones: assigned, InProgress Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants