Page MenuHomeSoftware Heritage

D7316.diff
No OneTemporary

D7316.diff

diff --git a/swh/deposit/tests/api/test_checks.py b/swh/deposit/tests/api/test_checks.py
--- a/swh/deposit/tests/api/test_checks.py
+++ b/swh/deposit/tests/api/test_checks.py
@@ -178,6 +178,22 @@
</entry>
""",
),
+ (
+ "codemeta-affiliation",
+ f"""\
+ <entry {XMLNS}>
+ <url>some url</url>
+ <codemeta:name>bar</codemeta:name>
+ <codemeta:author>
+ <codemeta:name>someone</codemeta:name>
+ <codemeta:affiliation>
+ <codemeta:name>My Orga</codemeta:name>
+ </codemeta:affiliation>
+ </codemeta:author>
+ {PROVENANCE_XML}
+ </entry>
+ """,
+ ),
(
"swh:add_to_origin",
f"""\
@@ -379,6 +395,26 @@
},
],
),
+ (
+ "chardata-in-affiliation",
+ f"""\
+ <entry {XMLNS}>
+ <url>some url</url>
+ <codemeta:name>bar</codemeta:name>
+ <codemeta:author>
+ <codemeta:name>someone</codemeta:name>
+ <codemeta:affiliation>My Orga</codemeta:affiliation>
+ </codemeta:author>
+ {PROVENANCE_XML}
+ </entry>
+ """,
+ [
+ {
+ "summary": ".*Reason: character data between child elements.*",
+ "fields": ["codemeta:author"],
+ },
+ ],
+ ),
(
"chardata-in-author",
f"""\
diff --git a/swh/deposit/xsd/codemeta.xsd b/swh/deposit/xsd/codemeta.xsd
--- a/swh/deposit/xsd/codemeta.xsd
+++ b/swh/deposit/xsd/codemeta.xsd
@@ -32,5 +32,10 @@
</xsd:all>
</xsd:complexType>
+ <!-- note that codemeta:affiliation expects Organization as value,
+ but https://codemeta.github.io/terms/ mistakenly documents it as Text.
+ See https://github.com/codemeta/codemeta/pull/239 -->
+ <xsd:element name="affiliation" type="codemeta:PersonOrOrganization" />
+
<xsd:element name="name" type="xsd:string" />
</xsd:schema>

File Metadata

Mime Type
text/plain
Expires
Dec 21 2024, 1:13 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225292

Event Timeline