cocina-models 0.51.0 → 0.52.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocina/models/event.rb +11 -1
- data/lib/cocina/models/validator.rb +2 -1
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a9f53ca8dbbb3649b0dad155b0ad42fa6901f3c9b7a7082ef1571197b006b6e
|
4
|
+
data.tar.gz: 806294c0697f580c59beb6d8ced0e7b738c843576621c4c60ffb29632305e09b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8047d6f2a4d16f0c8269440d3ba6db3e616c4cf93c1a7071d62e70c40614f60740f724c03351d579f009b0957e0a658f5bf6a10ef5f256e00621e615f31991c0
|
7
|
+
data.tar.gz: ebeb2ef783b0ada2f5e23dc181a28ed07cf03be4262917cab39c163179314bf35c255c656d65d02c7cc6b05c7a680789a7d8ec2bcf29ce7c0cd46290417fd76a
|
data/lib/cocina/models/event.rb
CHANGED
@@ -4,6 +4,17 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
class Event < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
# Code representing the standard or encoding.
|
8
|
+
attribute :code, Types::Strict::String.meta(omittable: true)
|
9
|
+
# URI for the standard or encoding.
|
10
|
+
attribute :uri, Types::Strict::String.meta(omittable: true)
|
11
|
+
# String describing the standard or encoding.
|
12
|
+
attribute :value, Types::Strict::String.meta(omittable: true)
|
13
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
|
+
# The version of the standard or encoding.
|
15
|
+
attribute :version, Types::Strict::String.meta(omittable: true)
|
16
|
+
attribute :source, Source.optional.meta(omittable: true)
|
17
|
+
attribute :valueScript, Standard.optional.meta(omittable: true)
|
7
18
|
# Description of the event (creation, publication, etc.).
|
8
19
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
20
|
# The preferred display label to use for the event in access systems.
|
@@ -12,7 +23,6 @@ module Cocina
|
|
12
23
|
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
13
24
|
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
25
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
16
26
|
attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).meta(omittable: true)
|
17
27
|
end
|
18
28
|
end
|
@@ -7,7 +7,8 @@ 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
|
+
# JSON.parse forces serialization of objects like DateTime.
|
11
|
+
request_operation.validate_request_body('application/json', JSON.parse(attributes.to_json))
|
11
12
|
rescue OpenAPIParser::OpenAPIError => e
|
12
13
|
raise ValidationError, e.message
|
13
14
|
end
|
data/openapi.yml
CHANGED