cocina-models 0.63.0 → 0.65.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/docs/maps/Collection.json +0 -5
  3. data/docs/maps/DRO.json +0 -5
  4. data/lib/cocina/generator/schema_array.rb +1 -1
  5. data/lib/cocina/generator/schema_value.rb +4 -0
  6. data/lib/cocina/models/access_role.rb +1 -1
  7. data/lib/cocina/models/admin_policy.rb +3 -0
  8. data/lib/cocina/models/admin_policy_administrative.rb +4 -4
  9. data/lib/cocina/models/administrative.rb +1 -1
  10. data/lib/cocina/models/applies_to.rb +1 -1
  11. data/lib/cocina/models/cocina_version.rb +9 -0
  12. data/lib/cocina/models/collection.rb +3 -0
  13. data/lib/cocina/models/collection_identification.rb +1 -1
  14. data/lib/cocina/models/contributor.rb +5 -5
  15. data/lib/cocina/models/description.rb +13 -13
  16. data/lib/cocina/models/descriptive_access_metadata.rb +6 -6
  17. data/lib/cocina/models/descriptive_admin_metadata.rb +6 -6
  18. data/lib/cocina/models/descriptive_basic_value.rb +5 -5
  19. data/lib/cocina/models/descriptive_geographic_metadata.rb +2 -2
  20. data/lib/cocina/models/descriptive_grouped_value.rb +1 -1
  21. data/lib/cocina/models/descriptive_parallel_contributor.rb +4 -4
  22. data/lib/cocina/models/descriptive_parallel_event.rb +6 -6
  23. data/lib/cocina/models/descriptive_parallel_value.rb +1 -1
  24. data/lib/cocina/models/descriptive_structured_value.rb +1 -1
  25. data/lib/cocina/models/descriptive_value.rb +6 -6
  26. data/lib/cocina/models/descriptive_value_language.rb +1 -1
  27. data/lib/cocina/models/dro.rb +3 -0
  28. data/lib/cocina/models/dro_access.rb +1 -1
  29. data/lib/cocina/models/dro_structural.rb +3 -5
  30. data/lib/cocina/models/event.rb +7 -7
  31. data/lib/cocina/models/file.rb +1 -1
  32. data/lib/cocina/models/file_set_structural.rb +1 -1
  33. data/lib/cocina/models/identification.rb +1 -1
  34. data/lib/cocina/models/language.rb +5 -5
  35. data/lib/cocina/models/related_resource.rb +9 -9
  36. data/lib/cocina/models/request_admin_policy.rb +4 -1
  37. data/lib/cocina/models/request_collection.rb +4 -1
  38. data/lib/cocina/models/request_description.rb +28 -0
  39. data/lib/cocina/models/request_dro.rb +4 -1
  40. data/lib/cocina/models/request_dro_structural.rb +3 -4
  41. data/lib/cocina/models/request_file.rb +1 -1
  42. data/lib/cocina/models/request_file_set_structural.rb +1 -1
  43. data/lib/cocina/models/request_identification.rb +1 -1
  44. data/lib/cocina/models/sequence.rb +1 -1
  45. data/lib/cocina/models/source.rb +1 -1
  46. data/lib/cocina/models/standard.rb +1 -1
  47. data/lib/cocina/models/title.rb +6 -6
  48. data/lib/cocina/models/validator.rb +21 -1
  49. data/lib/cocina/models/version.rb +1 -1
  50. data/openapi.yml +124 -80
  51. metadata +5 -3
@@ -11,12 +11,15 @@ module Cocina
11
11
  'http://cocina.sul.stanford.edu/models/exhibit.jsonld',
12
12
  'http://cocina.sul.stanford.edu/models/series.jsonld'].freeze
13
13
 
14
+ # The version of Cocina with which this object conforms.
15
+ # example: 1.2.3
16
+ attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
14
17
  attribute :type, Types::Strict::String.enum(*RequestCollection::TYPES)
15
18
  attribute :label, Types::Strict::String
16
19
  attribute :version, Types::Strict::Integer
17
20
  attribute(:access, CollectionAccess.default { CollectionAccess.new })
18
21
  attribute(:administrative, Administrative.default { Administrative.new })
