Redundant id key in json schema?
See original GitHub issueWhy is there this additional id
key under citationItems
? Isn’t that redundant?
Or redundant with a purpose; easier processing?
Example:
{
"schema":"https://resource.citationstyles.org/schema/latest/input/json/csl-citation.json",
"citationID":"item1",
"citationItems":[
{
"id":"item1",
"itemData":{
"id":"item1",
"type":"book",
"title":"test title"
}
}
]
}
_Originally posted by @bdarcus in https://github.com/citation-style-language/schema/pull/233_
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Structuring a complex schema — Understanding JSON ...
The identifier for the embedded schema is the value of $id resolved against the Base URI of the schema it appears in. A...
Read more >JSON Schema Validation Duplicate Key Elements
JSON Schema can only work with valid JSON. This is not valid JSON; you can't have more than one key with the same...
Read more >Duplicate Keys in JSON - Forums - IBM Support
I've done some research and I understood that "duplicate" keys in JSON ... How can I avoid the use of duplicate keys or,...
Read more >Template structure and syntax - Azure Resource Manager
$schema, Yes, Location of the JavaScript Object Notation (JSON) schema ... Set the key to the resource ID and the value to an...
Read more >OpenAPI Specification - Version 3.0.3 - Swagger
Tags MUST be limited to those allowed by the JSON Schema ruleset. Keys used in YAML maps MUST be ... The key is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bdarcus I think the best way to approach this would be to leave citekey just in the data—Essentially as a human-readable alias for id.
(I think this is relevant, but correct me if I’m wrong.) This data shape is a processing outcome. The
citationItems
objects initially carry just theid
,locator
, andlabel
, and a processor will fetchitemData
to the object as a pointer based on theid
. In some contexts (bibliographies, sort-key generation) item data is handled as an array of objects, and theid
needs to be in there. To removeid
from theitemData
segment in citations would require cloning the object, which would break pointers, raise memory consumption a bit, and run the risk that multiple metadata representations of the same item would creep into documents. Removingid
from the parentcitationItems
objects would be to delete theid
received on input, which might not be a good idea.