cocina-models 0.63.1 → 0.64.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/maps/Collection.json +0 -5
- data/docs/maps/DRO.json +0 -5
- data/lib/cocina/generator/schema_value.rb +4 -0
- data/lib/cocina/models/admin_policy.rb +3 -0
- data/lib/cocina/models/admin_policy_administrative.rb +2 -0
- data/lib/cocina/models/cocina_version.rb +9 -0
- data/lib/cocina/models/collection.rb +3 -0
- data/lib/cocina/models/description.rb +2 -2
- data/lib/cocina/models/dro.rb +3 -0
- data/lib/cocina/models/dro_structural.rb +0 -2
- data/lib/cocina/models/request_admin_policy.rb +4 -1
- data/lib/cocina/models/request_collection.rb +4 -1
- data/lib/cocina/models/request_description.rb +28 -0
- data/lib/cocina/models/request_dro.rb +4 -1
- data/lib/cocina/models/request_dro_structural.rb +0 -1
- data/lib/cocina/models/validator.rb +21 -1
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +123 -79
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9539fc314563e23d96f0f90cf2a97eca07ebbc2a63e9678581530a2cd7843396
|
4
|
+
data.tar.gz: 2a8d73a4d425dd4ad399431108e987590cc9aea97515aeb77edc7c49758fb4d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 447c58bbc28217dabd2664a23527eeedfa5588684700316b5507735d9d832e8905fbf9177f1918a1abb30d2cc4ce693e4d111cb47631d0f579a3fe7a780275cf
|
7
|
+
data.tar.gz: 61d83471e7b68292b2c945bbfb07d47d3bf179b40552b03e190eda1cf5915d7569606e6873275fdd327542e7c1d0767903797cd1c73d2c08241c8aa9ed0af33a
|
data/docs/maps/Collection.json
CHANGED
@@ -215,12 +215,7 @@
|
|
215
215
|
"structural": {
|
216
216
|
"description": "Structural metadata for the Collection.",
|
217
217
|
"type": "object",
|
218
|
-
"required": ["hasAgreement"],
|
219
218
|
"properties": {
|
220
|
-
"hasAgreement": {
|
221
|
-
"description": "Agreement that covers the deposit of the Collection into SDR.",
|
222
|
-
"type": "string"
|
223
|
-
},
|
224
219
|
"hasMember": {
|
225
220
|
"description": "Component digital repository objects or collections that are a part of this collection.",
|
226
221
|
"type": "array",
|
data/docs/maps/DRO.json
CHANGED
@@ -277,7 +277,6 @@
|
|
277
277
|
"structural": {
|
278
278
|
"description": "Structural metadata for the DRO.",
|
279
279
|
"type": "object",
|
280
|
-
"required": ["hasAgreement"],
|
281
280
|
"properties": {
|
282
281
|
"contains": {
|
283
282
|
"description": "Filesets that contain the digital representations (Files) of the DRO.",
|
@@ -286,10 +285,6 @@
|
|
286
285
|
"$ref": "/Fileset"
|
287
286
|
}
|
288
287
|
},
|
289
|
-
"hasAgreement": {
|
290
|
-
"description": "Agreement that covers the deposit of the DRO into SDR.",
|
291
|
-
"type": "string"
|
292
|
-
},
|
293
288
|
"hasMember": {
|
294
289
|
"description": "Component or 'children' digital repository objects that are a part or portion of this 'parent' or aggregate DRO.",
|
295
290
|
"type": "array",
|
@@ -26,10 +26,14 @@ module Cocina
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def default
|
29
|
+
# Provide version as default for cocinaVersion
|
30
|
+
return '.default(Cocina::Models::VERSION)' if name == 'cocinaVersion'
|
31
|
+
|
29
32
|
# If type is boolean and default is false, erroneously getting a nil.
|
30
33
|
# Assuming that if required, then default is false.
|
31
34
|
default = schema_doc.default
|
32
35
|
default = false if default.nil? && schema_doc.type == 'boolean' && required
|
36
|
+
|
33
37
|
return '' if default.nil?
|
34
38
|
|
35
39
|
".default(#{quote(default)})"
|
@@ -7,6 +7,9 @@ module Cocina
|
|
7
7
|
|
8
8
|
TYPES = ['http://cocina.sul.stanford.edu/models/admin_policy.jsonld'].freeze
|
9
9
|
|
10
|
+
# The version of Cocina with which this object conforms.
|
11
|
+
# example: 1.2.3
|
12
|
+
attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
|
10
13
|
attribute :type, Types::Strict::String.enum(*AdminPolicy::TYPES)
|
11
14
|
# example: druid:bc123df4567
|
12
15
|
attribute :externalIdentifier, Types::Strict::String
|
@@ -14,6 +14,8 @@ module Cocina
|
|
14
14
|
# example: druid:bc123df4567
|
15
15
|
attribute :hasAdminPolicy, Types::Strict::String
|
16
16
|
# example: druid:bc123df4567
|
17
|
+
attribute :hasAgreement, Types::Strict::String
|
18
|
+
# example: druid:bc123df4567
|
17
19
|
attribute :referencesAgreement, Types::Strict::String.meta(omittable: true)
|
18
20
|
attribute :roles, Types::Strict::Array.of(AccessRole).default([].freeze)
|
19
21
|
end
|
@@ -11,6 +11,9 @@ 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
|
# The content type of the Collection. Selected from an established set of values.
|
15
18
|
attribute :type, Types::Strict::String.enum(*Collection::TYPES)
|
16
19
|
# example: druid:bc123df4567
|
@@ -12,14 +12,14 @@ module Cocina
|
|
12
12
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
13
13
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
14
|
attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
|
-
# Stanford persistent URL associated with the related resource. Note this is http, not https.
|
16
|
-
attribute :purl, Types::Strict::String.meta(omittable: true)
|
17
15
|
attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
|
18
16
|
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
|
19
17
|
attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
20
18
|
attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
|
21
19
|
# URL or other pointer to the location of the resource description.
|
22
20
|
attribute :valueAt, Types::Strict::String.meta(omittable: true)
|
21
|
+
# Stanford persistent URL associated with the related resource. Note this is http, not https.
|
22
|
+
attribute :purl, Types::Strict::String
|
23
23
|
|
24
24
|
def self.new(attributes = default_attributes, safe = false, validate = true, &block)
|
25
25
|
Validator.validate(self, attributes.with_indifferent_access) if validate && name
|
data/lib/cocina/models/dro.rb
CHANGED
@@ -21,6 +21,9 @@ 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
|
# The content type of the DRO. Selected from an established set of values.
|
25
28
|
attribute :type, Types::Strict::String.enum(*DRO::TYPES)
|
26
29
|
# example: druid:bc123df4567
|
@@ -6,8 +6,6 @@ module Cocina
|
|
6
6
|
attribute :contains, Types::Strict::Array.of(FileSet).default([].freeze)
|
7
7
|
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([].freeze)
|
8
8
|
attribute :isMemberOf, Types::Strict::Array.of(Druid).default([].freeze)
|
9
|
-
# Agreement that covers the deposit of the DRO into SDR.
|
10
|
-
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
11
9
|
end
|
12
10
|
end
|
13
11
|
end
|
@@ -7,11 +7,14 @@ module Cocina
|
|
7
7
|
|
8
8
|
TYPES = ['http://cocina.sul.stanford.edu/models/admin_policy.jsonld'].freeze
|
9
9
|
|
10
|
+
# The version of Cocina with which this object conforms.
|
11
|
+
# example: 1.2.3
|
12
|
+
attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
|
10
13
|
attribute :type, Types::Strict::String.enum(*RequestAdminPolicy::TYPES)
|
11
14
|
attribute :label, Types::Strict::String
|
12
15
|
attribute :version, Types::Strict::Integer
|
13
16
|
attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
|
14
|
-
attribute :description,
|
17
|
+
attribute :description, RequestDescription.optional.meta(omittable: true)
|
15
18
|
|
16
19
|
def self.new(attributes = default_attributes, safe = false, validate = true, &block)
|
17
20
|
Validator.validate(self, attributes.with_indifferent_access) if validate && name
|
@@ -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,
|
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,
|
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)
|
@@ -6,7 +6,6 @@ module Cocina
|
|
6
6
|
attribute :contains, Types::Strict::Array.of(RequestFileSet).default([].freeze)
|
7
7
|
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([].freeze)
|
8
8
|
attribute :isMemberOf, Types::Strict::Array.of(Druid).default([].freeze)
|
9
|
-
attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
|
10
9
|
end
|
11
10
|
end
|
12
11
|
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
|
-
|
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))
|
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,6 +235,8 @@ components:
|
|
220
235
|
type: string
|
221
236
|
hasAdminPolicy:
|
222
237
|
$ref: '#/components/schemas/Druid'
|
238
|
+
hasAgreement:
|
239
|
+
$ref: '#/components/schemas/Druid'
|
223
240
|
referencesAgreement:
|
224
241
|
$ref: '#/components/schemas/Druid'
|
225
242
|
roles:
|
@@ -229,6 +246,7 @@ components:
|
|
229
246
|
$ref: '#/components/schemas/AccessRole'
|
230
247
|
required:
|
231
248
|
- hasAdminPolicy
|
249
|
+
- hasAgreement
|
232
250
|
AdminPolicyDefaultAccess:
|
233
251
|
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
252
|
type: object
|
@@ -360,11 +378,18 @@ components:
|
|
360
378
|
required:
|
361
379
|
- access
|
362
380
|
- download
|
381
|
+
CocinaVersion:
|
382
|
+
description: The version of Cocina with which this object conforms.
|
383
|
+
type: string
|
384
|
+
pattern: '^\d+\.\d+\.\d+$'
|
385
|
+
example: '1.2.3'
|
363
386
|
Collection:
|
364
387
|
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
388
|
type: object
|
366
389
|
additionalProperties: false
|
367
390
|
properties:
|
391
|
+
cocinaVersion:
|
392
|
+
$ref: '#/components/schemas/CocinaVersion'
|
368
393
|
type:
|
369
394
|
description: The content type of the Collection. Selected from an established set of values.
|
370
395
|
type: string
|
@@ -391,6 +416,7 @@ components:
|
|
391
416
|
identification:
|
392
417
|
$ref: '#/components/schemas/CollectionIdentification'
|
393
418
|
required:
|
419
|
+
- cocinaVersion
|
394
420
|
- externalIdentifier
|
395
421
|
- label
|
396
422
|
- type
|
@@ -529,77 +555,15 @@ components:
|
|
529
555
|
Description:
|
530
556
|
type: object
|
531
557
|
additionalProperties: false
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
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
|
558
|
+
allOf:
|
559
|
+
- $ref: "#/components/schemas/RequestDescription"
|
560
|
+
- type: object
|
561
|
+
additionalProperties: false
|
562
|
+
properties:
|
563
|
+
purl:
|
564
|
+
$ref: "#/components/schemas/Purl"
|
565
|
+
required:
|
566
|
+
- purl
|
603
567
|
DescriptiveAccessMetadata:
|
604
568
|
description: Information about how to access digital and physical versions of the object.
|
605
569
|
type: object
|
@@ -886,6 +850,8 @@ components:
|
|
886
850
|
type: object
|
887
851
|
additionalProperties: false
|
888
852
|
properties:
|
853
|
+
cocinaVersion:
|
854
|
+
$ref: '#/components/schemas/CocinaVersion'
|
889
855
|
type:
|
890
856
|
description: The content type of the DRO. Selected from an established set of values.
|
891
857
|
type: string
|
@@ -926,6 +892,7 @@ components:
|
|
926
892
|
geographic:
|
927
893
|
$ref: '#/components/schemas/Geographic'
|
928
894
|
required:
|
895
|
+
- cocinaVersion
|
929
896
|
- access
|
930
897
|
- administrative
|
931
898
|
- externalIdentifier
|
@@ -1004,9 +971,6 @@ components:
|
|
1004
971
|
type: array
|
1005
972
|
items:
|
1006
973
|
$ref: '#/components/schemas/Druid'
|
1007
|
-
hasAgreement:
|
1008
|
-
description: Agreement that covers the deposit of the DRO into SDR.
|
1009
|
-
type: string
|
1010
974
|
Druid:
|
1011
975
|
type: string
|
1012
976
|
pattern: '^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$'
|
@@ -1508,6 +1472,8 @@ components:
|
|
1508
1472
|
type: object
|
1509
1473
|
additionalProperties: false
|
1510
1474
|
properties:
|
1475
|
+
cocinaVersion:
|
1476
|
+
$ref: '#/components/schemas/CocinaVersion'
|
1511
1477
|
type:
|
1512
1478
|
type: string
|
1513
1479
|
enum:
|
@@ -1519,8 +1485,9 @@ components:
|
|
1519
1485
|
administrative:
|
1520
1486
|
$ref: '#/components/schemas/AdminPolicyAdministrative'
|
1521
1487
|
description:
|
1522
|
-
$ref: '#/components/schemas/
|
1488
|
+
$ref: '#/components/schemas/RequestDescription'
|
1523
1489
|
required:
|
1490
|
+
- cocinaVersion
|
1524
1491
|
- administrative
|
1525
1492
|
- label
|
1526
1493
|
- type
|
@@ -1530,6 +1497,8 @@ components:
|
|
1530
1497
|
type: object
|
1531
1498
|
additionalProperties: false
|
1532
1499
|
properties:
|
1500
|
+
cocinaVersion:
|
1501
|
+
$ref: '#/components/schemas/CocinaVersion'
|
1533
1502
|
type:
|
1534
1503
|
type: string
|
1535
1504
|
enum:
|
@@ -1547,20 +1516,96 @@ components:
|
|
1547
1516
|
administrative:
|
1548
1517
|
$ref: '#/components/schemas/Administrative'
|
1549
1518
|
description:
|
1550
|
-
$ref: '#/components/schemas/
|
1519
|
+
$ref: '#/components/schemas/RequestDescription'
|
1551
1520
|
identification:
|
1552
1521
|
$ref: '#/components/schemas/CollectionIdentification'
|
1553
1522
|
required:
|
1523
|
+
- cocinaVersion
|
1554
1524
|
- access
|
1555
1525
|
- administrative
|
1556
1526
|
- label
|
1557
1527
|
- type
|
1558
1528
|
- version
|
1529
|
+
RequestDescription:
|
1530
|
+
description: Description that is included in a request to create a DRO. This is the same as a Description, except excludes PURL.
|
1531
|
+
type: object
|
1532
|
+
additionalProperties: false
|
1533
|
+
properties:
|
1534
|
+
title:
|
1535
|
+
description: Titles of the resource.
|
1536
|
+
type: array
|
1537
|
+
minItems: 1
|
1538
|
+
items:
|
1539
|
+
$ref: "#/components/schemas/Title"
|
1540
|
+
contributor:
|
1541
|
+
description: Agents contributing in some way to the creation and history of the
|
1542
|
+
resource.
|
1543
|
+
type: array
|
1544
|
+
items:
|
1545
|
+
$ref: "#/components/schemas/Contributor"
|
1546
|
+
event:
|
1547
|
+
description: Events in the history of the resource.
|
1548
|
+
type: array
|
1549
|
+
items:
|
1550
|
+
$ref: "#/components/schemas/Event"
|
1551
|
+
form:
|
1552
|
+
description: Characteristics of the resource's physical, digital, and intellectual
|
1553
|
+
form and genre, and of its process of creation.
|
1554
|
+
type: array
|
1555
|
+
items:
|
1556
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1557
|
+
geographic:
|
1558
|
+
description: Geographic description for items with coordinates or bounding boxes.
|
1559
|
+
type: array
|
1560
|
+
items:
|
1561
|
+
$ref: "#/components/schemas/DescriptiveGeographicMetadata"
|
1562
|
+
language:
|
1563
|
+
description: Languages, scripts, symbolic systems, and notations used in all or
|
1564
|
+
part of a resource.
|
1565
|
+
type: array
|
1566
|
+
items:
|
1567
|
+
$ref: "#/components/schemas/Language"
|
1568
|
+
note:
|
1569
|
+
description: Additional information relevant to a resource.
|
1570
|
+
type: array
|
1571
|
+
items:
|
1572
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1573
|
+
identifier:
|
1574
|
+
description: Identifiers and URIs associated with the resource.
|
1575
|
+
type: array
|
1576
|
+
items:
|
1577
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1578
|
+
subject:
|
1579
|
+
description: Terms associated with the intellectual content of the resource.
|
1580
|
+
type: array
|
1581
|
+
items:
|
1582
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1583
|
+
access:
|
1584
|
+
$ref: "#/components/schemas/DescriptiveAccessMetadata"
|
1585
|
+
relatedResource:
|
1586
|
+
description: Other resources associated with the described resource.
|
1587
|
+
type: array
|
1588
|
+
items:
|
1589
|
+
$ref: "#/components/schemas/RelatedResource"
|
1590
|
+
marcEncodedData:
|
1591
|
+
description: Data about the resource represented in MARC fixed fields and codes.
|
1592
|
+
type: array
|
1593
|
+
items:
|
1594
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
1595
|
+
adminMetadata:
|
1596
|
+
$ref: "#/components/schemas/DescriptiveAdminMetadata"
|
1597
|
+
valueAt:
|
1598
|
+
description: URL or other pointer to the location of the resource description.
|
1599
|
+
type: string
|
1600
|
+
required:
|
1601
|
+
- title
|
1559
1602
|
RequestDRO:
|
1560
1603
|
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
1604
|
type: object
|
1562
1605
|
additionalProperties: false
|
1563
1606
|
properties:
|
1607
|
+
cocinaVersion:
|
1608
|
+
$ref: '#/components/schemas/CocinaVersion'
|
1564
1609
|
type:
|
1565
1610
|
type: string
|
1566
1611
|
enum:
|
@@ -1588,7 +1633,7 @@ components:
|
|
1588
1633
|
administrative:
|
1589
1634
|
$ref: '#/components/schemas/Administrative'
|
1590
1635
|
description:
|
1591
|
-
$ref: '#/components/schemas/
|
1636
|
+
$ref: '#/components/schemas/RequestDescription'
|
1592
1637
|
identification:
|
1593
1638
|
$ref: '#/components/schemas/RequestIdentification'
|
1594
1639
|
structural:
|
@@ -1596,6 +1641,7 @@ components:
|
|
1596
1641
|
geographic:
|
1597
1642
|
$ref: '#/components/schemas/Geographic'
|
1598
1643
|
required:
|
1644
|
+
- cocinaVersion
|
1599
1645
|
- administrative
|
1600
1646
|
- identification
|
1601
1647
|
- label
|
@@ -1619,8 +1665,6 @@ components:
|
|
1619
1665
|
type: array
|
1620
1666
|
items:
|
1621
1667
|
$ref: '#/components/schemas/Druid'
|
1622
|
-
hasAgreement:
|
1623
|
-
type: string
|
1624
1668
|
RequestFile:
|
1625
1669
|
type: object
|
1626
1670
|
additionalProperties: false
|
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.
|
4
|
+
version: 0.64.0
|
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-
|
11
|
+
date: 2022-01-26 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
|