19
- attribute :description, Description.optional.meta(omittable: true)
22
+ attribute :description, RequestDescription.optional.meta(omittable: true)
20
23
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
21
24
 
22
25
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class RequestDescription < Struct
6
+ attribute :title, Types::Strict::Array.of(Title).default([].freeze)
7
+ attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
8
+ attribute :event, Types::Strict::Array.of(Event).default([].freeze)
9
+ attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
10
+ attribute :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).default([].freeze)
11
+ attribute :language, Types::Strict::Array.of(Language).default([].freeze)
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
+ attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
15
+ attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
16
+ attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
17
+ attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
18
+ attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
19
+ # URL or other pointer to the location of the resource description.
20
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
21
+
22
+ def self.new(attributes = default_attributes, safe = false, validate = true, &block)
23
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
24
+ super(attributes, safe, &block)
25
+ end
26
+ end
27
+ end
28
+ end
@@ -21,12 +21,15 @@ module Cocina
21
21
  'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld',
22
22
  'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'].freeze
23
23
 
24
+ # The version of Cocina with which this object conforms.
25
+ # example: 1.2.3
26
+ attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
24
27
  attribute :type, Types::Strict::String.enum(*RequestDRO::TYPES)
25
28
  attribute :label, Types::Strict::String
26
29
  attribute :version, Types::Strict::Integer
27
30
  attribute :access, DROAccess.optional.meta(omittable: true)
28
31
  attribute(:administrative, Administrative.default { Administrative.new })
29
- attribute :description, Description.optional.meta(omittable: true)
32
+ attribute :description, RequestDescription.optional.meta(omittable: true)
30
33
  attribute(:identification, RequestIdentification.default { RequestIdentification.new })
31
34
  attribute :structural, RequestDROStructural.optional.meta(omittable: true)
32
35
  attribute :geographic, Geographic.optional.meta(omittable: true)
@@ -3,10 +3,9 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class RequestDROStructural < Struct
6
- attribute :contains, Types::Strict::Array.of(RequestFileSet).default([])
7
- attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([])
8
- attribute :isMemberOf, Types::Strict::Array.of(Druid).default([])
9
- attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
6
+ attribute :contains, Types::Strict::Array.of(RequestFileSet).default([].freeze)
7
+ attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([].freeze)
8
+ attribute :isMemberOf, Types::Strict::Array.of(Druid).default([].freeze)
10
9
  end
11
10
  end
12
11
  end
@@ -15,7 +15,7 @@ module Cocina
15
15
  attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
16
16
  attribute :externalIdentifier, Types::Strict::String.meta(omittable: true)
17
17
  attribute :use, Types::Strict::String.meta(omittable: true)
18
- attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([])
18
+ attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
19
19
  attribute(:access, FileAccess.default { FileAccess.new })
20
20
  attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
21
21
  attribute :presentation, Presentation.optional.meta(omittable: true)
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class RequestFileSetStructural < Struct
6
- attribute :contains, Types::Strict::Array.of(RequestFile).default([])
6
+ attribute :contains, Types::Strict::Array.of(RequestFile).default([].freeze)
7
7
  end
8
8
  end
9
9
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class RequestIdentification < Struct
6
6
  # A barcode
7
7
  attribute :barcode, Types::Nominal::Any.meta(omittable: true)
8
- attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([])
8
+ attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
9
9
  # Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
10
10
 
11
11
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Sequence < Struct
6
- attribute :members, Types::Strict::Array.of(Types::Strict::String).default([])
6
+ attribute :members, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
7
7
  # The direction that a sequence of canvases should be displayed to the user
8
8
  attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
9
9
  end
@@ -9,7 +9,7 @@ module Cocina
9
9
  attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the value source.
11
11
  attribute :value, Types::Strict::String.meta(omittable: true)
12
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
13
  # The version of the value source.
14
14
  attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  end
@@ -9,7 +9,7 @@ module Cocina
9
9
  attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
11
  attribute :value, Types::Strict::String.meta(omittable: true)
12
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
13
  # The version of the standard or encoding.
14
14
  attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
@@ -3,9 +3,9 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Title < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
7
- attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([])
8
- attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
8
+ attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
9
9
  # String or integer value of the descriptive element.
10
10
  attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
@@ -18,17 +18,17 @@ module Cocina
18
18
  attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
21
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
24
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
26
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
27
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
30
  attribute :valueAt, Types::Strict::String.meta(omittable: true)
31
- attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([])
31
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
32
32
  end
33
33
  end
34
34
  end
@@ -7,12 +7,32 @@ module Cocina
7
7
  def self.validate(clazz, attributes)
8
8
  method_name = clazz.name.split('::').last
9
9
  request_operation = root.request_operation(:post, "/validate/#{method_name}")
10
+
10
11
  # JSON.parse forces serialization of objects like DateTime.
11
- request_operation.validate_request_body('application/json', JSON.parse(attributes.to_json))
12
+ json_attributes = JSON.parse(attributes.to_json)
13
+ # Inject cocinaVersion if needed and not present.
14
+ if operation_has_cocina_version?(request_operation) && !json_attributes.include?('cocinaVersion')
15
+ json_attributes['cocinaVersion'] = Cocina::Models::VERSION
16
+ end
17
+
18
+ request_operation.validate_request_body('application/json', json_attributes)
12
19
  rescue OpenAPIParser::OpenAPIError => e
13
20
  raise ValidationError, e.message
14
21
  end
15
22
 
23
+ # rubocop:disable Metrics/AbcSize
24
+ # rubocop:disable Metrics/CyclomaticComplexity
25
+ def self.operation_has_cocina_version?(request_operation)
26
+ schema = request_operation.operation_object.request_body.content['application/json'].schema
27
+ all_of_properties = Array(schema.all_of&.flat_map { |all_of| all_of.properties&.keys }).compact
28
+ one_of_properties = Array(schema.one_of&.flat_map { |one_of| one_of.properties&.keys }).compact
29
+ properties = Array(schema.properties&.keys)
30
+ (properties + all_of_properties + one_of_properties).include?('cocinaVersion')
31
+ end
32
+ # rubocop:enable Metrics/AbcSize
33
+ # rubocop:enable Metrics/CyclomaticComplexity
34
+ private_class_method :operation_has_cocina_version?
35
+
16
36
  # rubocop:disable Style/ClassVars
17
37
  def self.root
18
38
  @@root ||= OpenAPIParser.parse(YAML.load_file(openapi_path))
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.63.0'
5
+ VERSION = '0.65.1'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -91,6 +91,18 @@ paths:
91
91
  responses:
92
92
  '200':
93
93
  description: noop
94
+ /validate/RequestDescription:
95
+ post:
96
+ summary: Validate a Request Description
97
+ requestBody:
98
+ required: true
99
+ content:
100
+ application/json:
101
+ schema:
102
+ $ref: '#/components/schemas/RequestDescription'
103
+ responses:
104
+ '200':
105
+ description: noop
94
106
  components:
95
107
  schemas:
96
108
  Access:
@@ -172,6 +184,8 @@ components:
172
184
  type: object
173
185
  additionalProperties: false
174
186
  properties:
187
+ cocinaVersion:
188
+ $ref: '#/components/schemas/CocinaVersion'
175
189
  type:
176
190
  type: string
177
191
  enum:
@@ -187,6 +201,7 @@ components:
187
201
  description:
188
202
  $ref: '#/components/schemas/Description'
189
203
  required:
204
+ - cocinaVersion
190
205
  - administrative
191
206
  - externalIdentifier
192
207
  - label
@@ -220,7 +235,7 @@ components:
220
235
  type: string
221
236
  hasAdminPolicy:
222
237
  $ref: '#/components/schemas/Druid'
223
- referencesAgreement:
238
+ hasAgreement:
224
239
  $ref: '#/components/schemas/Druid'
225
240
  roles:
226
241
  description: The access roles conferred by this AdminPolicy (used by Argo)
@@ -229,6 +244,7 @@ components:
229
244
  $ref: '#/components/schemas/AccessRole'
230
245
  required:
231
246
  - hasAdminPolicy
247
+ - hasAgreement
232
248
  AdminPolicyDefaultAccess:
233
249
  description: 'Provides the default access settings for an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.'
234
250
  type: object
@@ -360,11 +376,18 @@ components:
360
376
  required:
361
377
  - access
362
378
  - download
379
+ CocinaVersion:
380
+ description: The version of Cocina with which this object conforms.
381
+ type: string
382
+ pattern: '^\d+\.\d+\.\d+$'
383
+ example: '1.2.3'
363
384
  Collection:
364
385
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
365
386
  type: object
366
387
  additionalProperties: false
367
388
  properties:
389
+ cocinaVersion:
390
+ $ref: '#/components/schemas/CocinaVersion'
368
391
  type:
369
392
  description: The content type of the Collection. Selected from an established set of values.
370
393
  type: string
@@ -391,6 +414,7 @@ components:
391
414
  identification:
392
415
  $ref: '#/components/schemas/CollectionIdentification'
393
416
  required:
417
+ - cocinaVersion
394
418
  - externalIdentifier
395
419
  - label
396
420
  - type
@@ -529,77 +553,15 @@ components:
529
553
  Description:
530
554
  type: object
531
555
  additionalProperties: false
532
- properties:
533
- title:
534
- description: Titles of the resource.
535
- type: array
536
- minItems: 1
537
- items:
538
- $ref: "#/components/schemas/Title"
539
- contributor:
540
- description: Agents contributing in some way to the creation and history of the
541
- resource.
542
- type: array
543
- items:
544
- $ref: "#/components/schemas/Contributor"
545
- event:
546
- description: Events in the history of the resource.
547
- type: array
548
- items:
549
- $ref: "#/components/schemas/Event"
550
- form:
551
- description: Characteristics of the resource's physical, digital, and intellectual
552
- form and genre, and of its process of creation.
553
- type: array
554
- items:
555
- $ref: "#/components/schemas/DescriptiveValue"
556
- geographic:
557
- description: Geographic description for items with coordinates or bounding boxes.
558
- type: array
559
- items:
560
- $ref: "#/components/schemas/DescriptiveGeographicMetadata"
561
- language:
562
- description: Languages, scripts, symbolic systems, and notations used in all or
563
- part of a resource.
564
- type: array
565
- items:
566
- $ref: "#/components/schemas/Language"
567
- note:
568
- description: Additional information relevant to a resource.
569
- type: array
570
- items:
571
- $ref: "#/components/schemas/DescriptiveValue"
572
- identifier:
573
- description: Identifiers and URIs associated with the resource.
574
- type: array
575
- items:
576
- $ref: "#/components/schemas/DescriptiveValue"
577
- subject:
578
- description: Terms associated with the intellectual content of the resource.
579
- type: array
580
- items:
581
- $ref: "#/components/schemas/DescriptiveValue"
582
- purl:
583
- $ref: "#/components/schemas/Purl"
584
- access:
585
- $ref: "#/components/schemas/DescriptiveAccessMetadata"
586
- relatedResource:
587
- description: Other resources associated with the described resource.
588
- type: array
589
- items:
590
- $ref: "#/components/schemas/RelatedResource"
591
- marcEncodedData:
592
- description: Data about the resource represented in MARC fixed fields and codes.
593
- type: array
594
- items:
595
- $ref: "#/components/schemas/DescriptiveValue"
596
- adminMetadata:
597
- $ref: "#/components/schemas/DescriptiveAdminMetadata"
598
- valueAt:
599
- description: URL or other pointer to the location of the resource description.
600
- type: string
601
- required:
602
- - title
556
+ allOf:
557
+ - $ref: "#/components/schemas/RequestDescription"
558
+ - type: object
559
+ additionalProperties: false
560
+ properties:
561
+ purl:
562
+ $ref: "#/components/schemas/Purl"
563
+ required:
564
+ - purl
603
565
  DescriptiveAccessMetadata:
604
566
  description: Information about how to access digital and physical versions of the object.
605
567
  type: object
@@ -886,6 +848,8 @@ components:
886
848
  type: object
887
849
  additionalProperties: false
888
850
  properties:
851
+ cocinaVersion:
852
+ $ref: '#/components/schemas/CocinaVersion'
889
853
  type:
890
854
  description: The content type of the DRO. Selected from an established set of values.
891
855
  type: string
@@ -926,6 +890,7 @@ components:
926
890
  geographic:
927
891
  $ref: '#/components/schemas/Geographic'
928
892
  required:
893
+ - cocinaVersion
929
894
  - access
930
895
  - administrative
931
896
  - externalIdentifier
@@ -953,6 +918,7 @@ components:
953
918
  license:
954
919
  description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
955
920
  type: string
921
+ nullable: true
956
922
  enum:
957
923
  - 'https://www.gnu.org/licenses/agpl.txt'
958
924
  - 'https://www.apache.org/licenses/LICENSE-2.0'
@@ -1004,9 +970,6 @@ components:
1004
970
  type: array
1005
971
  items:
1006
972
  $ref: '#/components/schemas/Druid'
1007
- hasAgreement:
1008
- description: Agreement that covers the deposit of the DRO into SDR.
1009
- type: string
1010
973
  Druid:
1011
974
  type: string
1012
975
  pattern: '^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$'
@@ -1508,6 +1471,8 @@ components:
1508
1471
  type: object
1509
1472
  additionalProperties: false
1510
1473
  properties:
1474
+ cocinaVersion:
1475
+ $ref: '#/components/schemas/CocinaVersion'
1511
1476
  type:
1512
1477
  type: string
1513
1478
  enum:
@@ -1519,8 +1484,9 @@ components:
1519
1484
  administrative:
1520
1485
  $ref: '#/components/schemas/AdminPolicyAdministrative'
1521
1486
  description:
1522
- $ref: '#/components/schemas/Description'
1487
+ $ref: '#/components/schemas/RequestDescription'
1523
1488
  required:
1489
+ - cocinaVersion
1524
1490
  - administrative
1525
1491
  - label
1526
1492
  - type
@@ -1530,6 +1496,8 @@ components:
1530
1496
  type: object
1531
1497
  additionalProperties: false
1532
1498
  properties:
1499
+ cocinaVersion:
1500
+ $ref: '#/components/schemas/CocinaVersion'
1533
1501
  type:
1534
1502
  type: string
1535
1503
  enum:
@@ -1547,20 +1515,96 @@ components:
1547
1515
  administrative:
1548
1516
  $ref: '#/components/schemas/Administrative'
1549
1517
  description:
1550
- $ref: '#/components/schemas/Description'
1518
+ $ref: '#/components/schemas/RequestDescription'
1551
1519
  identification:
1552
1520
  $ref: '#/components/schemas/CollectionIdentification'
1553
1521
  required:
1522
+ - cocinaVersion
1554
1523
  - access
1555
1524
  - administrative
1556
1525
  - label
1557
1526
  - type
1558
1527
  - version
1528
+ RequestDescription:
1529
+ description: Description that is included in a request to create a DRO. This is the same as a Description, except excludes PURL.
1530
+ type: object
1531
+ additionalProperties: false
1532
+ properties:
1533
+ title:
1534
+ description: Titles of the resource.
1535
+ type: array
1536
+ minItems: 1
1537
+ items:
1538
+ $ref: "#/components/schemas/Title"
1539
+ contributor:
1540
+ description: Agents contributing in some way to the creation and history of the
1541
+ resource.
1542
+ type: array
1543
+ items:
1544
+ $ref: "#/components/schemas/Contributor"
1545
+ event:
1546
+ description: Events in the history of the resource.
1547
+ type: array
1548
+ items:
1549
+ $ref: "#/components/schemas/Event"
1550
+ form:
1551
+ description: Characteristics of the resource's physical, digital, and intellectual
1552
+ form and genre, and of its process of creation.
1553
+ type: array
1554
+ items:
1555
+ $ref: "#/components/schemas/DescriptiveValue"
1556
+ geographic:
1557
+ description: Geographic description for items with coordinates or bounding boxes.
1558
+ type: array
1559
+ items:
1560
+ $ref: "#/components/schemas/DescriptiveGeographicMetadata"
1561
+ language:
1562
+ description: Languages, scripts, symbolic systems, and notations used in all or
1563
+ part of a resource.
1564
+ type: array
1565
+ items:
1566
+ $ref: "#/components/schemas/Language"
1567
+ note:
1568
+ description: Additional information relevant to a resource.
1569
+ type: array
1570
+ items:
1571
+ $ref: "#/components/schemas/DescriptiveValue"
1572
+ identifier:
1573
+ description: Identifiers and URIs associated with the resource.
1574
+ type: array
1575
+ items:
1576
+ $ref: "#/components/schemas/DescriptiveValue"
1577
+ subject:
1578
+ description: Terms associated with the intellectual content of the resource.
1579
+ type: array
1580
+ items:
1581
+ $ref: "#/components/schemas/DescriptiveValue"
1582
+ access:
1583
+ $ref: "#/components/schemas/DescriptiveAccessMetadata"
1584
+ relatedResource:
1585
+ description: Other resources associated with the described resource.
1586
+ type: array
1587
+ items:
1588
+ $ref: "#/components/schemas/RelatedResource"
1589
+ marcEncodedData:
1590
+ description: Data about the resource represented in MARC fixed fields and codes.
1591
+ type: array
1592
+ items:
1593
+ $ref: "#/components/schemas/DescriptiveValue"
1594
+ adminMetadata:
1595
+ $ref: "#/components/schemas/DescriptiveAdminMetadata"
1596
+ valueAt:
1597
+ description: URL or other pointer to the location of the resource description.
1598
+ type: string
1599
+ required:
1600
+ - title
1559
1601
  RequestDRO:
