From 7b019c0194d05fee66864e52530636d97be01e61 Mon Sep 17 00:00:00 2001 From: jrcastro2 Date: Wed, 4 Sep 2024 09:59:54 +0200 Subject: [PATCH] names: add props * closes https://github.com/CERNDocumentServer/cds-rdm/issues/193 --- .../contrib/names/jsonschemas/names/name-v1.0.0.json | 8 ++++++++ .../contrib/names/mappings/os-v1/names/name-v2.0.0.json | 4 ++++ .../contrib/names/mappings/os-v2/names/name-v2.0.0.json | 4 ++++ invenio_vocabularies/contrib/names/schema.py | 2 ++ 4 files changed, 18 insertions(+) diff --git a/invenio_vocabularies/contrib/names/jsonschemas/names/name-v1.0.0.json b/invenio_vocabularies/contrib/names/jsonschemas/names/name-v1.0.0.json index 78ae9dbe..528d1ff9 100644 --- a/invenio_vocabularies/contrib/names/jsonschemas/names/name-v1.0.0.json +++ b/invenio_vocabularies/contrib/names/jsonschemas/names/name-v1.0.0.json @@ -24,6 +24,14 @@ "items": {"$ref": "local://definitions-v1.0.0.json#/identifiers_with_scheme"}, "uniqueItems": true }, + "props": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": ["string", "boolean"] + } + } + }, "affiliations": { "description": "Affiliations of the person.", "type": "array", diff --git a/invenio_vocabularies/contrib/names/mappings/os-v1/names/name-v2.0.0.json b/invenio_vocabularies/contrib/names/mappings/os-v1/names/name-v2.0.0.json index bb67063c..bb43c31f 100644 --- a/invenio_vocabularies/contrib/names/mappings/os-v1/names/name-v2.0.0.json +++ b/invenio_vocabularies/contrib/names/mappings/os-v1/names/name-v2.0.0.json @@ -144,6 +144,10 @@ "type": "keyword" } } + }, + "props": { + "type": "object", + "dynamic": "true" } } } diff --git a/invenio_vocabularies/contrib/names/mappings/os-v2/names/name-v2.0.0.json b/invenio_vocabularies/contrib/names/mappings/os-v2/names/name-v2.0.0.json index bb67063c..bb43c31f 100644 --- a/invenio_vocabularies/contrib/names/mappings/os-v2/names/name-v2.0.0.json +++ b/invenio_vocabularies/contrib/names/mappings/os-v2/names/name-v2.0.0.json @@ -144,6 +144,10 @@ "type": "keyword" } } + }, + "props": { + "type": "object", + "dynamic": "true" } } } diff --git a/invenio_vocabularies/contrib/names/schema.py b/invenio_vocabularies/contrib/names/schema.py index 287d4f86..0893f0c1 100644 --- a/invenio_vocabularies/contrib/names/schema.py +++ b/invenio_vocabularies/contrib/names/schema.py @@ -42,6 +42,8 @@ class NameSchema(BaseVocabularySchema, ModePIDFieldVocabularyMixin): ) ) affiliations = fields.List(fields.Nested(AffiliationRelationSchema)) + props = fields.Dict(keys=fields.Str(), values=fields.Raw()) + @validates_schema def validate_names(self, data, **kwargs):