Skip to content

Commit

Permalink
add new variant of voc-slug without integer event id
Browse files Browse the repository at this point in the history
  • Loading branch information
saerdnaer committed Dec 26, 2024
1 parent 8d135c6 commit 2f44a14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion validator/xsd/schedule.xml.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<xs:element type="start" name="start"/>
<xs:element type="duration" name="duration"/>
<xs:element type="xs:string" name="abstract"/>
<xs:element type="voc-slug" name="slug"/>
<xs:element type="voc-slug-new" name="slug"/>
<xs:element type="xs:string" name="track"/>
<!-- logo is the path or URL to an image, we use httpURI as type here as apps prefer full URLs now -->
<xs:element type="emptyOrURI" name="logo" minOccurs="0" />
Expand Down Expand Up @@ -146,6 +146,12 @@
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="voc-slug-new">
<xs:restriction base="xs:string">
<xs:pattern value="[a-z0-9_]{4,}-[a-z0-9\-_]{4,}"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="slug">
<xs:restriction base="xs:string">
<xs:pattern value="[a-z0-9-]{2,}"/>
Expand Down
2 changes: 1 addition & 1 deletion voc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def str2timedelta(s):

def parse_json(text):
# this more complex way is necessary
# to maintain the same order as in the input file
# to maintain the same order as in the input file in python2
return json.JSONDecoder(object_pairs_hook=OrderedDict).decode(text)


Expand Down

0 comments on commit 2f44a14

Please sign in to comment.