Description
When running a terraform plan or refresh, the portkey_integration resource fails if the integration contains custom models. The provider encounters a fatal error while trying to unmarshal the API response because it expects a bool for the is_custom field, but receives a number.
Expected Behavior
The provider should successfully refresh the state of the integration, regardless of whether custom models exist in the Portkey dashboard, or it should correctly handle the conversion of 0/1 to false/true.
Actual Behavior:
The plan fails with the following error:
Error: Error reading integration models
with portkey_integration.AIF_PKYGENERAL_ANTHROPIC,
on main.tf line 32, in resource "portkey_integration" "AIF_PKYGENERAL_ANTHROPIC":
32: resource "portkey_integration" "AIF_PKYGENERAL_ANTHROPIC" {
Could not read integration models: error unmarshaling response: json: cannot
unmarshal number into Go struct field IntegrationModel.models.is_custom of
type bool
Steps to Reproduce:
- Create an Azure Foundry portkey_integration with no models
- Manually add a "Custom Model" to an AI Foundry integration via the Portkey UI.
- Run terraform plan.
- The provider will attempt to refresh the integration state, fetch the model list, and fail when parsing the is_custom field.
Description
When running a terraform plan or refresh, the portkey_integration resource fails if the integration contains custom models. The provider encounters a fatal error while trying to unmarshal the API response because it expects a bool for the is_custom field, but receives a number.
Expected Behavior
The provider should successfully refresh the state of the integration, regardless of whether custom models exist in the Portkey dashboard, or it should correctly handle the conversion of 0/1 to false/true.
Actual Behavior:
The plan fails with the following error:
Steps to Reproduce: