sul-dlss / cocina-models

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

Define the dry-struct so as to avoid metadata #417

Closed jcoyne closed 2 years ago

jcoyne commented 2 years ago

Why was this change made? 🤔

The old way made introspection impossible:

node = Cocina::Models::DescriptiveValue.schema.find { |key| key.name == :source }
node.type
node.type.right
#<Class:0x000000010ae7f710>

How was this change tested? 🤨

Added a unit test.

jcoyne commented 2 years ago

@justinlittman I don't know. The tests here seem to pass.

justinlittman commented 2 years ago

If we've learned anything, it is that the tests passing means nothing about our actual data.

Running a validation report. I'll let you know what it finds.

justinlittman commented 2 years ago

Can you test branch against DSA and Argo?

jcoyne commented 2 years ago

Both Argo (https://github.com/sul-dlss/argo/pull/3517) and DSA (https://github.com/sul-dlss/dor-services-app/pull/3889) don't seem to have problems with this change.