Skip to content

Conversation

@ZdenekSrotyr
Copy link
Contributor

@ZdenekSrotyr ZdenekSrotyr commented Nov 26, 2025

Summary

Fixes a Pydantic validation error when the UI sends an empty list [] for the accounts field instead of an empty dict {}. This was observed when loading Instagram accounts with no accounts configured.

The error was:

pydantic_core._pydantic_core.ValidationError: 1 validation error for Configuration
accounts
  Input should be a valid dictionary [type=dict_type, input_value=[], input_type=list]

Added a field_validator with mode="before" that normalizes the input:

  • None{}
  • [] (empty list) → {}
  • Non-empty list → raises TypeError (not supported)
  • Dict → passed through unchanged

Review & Testing Checklist for Human

  • Test Instagram V2 with no accounts configured - verify the component no longer crashes with the validation error
  • Test Facebook Ads V2 and Facebook Pages V2 - ensure existing configurations with accounts as dict still work correctly
  • Check if any existing configs send accounts as a non-empty list - the validator will now reject these with a TypeError; if such configs exist, we may need to handle list-to-dict conversion

Notes

This Configuration class is shared by all three components (Facebook Ads V2, Facebook Pages V2, Instagram V2), so changes affect all of them.

Link to Devin run: https://app.devin.ai/sessions/43cf7198b6104359a5bf79099ef93f18
Requested by: [email protected] (@ZdenekSrotyr)

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration
Copy link
Contributor

Merged into PR #23

@devin-ai-integration devin-ai-integration bot deleted the devin/1764165684-fix-accounts-empty-list branch December 19, 2025 15:05
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

Successfully merging this pull request may close these issues.

1 participant