Unexpected keys [:id] in Hash input


#1

When i’m creating a row in the database, via the repository, I got this :

MyApp.instance.container['repositories.companies'].create(company)

Dry::Struct::Error:
[Company.new] unexpected keys [:id] in Hash input

The row is well created. My entity is schema hash type.

And is this possible to use schema hash of type strict_with_defaults with rom-rb ?


#2

What’s company in your case? How did you define it? Command methods return data from the database, and it looks like your company struct doesn’t allow :id attribute.