Page MenuHomeSoftware Heritage

D7252.id26307.diff
No OneTemporary

D7252.id26307.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
@@ -67,7 +67,21 @@
<entry {XMLNS}>
<url>some url</url>
<codemeta:name>bar</codemeta:name>
- <codemeta:author>no one</codemeta:author>
+ <codemeta:author>
+ <codemeta:name>no one</codemeta:name>
+ </codemeta:author>
+ {PROVENANCE_XML}
+ </entry>
+ """,
+ ),
+ (
+ f"""\
+ <entry {XMLNS}>
+ <url>some url</url>
+ <codemeta:name>bar</codemeta:name>
+ <codemeta:author>
+ <schema:unknown-tag>should allow anything here</schema:unknown-tag>
+ </codemeta:author>
{PROVENANCE_XML}
</entry>
""",
@@ -304,6 +318,22 @@
},
],
),
+ (
+ f"""\
+ <entry {XMLNS}>
+ <url>some url</url>
+ <codemeta:name>bar</codemeta:name>
+ <codemeta:author>no one</codemeta:author>
+ {PROVENANCE_XML}
+ </entry>
+ """,
+ [
+ {
+ "summary": ".*Reason: character data between child elements.*",
+ "fields": ["codemeta:author"],
+ },
+ ],
+ ),
(
f"""\
<entry {XMLNS}>
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
@@ -17,5 +17,18 @@
<xsd:union memberTypes="xsd:date xsd:dateTime"/>
</xsd:simpleType>
+ <xsd:element name="author" type="codemeta:PersonOrOrganization">
+ </xsd:element>
+ <xsd:element name="contributor" type="codemeta:PersonOrOrganization">
+ </xsd:element>
+
+ <xsd:complexType name="PersonOrOrganization">
+ <!-- Allows anything, but at least <codemeta:name> should be present -->
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element ref="codemeta:name" />
+ <xsd:any processContents="lax" />
+ </xsd:choice>
+ </xsd:complexType>
+
<xsd:element name="name" type="xsd:string" />
</xsd:schema>

File Metadata

Mime Type
text/plain
Expires
Dec 20 2024, 7:31 AM (11 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217457

Event Timeline