Closed arcadiafalcone closed 2 years ago
Can you provide an example?
The following would be invalid:
{ title: [ {
value: 'A title',
structuredValue: [ { value: 'A', type: 'nonsorting characters'}, { value: 'title', type: 'main title' } ] } ] }
A valid representation:
{ title: [ {
parallelValue: [
{ value: 'A title' },
{ structuredValue: [ { value: 'A', type: 'nonsorting characters'}, { value: 'title', type: 'main title' } ] } ] } ] }
This seems like an issue with how we've written DescriptiveBasicValue. We say it has a structuredValue and a value field.
https://github.com/sul-dlss/cocina-models/blob/main/openapi.yml#L694-L707t
I'm realizing this is also true of parallelValue and groupedValue -- a set of siblings in an object should have no more than one of the four.
This has not yet come up in our data but will be an issue for Cocina spreadsheet upload.
I've made an attempt at implementing this in openapi but was unsuccessful. I encourage someone else to make an attempt.
In addition to one of value, parallelValue, groupedValue, and structuredValue it must also support none being present.
On the same level an object should have either a value or a structuredValue, not both.