Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123994
D7253.id26282.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D7253.id26282.diff
View Options
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
Details
Attached
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
Attached To
D7253: Make codemeta:name mandatory in codemeta:author and codemeta:contributor
Event Timeline
Log In to Comment