Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused, deprecated parallelContributor #533

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/cocina/models/contributor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Contributor < Struct
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
# URL or other pointer to the location of the contributor information.
attribute? :valueAt, Types::Strict::String
attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([].freeze)
end
end
end
2 changes: 1 addition & 1 deletion lib/cocina/models/description.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Description < Struct
attribute? :adminMetadata, DescriptiveAdminMetadata.optional
# URL or other pointer to the location of the resource description.
attribute? :valueAt, Types::Strict::String
# Stanford persistent URL associated with the related resource. Note this is http, not https.
# Stanford persistent URL associated with the related resource.
attribute :purl, Types::Strict::String
end
end
Expand Down
21 changes: 0 additions & 21 deletions lib/cocina/models/descriptive_parallel_contributor.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/cocina/models/related_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RelatedResource < Struct
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
attribute? :standard, Standard.optional
attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
# Stanford persistent URL associated with the related resource. Note this is http, not https.
# Stanford persistent URL associated with the related resource.
attribute? :purl, Types::Strict::String
attribute? :access, DescriptiveAccessMetadata.optional
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def match?(path, type_signature)
# Some part of the path are ignored for the purpose of matching.
def clean_path(path)
new_path = path.reject do |part|
part.is_a?(Integer) || %i[parallelValue parallelContributor parallelEvent].include?(part)
part.is_a?(Integer) || %i[parallelValue parallelEvent].include?(part)
end
# This needs to happen after parallelValue is removed
# to handle structuredValue > parallelValue > structuredValue
Expand Down
43 changes: 0 additions & 43 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,6 @@ components:
valueAt:
description: URL or other pointer to the location of the contributor information.
type: string
parallelContributor:
description: For multiple representations of information about the same contributor (e.g. in different languages).
type: array
items:
$ref: "#/components/schemas/DescriptiveParallelContributor"
ControlledDigitalLendingAccess:
type: object
properties:
Expand Down Expand Up @@ -777,44 +772,6 @@ components:
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
DescriptiveParallelContributor:
description: Value model for multiple representations of information about the same contributor (e.g. in different languages).
deprecated: true
type: object
additionalProperties: false
properties:
name:
description: Names associated with a contributor.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
type:
description: Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types.
type: string
status:
description: Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
type: string
role:
description: Relationships of the contributor to the resource or to an event in its history.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
identifier:
description: Identifiers and URIs associated with the contributor entity.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
note:
description: Other information associated with the contributor.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
valueAt:
description: URL or other pointer to the location of the contributor information.
type: string
valueLanguage:
# description: Language of the descriptive element value
$ref: "#/components/schemas/DescriptiveValueLanguage"
DescriptiveParallelEvent:
description: Value model for multiple representations of information about the same event (e.g. in different languages).
type: object
Expand Down
86 changes: 0 additions & 86 deletions spec/cocina/models/validators/description_types_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,92 +256,6 @@
end
end

describe 'with an invalid parallelContributor' do
let(:desc_props) do
{
contributor: [
{
parallelContributor: [
{
name: [
{
structuredValue: [
{
value: 'Li, Yahong',
type: 'foo'
},
{
value: '1963-',
type: 'life dates'
}
]
}
]
},
{
name: [
{
value: '李亞虹'
}
]
}
],
type: 'person'
}
]
}
end

it 'ignores parallelContributor and raises' do
expect do
validate
end.to raise_error(Cocina::Models::ValidationError,
'Unrecognized types in description: ' \
'contributor1.parallelContributor1.name1.structuredValue1 (foo)')
end
end

describe 'with an valid parallelContributor' do
let(:desc_props) do
{
contributor: [
{
parallelContributor: [
{
name: [
{
structuredValue: [
{
value: 'Li, Yahong',
type: 'name'
},
{
value: '1963-',
type: 'life dates'
}
]
}
]
},
{
name: [
{
value: '李亞虹'
}
]
}
],
type: 'person'
}
]
}
end

it 'ignores parallelContributor and does not raise' do
expect { validate }.not_to raise_error
end
end

describe 'with a nested structuredValue' do
let(:desc_props) do
{
Expand Down