@wojtekmach this is definitely possible, we do as you said: validate dynamic embed with changeset (it’s not schemaless but it doesn’t matter) and put errors to the parent if any. But now we also need to copy constraints and in the view layer add a hack that would map constraint error to look like it occurred in the structure from provider_settings embed.
Mapping is required because we want error for a client to appear where it’s logically should be and point to a correct field, in case front-end maps that errors back. Correct me if I’m wrong, but changeset struct after constraint violation would point to a field in the embed, not to field in the parent struct.
The question is should we do something and make Ecto support dynamic embeds without a lot of hacking and mapping everything back and forth? Because resulting code is pretty complex, duplicated and error prone.






















