Matheus Dantas
04/13/2026, 9:06 AMValueError: mutable default <class 'airbyte_cdk.sources.declarative.decoders.json_decoder.JsonDecoder'> for field _decoder is not allowed: use default_factorykapa.ai
04/13/2026, 9:06 AMJsonDecoder) as a default value for a dataclass field directly, instead of using default_factory. The Fix Instead of defining your decoder field like this:
# ❌ Incorrect - causes the ValueError
decoder: Decoder = JsonDecoder(parameters={})
You should use `default_factory`:
# ✅ Correct
from dataclasses import field
decoder: Decoder = field(default_factory=lambda: JsonDecoder(parameters={}))
This exact fix was applied to the source-xero connector's CustomExtractor component to resolve the same error [fix source-xero].
You can also see this pattern used consistently across multiple Airbyte connectors:
• In source-xero `CustomExtractor`: [source-xero components]
• In source-hubspot `HubspotPropertyHistoryExtractor`: [source-hubspot components]
• In source-monday `MondayIncrementalItemsExtractor`: [source-monday components]
Make sure you also have field imported from `dataclasses`:
from dataclasses import dataclass, field 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.