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

azure-arm-apimanagement ^5.0.0 defaults capacity to 1 for consumption sku #2613

Closed
1 task
annaji-msft opened this issue Apr 30, 2019 · 4 comments
Closed
1 task
Assignees
Labels
API Management CodeGen Issues that relate to code generation Mgmt This issue is related to a management-plane library.

Comments

@annaji-msft
Copy link
Member

  • Package Name: azure-arm-apimanagement

  • Package Version: ^5.0.0

  • Operating system: Windows

  • nodejs

    • 6.8.0:

Describe the bug
defaults capacity to 1 for consumption sku. This is causing a bad request returned by the server as it expects no capacity property for consumption sku.

To Reproduce
Steps to reproduce the behavior:

  1. Create a consumption sku api management service

let serviceResource = {
location: "west us",
sku: <ApiManagementModels.ApiManagementServiceSkuProperties>{
name: "Consumption"
},
publisherEmail: [email protected]
publisherName: "foo"
};

Expected behavior
Must create a api management service with consumption sku

Actual Behavior
{"code":"InvalidParameters","message":"Invalid parameter: Specifying Sku Capacity for Sku Type 'Consumption' is invalid.","details":null,"innerError":null}

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@jhendrixMSFT
Copy link
Member

@kpajdzik is the generator inserting this? Per swagger spec default indicates a value the server will use if none is provided, codegen shouldn't be populating this.

@kpajdzik
Copy link
Contributor

kpajdzik commented May 1, 2019

Seems like it: https://github.com/Azure/azure-sdk-for-node/blob/e1887b81ee4f1b0d540d6b63c84c542829036edd/lib/services/apimanagement/lib/models/apiManagementServiceSkuProperties.js#L52-L53

capacity: {
            required: false,
            serializedName: 'capacity',
            defaultValue: 1,
            type: {
              name: 'Number'
            }
          }

@daschult @amarzavery Any comments here?

@kurtzeborn kurtzeborn added the Mgmt This issue is related to a management-plane library. label May 1, 2019
@triage-new-issues triage-new-issues bot removed the triage label May 1, 2019
@kurtzeborn kurtzeborn added the ARM label May 1, 2019
@ramya-rao-a
Copy link
Contributor

@joheredi Can you check if this is still a problem in @azure/arm-apimanagement that uses v4 of the code generator?

@RodgeFu RodgeFu added the CodeGen Issues that relate to code generation label Jul 2, 2020
@joheredi
Copy link
Member

It looks like defaultValue is no longer defined in the latest SDK using autorest.typescript v4

capacity: {
required: true,
serializedName: "capacity",
type: {
name: "Number"
}
}

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Management CodeGen Issues that relate to code generation Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

No branches or pull requests

7 participants