-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
update and improve json schemas to draft 7 #161
Changes from 6 commits
2dfaaaf
2e0804d
b354324
fd710be
e3f272b
ab0f98d
38e1bc0
10d92c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,103 @@ | ||
{ | ||
"$id": "https://raw.githubusercontent.com/citation-style-language/schema/master/csl-citation.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "JSON schema for CSL citation objects", | ||
"$schema" : "http://json-schema.org/draft-03/schema#", | ||
"id": "https://github.com/citation-style-language/schema/raw/master/csl-citation.json", | ||
"definitions": { | ||
"citationItemDefinition": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": [ | ||
"string", | ||
"number" | ||
] | ||
}, | ||
"itemData": { | ||
dsifford marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"$ref": "csl-data.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't tried using your version schema, but are you sure this shouldn't be |
||
}, | ||
"prefix": { | ||
"type": "string" | ||
}, | ||
"suffix": { | ||
"type": "string" | ||
}, | ||
"locator": { | ||
"type": "string" | ||
}, | ||
"label": { | ||
"type": "string", | ||
"enum": [ | ||
"book", | ||
"chapter", | ||
"column", | ||
"figure", | ||
"folio", | ||
"issue", | ||
"line", | ||
"note", | ||
"opus", | ||
"page", | ||
"paragraph", | ||
"part", | ||
"section", | ||
"sub verbo", | ||
"verse", | ||
"volume" | ||
] | ||
}, | ||
"suppress-author": { | ||
"type": [ | ||
"string", | ||
"number", | ||
"boolean" | ||
] | ||
}, | ||
"author-only": { | ||
"type": [ | ||
"string", | ||
"number", | ||
"boolean" | ||
] | ||
}, | ||
"uris": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "uri" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed this to specifically require There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be breaking so I'm gonna leave it. |
||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"schema": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See https://github.com/rmzelle/ref-extractor/wiki#single-item-zotero-citation again. Zotero and Mendeley both reference the "csl-citation.json" schema in their embedded citation metadata. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but why cant they use JSON schema as it's indended and just reference the base schema using the top-level |
||
"type": "string", | ||
"required": true, | ||
"enum" : [ | ||
"https://github.com/citation-style-language/schema/raw/master/csl-citation.json" | ||
] | ||
"format": "uri" | ||
}, | ||
"citationID": { | ||
dsifford marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"type": [ | ||
"string", | ||
"number" | ||
], | ||
"required": true | ||
"number" | ||
] | ||
}, | ||
"citationItems": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": [ | ||
"string", | ||
"number" | ||
], | ||
"required": true | ||
}, | ||
"itemData": { | ||
"$ref": "csl-data.json/#/items" | ||
}, | ||
"prefix": { | ||
"type": "string" | ||
}, | ||
"suffix": { | ||
"type": "string" | ||
}, | ||
"locator": { | ||
"type": "string" | ||
}, | ||
"label": { | ||
"type": "string", | ||
"enum": [ | ||
"book", | ||
"chapter", | ||
"column", | ||
"figure", | ||
"folio", | ||
"issue", | ||
"line", | ||
"note", | ||
"opus", | ||
"page", | ||
"paragraph", | ||
"part", | ||
"section", | ||
"sub verbo", | ||
"verse", | ||
"volume" | ||
] | ||
}, | ||
"suppress-author": { | ||
"type": [ | ||
"string", | ||
"number", | ||
"boolean" | ||
] | ||
}, | ||
"author-only": { | ||
"type": [ | ||
"string", | ||
"number", | ||
"boolean" | ||
] | ||
}, | ||
"uris": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
"$ref": "#/definitions/citationItemDefinition" | ||
} | ||
}, | ||
"properties": { | ||
"type": "object", | ||
"properties": { | ||
"noteIndex": { | ||
"type": "number" | ||
} | ||
"type": "number" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties" : false | ||
"required": ["schema", "citationID", "citationItems"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed this to include |
||
"additionalProperties": false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original schema requires "id" for each citation item, which is a requirement we should keep.