Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create JSON Schema for YAML File #192

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
42d9417
create json schema
mkdjr Jul 29, 2024
a5b7df1
add examples from specification using the `examples` keyword
mkdjr Jul 29, 2024
5b0a3a8
use `$dynamicAnchor` and `$dynamicRef` according to the JSON 2020-12 …
mkdjr Jul 30, 2024
ae1f3a2
update `parent` schema to correctly reference `#entry` if in an array…
mkdjr Jul 30, 2024
e5ded8a
add `abstract`, `annote`, and `genre` to schema
mkdjr Aug 2, 2024
3bab47a
add `annote` example to JSON schema
mkdjr Aug 26, 2024
523f2c0
Hayagriva JSON Schema
jassielof Feb 23, 2025
a5ebeb6
done
jassielof Feb 23, 2025
5284869
fmt
jassielof Feb 23, 2025
020a9bb
Merge branch 'typst:main' into main
mkdjr Feb 23, 2025
e2619b4
bad title example
jassielof Feb 24, 2025
223172d
order
jassielof Feb 24, 2025
baa2a6b
title example with single quotes and regex pattern don't support inse…
jassielof Feb 24, 2025
d0f6d8f
unrequired title because of parents
jassielof Feb 24, 2025
69ab709
move examples to defintions and include
jassielof Feb 24, 2025
a2912fd
Use $id instead of $dynamicAnchor for schema recursion
mkdjr Feb 24, 2025
db747b5
prevent inclusion of unexpected fields for each entry
mkdjr Feb 24, 2025
ec85829
make entry type case insensitive
mkdjr Feb 24, 2025
541b530
allow `title` field to accept objects as well
mkdjr Feb 24, 2025
377f3a9
allow integers for the `date` field
mkdjr Feb 24, 2025
f3a4b80
rearrange fields in `author`
mkdjr Feb 24, 2025
6246e21
fix `parent` field
mkdjr Feb 24, 2025
1210d54
specify non-floats for certain fields
mkdjr Feb 24, 2025
dd9e0d9
allow numbers for serial numbers
mkdjr Feb 24, 2025
ee04012
fix misspelling of archive
mkdjr Feb 24, 2025
48a5cf2
add schema validation and `basic.yml` validation
mkdjr Feb 24, 2025
4d63efc
remove redundant imports
mkdjr Feb 24, 2025
cafd358
removed format date
jassielof Feb 24, 2025
288d3ba
date tilde support
jassielof Feb 24, 2025
06e971f
no entry type required
jassielof Feb 24, 2025
99922b0
serial number supports strings or numbers
jassielof Feb 24, 2025
60d47fd
enhance timestamp descriptions and patterns for overflow handling
jassielof Feb 24, 2025
e79d3db
examples moved from any of
jassielof Feb 24, 2025
2d64df5
removed year only string example
jassielof Feb 24, 2025
56c5f4f
affiliated list wit unique items
jassielof Feb 24, 2025
1b50fbe
arrays with unique items
jassielof Feb 24, 2025
644dde4
tab size 4 and formatting
jassielof Feb 24, 2025
c56dc3d
add schema ID
jassielof Feb 24, 2025
e71cae1
merge improved JSON schema and reformat `basic.yml`
mkdjr Feb 25, 2025
269693c
Merge branch 'jassielof-main'
mkdjr Feb 25, 2025
ea53efb
Edited field descriptions and added examples
mkdjr Feb 25, 2025
5248924
disallow additional properties for `formattableString`'s object variant
mkdjr Feb 25, 2025
6136ce0
remove `sentence-case` field from title
mkdjr Feb 25, 2025
a55817d
Entry type is now required in the schema and types are not fully case…
jassielof Mar 6, 2025
0c64041
Affiliated roles are not case insensitive as specified in the file-fo…
jassielof Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add examples from specification using the examples keyword
mkdjr committed Jul 29, 2024

Verified

This commit was signed with the committer’s verified signature.
mkdjr Michael Dawson
commit a5b7df1bf165c124c11f56b1e3b72d623bc33e58
185 changes: 162 additions & 23 deletions hayagriva.schema.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,34 @@
"$comment": "The key for a reference item can be series of alphanumeric characters that are uninterrupted by whitespace.",
"type": "object",
"description": "An entry in the bibliography. The citation key for the entry can be any alphanumeric character.",
"examples": [
{
"plaque": {
"type": "Misc",
"title": "Informational plaque about Jacoby's 1967 photos",
"publisher": "Stiftung Reinbeckhallen",
"location": "Berlin, Germany",
"date": 2020,
"parent": {
"type": "Artwork",
"date": 1967,
"author": "Jacoby, Max",
"parent": {
"type": "Anthology",
"title": "Bleibtreustraße",
"archive": "Landesmuseum Koblenz",
"archive-location": "Koblenz, Germany"
}
}
}
}
],
"properties": {
"type": {
"type": "string",
"examples": [
"video"
],
"enum": [
"article",
"chapter",
@@ -50,7 +75,10 @@
},
"title": {
"type": "string",
"description": "The title of the item."
"description": "The title of the item.",
"examples": [
"Rick Astley: How An Internet Joke Revived My Career"
]
},
"author": {
"type": [
@@ -85,11 +113,21 @@
},
"minItems": 1,
"uniqueItems": true,
"description": "The person or persons primarily responsible for the creation of the item."
"description": "The person or persons primarily responsible for the creation of the item.",
"examples": [
[
"Klocke, Iny",
"Wohlrath, Elmar"
],
"Klocke, Iny"
]
},
"date": {
"type": "string",
"description": "The date at which the item was published."
"description": "The date at which the item was published.",
"examples": [
"1949-05"
]
},
"parent": {
"anyOf": [
@@ -104,7 +142,17 @@
"minItems": 1,
"uniqueItems": true,
"description": "The item in which the item was published or to which it is strongly associated.",
"$comment": "^ This references the it's parent entry based on the `id`."
"$comment": "^ This references the it's parent entry based on the `id`.",
"examples": [
{
"type": "Anthology",
"title": "Automata studies",
"editor": [
"Shannon, C. E.",
"McCarthy, J."
]
}
]
}
]
},
@@ -118,11 +166,33 @@
},
"minItems": 1,
"uniqueItems": true,
"description": "The person or persons responsible for selecting and revising the content of the item."
"description": "The person or persons responsible for selecting and revising the content of the item.",
"examples": [
[
"Stringer, Gary A.",
"Pebworth, Ted-Larry"
]
]
},
"affiliated": {
"type": "array",
"description": "Persons involved with the item that do not fit `author` or `editor`.",
"examples": [
[
{
"role": "Director",
"names": "Cameron, James"
},
{
"role": "CastMember",
"names": [
"Schwarzenegger, Arnold",
"Hamilton, Linda",
"Patrick, Robert"
]
}
]
],
"items": {
"type": "object",
"properties": {
@@ -168,63 +238,104 @@
},
"call-number": {
"type": "string",
"description": "The number of the item in a library, institution, or collection. Use with `archive`."
"description": "The number of the item in a library, institution, or collection. Use with `archive`.",
"examples": [
"F16 D14"
]
},
"publisher": {
"type": "string",
"description": "Publisher of the item."
"description": "Publisher of the item.",
"examples": [
"Penguin Books"
]
},
"location": {
"type": "string",
"description": "The location at which the item was published or created."
"description": "The location at which the item was published or created.",
"examples": [
"Lahore, Pakistan"
]
},
"organization": {
"type": "string",
"description": "The organization at or for which the item was produced."
"description": "The organization at or for which the item was produced.",
"examples": [
"Technische Universität Berlin"
]
},
"issue": {
"type": [
"number",
"string"
],
"description": "For an item whose parent has multiple issues, indicates the position in the issue sequence. Also used to indicate the episode number for TV."
"description": "For an item whose parent has multiple issues, indicates the position in the issue sequence. Also used to indicate the episode number for TV.",
"examples": [
5,
"5"
]
},
"volume": {
"type": [
"number",
"string"
],
"description": "For an item whose parent has multiple volumes/parts/seasons ... of which this item is one."
"description": "For an item whose parent has multiple volumes/parts/seasons ... of which this item is one.",
"examples": [
"2-3",
2
]
},
"volume-total": {
"type": "number",
"description": "Total number of volumes/parts/seasons this item consists of."
"description": "Total number of volumes/parts/seasons this item consists of.",
"examples": [
12
]
},
"edition": {
"type": [
"number",
"string"
],
"description": "The published version of an item."
"description": "The published version of an item.",
"examples": [
"expanded and revised edition",
"second",
3
]
},
"page-range": {
"type": [
"number",
"string"
],
"description": "The range of pages within the parent this item occupies."
"description": "The range of pages within the parent this item occupies.",
"examples": [
"812 - 847",
812
]
},
"page-total": {
"type": "number",
"description": "total number of pages the item has"
"description": "total number of pages the item has",
"examples": [
1103
]
},
"time-range": {
"type": "string",
"description": "The time range within the parent this item starts and ends at."
"description": "The time range within the parent this item starts and ends at.",
"examples": [
"00:57-06:21"
]
},
"runtime": {
"type": "string",
"description": "The total runtime of the item."
"description": "The total runtime of the item.",
"examples": [
"01:42:21,802"
]
},
"url": {
"type": [
@@ -239,7 +350,15 @@
"date": {
"type": "string"
}
}
},
"examples": [
{
"url": {
"value": "https://www.reddit.com/r/AccidentalRenaissance/comments/er1uxd/japanese_opposition_members_trying_to_block_the/",
"date": "2020-12-29"
}
}
]
},
"serial-number": {
"type": [
@@ -249,23 +368,43 @@
"description": "Any serial number, including article numbers. If you have serial numbers of well-known schemes like doi, you should put them into the serial number as a dictionary like in the second example. Hayagriva will recognize and specially treat `doi`, `isbn`, `issn`, `pmid`, `pmcid`, and `arxiv`. You can also include `serial` for the serial number when you provide other formats as well.",
"additionalProperties": {
"type": "string"
}
},
"examples": [
"2003.13722",
{
"doi": "10.22541/au.148771883.35456290",
"arxiv": "1906.00356",
"serial": "8516"
}
]
},
"language": {
"type": "string",
"description": "The language of the item. Must be a Unicode language identifier."
"description": "The language of the item. Must be a Unicode language identifier.",
"examples": [
"zh-Hans"
]
},
"archive": {
"type": "string",
"description": "The name of the institution or collection where the item is kept."
"description": "The name of the institution or collection where the item is kept.",
"examples": [
"National Library of New Zealand"
]
},
"arhcive-location": {
"type": "string",
"description": "The location of the institution or collection where the item is kept."
"description": "The location of the institution or collection where the item is kept.",
"examples": [
"Wellington, New Zealand"
]
},
"note": {
"type": "string",
"description": "Any additional description to be appended after reference list entry."
"description": "Any additional description to be appended after reference list entry.",
"examples": [
"microfilm version"
]
}
}
}
Loading