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

Bug in the Event Hubs SDK #413

Closed
tombuildsstuff opened this issue Oct 9, 2016 · 2 comments · Fixed by Azure/azure-rest-api-specs#613
Closed

Bug in the Event Hubs SDK #413

tombuildsstuff opened this issue Oct 9, 2016 · 2 comments · Fixed by Azure/azure-rest-api-specs#613

Comments

@tombuildsstuff
Copy link
Contributor

Thanks for adding the EventHub SDK recently.

I've been working on adding support for them into Terraform - and I believe I've found an SDK bug with one of the types is defined incorrectly. I'm getting the following error - (I've masked the Subscription ID for obvious reasons):

* azurerm_eventhub.test: eventhub.EventHubsClient#CreateOrUpdate: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal string into Go value of type int32' JSON = '{"id":"/subscriptions/XXXXXXXXXXXXXXXXXXXX/resourceGroups/tomacctestrg/providers/Microsoft.EventHub/namespaces/th-eh-namespace/eventhubs/th-eh-test","name":"th-eh-test","type":"Microsoft.EventHub/EventHubs","location":"West US","tags":null,"properties":{"messageRetentionInDays":1,"status":"Active","createdAt":"2016-10-09T07:13:47.85","updatedAt":"2016-10-09T07:13:48.13","partitionCount":2,"partitionIds":["0","1"]}}'

I believe this error to be with the Partition ID's - which is returned as an array of strings and not Int's. For context the object is:

type Properties struct {
    CreatedAt              *date.Time   `json:"createdAt,omitempty"`
    MessageRetentionInDays *int64       `json:"messageRetentionInDays,omitempty"`
    PartitionCount         *int64       `json:"partitionCount,omitempty"`
    PartitionIds           *[]int32     `json:"partitionIds,omitempty"`
    Status                 EntityStatus `json:"status,omitempty"`
    UpdatedAt              *date.Time   `json:"updatedAt,omitempty"`
}

From what I can see - to route to fixing this is either:

  • Updating the SDK Definition to return an array of strings
  • Start returning integers from the API instead

As this SDK is auto-generated - I guess there'd be no point sending a PR to fix the type in this repo directly?

@mcardosos
Copy link
Contributor

Hello! Thanks for reporting this :D
Yeah, as it is AutoRest generated, the best thing to do is update the swagger and then regen the SDK :(

@tombuildsstuff
Copy link
Contributor Author

@amarzavery @mcardosos thanks for fixing the bug in the Swagger.. any idea when the SDK will be re-generated to account for this? Would it be possible to @ me in that PR? Many thanks :)

@tombuildsstuff tombuildsstuff mentioned this issue Oct 26, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants