sul-dlss / cocina-models

Cocina repository data model (implemented in Ruby)
https://sul-dlss.github.io/cocina-models/
3 stars 0 forks source link

Allow Cocina::Models.build / .build_request to take symbol keys #346

Closed lwrubel closed 2 years ago

lwrubel commented 2 years ago

If the hash passed to Cocina::Models.build has a symbol key for type instead of a string, fetch will produce a KeyError. https://github.com/sul-dlss/cocina-models/blob/7b0f205941511129d95d0c07ac0ba626b35038b5/lib/cocina/models.rb#L66

Consider using with_indifferent_access. on the hash before fetch.