cocina-models 0.66.0 → 0.67.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: def07c3b758899fb7dafda2ab26d7376318137895cb1335ab22404ab939e6e15
4
- data.tar.gz: cb8f57478510d3f40a9241e944484437889dbf4b0b09e992696da7b9d1e595c1
3
+ metadata.gz: 14a49c375a660bd05882ee93aeaf458dddb883e88ea55ed4e80bb48b2458446b
4
+ data.tar.gz: ef9426b29aedcfc6cbc1cb55118de413f7bd64f9df9234f5203d2f67eee19583
5
5
  SHA512:
6
- metadata.gz: 1de2f3d0703139311d8f58f1ec24b5b579b330c0461c645ebe76d153930ab91850d694a2b7a138a8ee6c63ee8ba5562f6c24ff044a7dd0bf40355eb1007afd51
7
- data.tar.gz: ecdfd2b784a0e42c30e348d08dbe7a6f092c369d7830dd86b11c2ff8185fef4238068fdc4b5e7fe8af90d1d9477e17436d03fde5058855d97819a7270ebc304e
6
+ metadata.gz: 25aed0abff20bc69292031adf1eee12b4b6ca528525ad9898e0baf464ec1e99c6c0e518a7585fdab4dc63651175da88e5f179dfdb1ef35e79ba1d1087cf1efbc
7
+ data.tar.gz: babf7508c4aab20689bfd7d7618711b51a254405bd111117dd9a758b6dc556f571af9f90fb50929f515698a22a35c36275a26641ee5c93a3d51faa658a92481a
data/.rubocop.yml CHANGED
@@ -83,6 +83,7 @@ Metrics/MethodLength:
83
83
  Max: 14
84
84
  Exclude:
85
85
  - 'spec/cocina/models/file_access_spec.rb'
86
+ - 'spec/cocina/models/dro_access_spec.rb'
86
87
 
87
88
  # ----- RSpec ------
88
89
 
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'dry-struct', '~> 1.0'
29
29
  spec.add_dependency 'dry-types', '~> 1.1'
30
30
  spec.add_dependency 'openapi3_parser' # Parsing openapi doc
31
- spec.add_dependency 'openapi_parser' # Validating openapi requests
31
+ spec.add_dependency 'openapi_parser', '~> 1.0' # Validating openapi requests
32
32
  spec.add_dependency 'thor'
33
33
  spec.add_dependency 'zeitwerk', '~> 2.1'
34
34
 
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class AdminPolicyAdministrative < Struct
6
- attribute :defaultAccess, AdminPolicyDefaultAccess.optional.meta(omittable: true)
6
+ attribute(:defaultAccess, AdminPolicyDefaultAccess.default { AdminPolicyDefaultAccess.new })
7
7
  attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
8
8
  # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
9
9
  # example: wasCrawlPreassemblyWF
@@ -8,7 +8,7 @@ module Cocina
8
8
  attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).default([].freeze)
9
9
  # Administrative or Internal project this resource is a part of
10
10
  # example: Google Books
11
- attribute :partOfProject, Types::Strict::String.meta(omittable: true)
11
+ attribute :partOfProject, Types::Strict::String.optional.meta(omittable: true)
12
12
  end
13
13
  end
14
14
  end
@@ -26,7 +26,7 @@ module Cocina
26
26
  attribute :version, Types::Strict::Integer
27
27
  attribute(:access, CollectionAccess.default { CollectionAccess.new })
28
28
  attribute :administrative, Administrative.optional.meta(omittable: true)
29
- attribute :description, Description.optional.meta(omittable: true)
29
+ attribute(:description, Description.default { Description.new })
30
30
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
31
31
  end
32
32
  end
@@ -36,7 +36,7 @@ module Cocina
36
36
  attribute :version, Types::Strict::Integer
37
37
  attribute(:access, DROAccess.default { DROAccess.new })
38
38
  attribute(:administrative, Administrative.default { Administrative.new })
39
- attribute :description, Description.optional.meta(omittable: true)
39
+ attribute(:description, Description.default { Description.new })
40
40
  attribute :identification, Identification.optional.meta(omittable: true)
41
41
  attribute :structural, DROStructural.optional.meta(omittable: true)
42
42
  attribute :geographic, Geographic.optional.meta(omittable: true)
@@ -14,7 +14,7 @@ module Cocina
14
14
  attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
15
15
  attribute :type, Types::Strict::String.enum(*RequestAdminPolicy::TYPES)
16
16
  attribute :label, Types::Strict::String
17
- attribute :version, Types::Strict::Integer
17
+ attribute :version, Types::Strict::Integer.default(1).enum(1)
18
18
  attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
19
19
  attribute :description, RequestDescription.optional.meta(omittable: true)
20
20
  end
@@ -18,7 +18,7 @@ module Cocina
18
18
  attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
19
19
  attribute :type, Types::Strict::String.enum(*RequestCollection::TYPES)
20
20
  attribute :label, Types::Strict::String
21
- attribute :version, Types::Strict::Integer
21
+ attribute :version, Types::Strict::Integer.default(1).enum(1)
22
22
  attribute(:access, CollectionAccess.default { CollectionAccess.new })
23
23
  attribute(:administrative, Administrative.default { Administrative.new })
24
24
  attribute :description, RequestDescription.optional.meta(omittable: true)
@@ -28,7 +28,7 @@ module Cocina
28
28
  attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
29
29
  attribute :type, Types::Strict::String.enum(*RequestDRO::TYPES)
30
30
  attribute :label, Types::Strict::String
31
- attribute :version, Types::Strict::Integer
31
+ attribute :version, Types::Strict::Integer.default(1).enum(1)
32
32
  attribute :access, DROAccess.optional.meta(omittable: true)
33
33
  attribute(:administrative, Administrative.default { Administrative.new })
34
34
  attribute :description, RequestDescription.optional.meta(omittable: true)
@@ -35,7 +35,7 @@ module Cocina
35
35
 
36
36
  # rubocop:disable Style/ClassVars
37
37
  def self.root
38
- @@root ||= OpenAPIParser.parse(YAML.load_file(openapi_path))
38
+ @@root ||= OpenAPIParser.parse(YAML.load_file(openapi_path), strict_reference_validation: true)
39
39
  end
40
40
  # rubocop:enable Style/ClassVars
41
41
  private_class_method :root
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.66.0'
5
+ VERSION = '0.67.0'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -178,6 +178,7 @@ components:
178
178
  description: Administrative or Internal project this resource is a part of
179
179
  example: Google Books
180
180
  type: string
181
+ nullable: true
181
182
  required:
182
183
  - hasAdminPolicy
183
184
  AdminPolicy:
@@ -240,6 +241,7 @@ components:
240
241
  required:
241
242
  - hasAdminPolicy
242
243
  - hasAgreement
244
+ - defaultAccess
243
245
  AdminPolicyDefaultAccess:
244
246
  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.'
245
247
  type: object
@@ -410,6 +412,7 @@ components:
410
412
  $ref: '#/components/schemas/CollectionIdentification'
411
413
  required:
412
414
  - cocinaVersion
415
+ - description
413
416
  - externalIdentifier
414
417
  - label
415
418
  - type
@@ -890,6 +893,7 @@ components:
890
893
  - cocinaVersion
891
894
  - access
892
895
  - administrative
896
+ - description
893
897
  - externalIdentifier
894
898
  - label
895
899
  - type
@@ -1480,6 +1484,9 @@ components:
1480
1484
  type: string
1481
1485
  version:
1482
1486
  type: integer
1487
+ default: 1
1488
+ enum:
1489
+ - 1
1483
1490
  administrative:
1484
1491
  $ref: '#/components/schemas/AdminPolicyAdministrative'
1485
1492
  description:
@@ -1509,6 +1516,9 @@ components:
1509
1516
  type: string
1510
1517
  version:
1511
1518
  type: integer
1519
+ default: 1
1520
+ enum:
1521
+ - 1
1512
1522
  access:
1513
1523
  $ref: '#/components/schemas/CollectionAccess'
1514
1524
  administrative:
@@ -1626,6 +1636,9 @@ components:
1626
1636
  type: string
1627
1637
  version:
1628
1638
  type: integer
1639
+ default: 1
1640
+ enum:
1641
+ - 1
1629
1642
  access:
1630
1643
  $ref: '#/components/schemas/DROAccess'
1631
1644
  administrative:
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.66.0
4
+ version: 0.67.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-02-25 00:00:00.000000000 Z
11
+ date: 2022-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: openapi_parser
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: thor
85
85
  requirement: !ruby/object:Gem::Requirement