We generate schemas with an LLM. Entities that extend the same base come back with cover_photo in one, image in another and photo in a third. Do we have to normalise these before upload?
The model names the image field cover_photo, image or photo
Common question, written up by the Supero team.
1 answer
Not when the base declares them as aliases. A base type can say that one attribute answers to several names: the canonical primary_image answers to eight, including cover_photo, image, photo and hero_image. An extending schema that declares one of them folds into primary_image, so it gets the base's validation, access rules and indexing instead of a parallel untyped field.
Records are folded too. A record written with cover_photo as its key is stored under primary_image, so a generated form that uses the synonym still fills the field the admin views read.
Within one schema, an alias that collides with a real attribute name, or that two attributes both claim, is rejected at upload. Folding only covers names a base declares, so for your own fields it still pays to give the model the exact names in the prompt.
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer