From 8622873496964daa6168daaf93bfffa10baecaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henning=20Schiebenh=C3=B6fer?= Date: Mon, 14 Aug 2023 10:32:34 +0200 Subject: [PATCH] add vocabulary for language --- mex/common/models/resource.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mex/common/models/resource.py b/mex/common/models/resource.py index d18d3c06..f28b1b18 100644 --- a/mex/common/models/resource.py +++ b/mex/common/models/resource.py @@ -45,6 +45,12 @@ class Frequency(VocabularyEnum): __vocabulary__ = "frequency" +class Language(VocabularyEnum): + """Language type.""" + + __vocabulary__ = "language" + + class License(VocabularyEnum): """License type.""" @@ -82,7 +88,9 @@ class BaseResource(BaseModel): instrumentToolOrApparatus: list[Text] = [] isPartOf: list[ResourceID] = [] keyword: list[Text] = [] - language: list[str] = Field([], enum=["de", "en"]) + language: list[Language] = Field( + [], examples=["https://mex.rki.de/item/language-1"] + ) license: list[License] = Field( [], examples=["https://mex.rki.de/item/license-1"],