Skip to content

Bug: portkey_integration fails to refresh state due to JSON unmarshaling error (is_custom type mismatch) #17

Description

@tyleris-irish

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:

  1. Create an Azure Foundry portkey_integration with no models
  2. Manually add a "Custom Model" to an AI Foundry integration via the Portkey UI.
  3. Run terraform plan.
  4. The provider will attempt to refresh the integration state, fetch the model list, and fail when parsing the is_custom field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions