Transforming Nested Object Fields in Schema Without 'Unsupported schema' Error
I have a field called
The challenge is to achieve this transformation without duplicating code everywhere, and I couldn't find a proper way to do this in the documentation.
Here's the code I've tried so far, broken down into parts:
1. Adding a Default Value Transformation:
2. Defining the
3. Defining the
4. Attempting to Transform the
However, this code doesn't work and gives the error:
Additionally, is there a way to add a default decode value if the parsed value is
rarity defined as an object { name: string; color: string }. I want to parse this field and transform it into { rarity: rarity.name, color: rarity.color }, effectively moving name and color to the top level with rarity being the name value.The challenge is to achieve this transformation without duplicating code everywhere, and I couldn't find a proper way to do this in the documentation.
Here's the code I've tried so far, broken down into parts:
1. Adding a Default Value Transformation:
2. Defining the
_Rarity Structure:3. Defining the
Sticker Structure:4. Attempting to Transform the
Sticker :However, this code doesn't work and gives the error:
error: Uncaught (in promise) Error: Unsupported schemaAdditionally, is there a way to add a default decode value if the parsed value is
null?