Page MenuHomeSoftware Heritage

D7253.id26282.diff
No OneTemporary

D7253.id26282.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
@@ -80,6 +80,34 @@
<url>some url</url>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
+ <codemeta:name>someone</codemeta:name>
+ <schema:unknown-tag>should allow anything here</schema:unknown-tag>
+ </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:name>someone</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:name>someone</codemeta:name>
<schema:unknown-tag>should allow anything here</schema:unknown-tag>
</codemeta:author>
{PROVENANCE_XML}
@@ -334,6 +362,24 @@
},
],
),
+ (
+ 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>
+ """,
+ [
+ {
+ "summary": ".*Tag '?codemeta:name'? expected.*",
+ "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
@@ -23,11 +23,13 @@
</xsd:element>
<xsd:complexType name="PersonOrOrganization">
- <!-- Allows anything, but at least <codemeta:name> should be present -->
- <xsd:choice maxOccurs="unbounded">
+ <!-- Allows anything, but at least <codemeta:name> should be present.
+ This is not technically required by Codemeta, but we really want it
+ in swh-deposit. -->
+ <xsd:all>
<xsd:element ref="codemeta:name" />
- <xsd:any processContents="lax" />
- </xsd:choice>
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:all>
</xsd:complexType>
<xsd:element name="name" type="xsd:string" />

File Metadata

Mime Type
text/plain
Expires
Dec 20 2024, 8:50 AM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3226770

Event Timeline