1560
1602
  description: A request to create a DRO. This has the same general structure as a DRO but doesn't have externalIdentifier and doesn't require the access subschema. If no access subschema is provided, these values will be inherited from the AdminPolicy.
1561
1603
  type: object
1562
1604
  additionalProperties: false
1563
1605
  properties:
1606
+ cocinaVersion:
1607
+ $ref: '#/components/schemas/CocinaVersion'
1564
1608
  type:
1565
1609
  type: string
1566
1610
  enum:
@@ -1588,7 +1632,7 @@ components:
1588
1632
  administrative:
1589
1633
  $ref: '#/components/schemas/Administrative'
1590
1634
  description:
1591
- $ref: '#/components/schemas/Description'
1635
+ $ref: '#/components/schemas/RequestDescription'
1592
1636
  identification:
1593
1637
  $ref: '#/components/schemas/RequestIdentification'
1594
1638
  structural:
@@ -1596,6 +1640,7 @@ components:
1596
1640
  geographic:
1597
1641
  $ref: '#/components/schemas/Geographic'
1598
1642
  required:
1643
+ - cocinaVersion
1599
1644
  - administrative
1600
1645
  - identification
1601
1646
  - label
@@ -1619,8 +1664,6 @@ components:
1619
1664
  type: array
1620
1665
  items:
1621
1666
  $ref: '#/components/schemas/Druid'
1622
- hasAgreement:
1623
- type: string
1624
1667
  RequestFile:
1625
1668
  type: object
1626
1669
  additionalProperties: false
@@ -1801,6 +1844,7 @@ components:
1801
1844
  StandardBarcode:
1802
1845
  description: The standard barcode associated with a DRO object, prefixed with 36105
1803
1846
  type: string
1847
+ nullable: true
1804
1848
  pattern: '^36105[0-9]{9}$'
1805
1849
  example: '36105010362304'
1806
1850
  Title:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.0
4
+ version: 0.65.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-19 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -280,6 +280,7 @@ files:
280
280
  - lib/cocina/models/catkey_barcode.rb
281
281
  - lib/cocina/models/checkable.rb
282
282
  - lib/cocina/models/citation_only_access.rb
283
+ - lib/cocina/models/cocina_version.rb
283
284
  - lib/cocina/models/collection.rb
284
285
  - lib/cocina/models/collection_access.rb
285
286
  - lib/cocina/models/collection_identification.rb
@@ -323,6 +324,7 @@ files:
323
324
  - lib/cocina/models/release_tag.rb
324
325
  - lib/cocina/models/request_admin_policy.rb
325
326
  - lib/cocina/models/request_collection.rb
327
+ - lib/cocina/models/request_description.rb
326
328
  - lib/cocina/models/request_dro.rb
327
329
  - lib/cocina/models/request_dro_structural.rb
328
330
  - lib/cocina/models/request_file.rb
@@ -360,7 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
360
362
  - !ruby/object:Gem::Version
361
363
  version: '0'
362
364
  requirements: []
363
- rubygems_version: 3.3.4
365
+ rubygems_version: 3.2.32
364
366
  signing_key:
365
367
  specification_version: 4
366
368
  summary: Data models for the SDR