From 61167008c8b776f9360c3d92c18d689cd8897065 Mon Sep 17 00:00:00 2001 From: DerDrodt Date: Fri, 15 Dec 2023 17:07:43 +0100 Subject: [PATCH] Fail on unknown fields (fix #108); Fix doc comments; Fix documentation for DOI (fix #110) --- docs/file-format.md | 10 +--------- src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/file-format.md b/docs/file-format.md index 51d03638..b9aa8e6f 100644 --- a/docs/file-format.md +++ b/docs/file-format.md @@ -298,20 +298,12 @@ This section lists all possible fields and data types for them. | **Description:** | canonical public URL of the item, can have access date | | **Example:** | `url: { value: https://www.reddit.com/r/AccidentalRenaissance/comments/er1uxd/japanese_opposition_members_trying_to_block_the/, date: 2020-12-29 }` | -#### `doi` - -| | | -|------------------|-----------------------------------------------------------| -| **Data type:** | string | -| **Description:** | Digital Object Identifier (DOI) of the item (without resolver). Due to YAML's way of parsing strings, some DOIs have to be wrapped by double-quotes as shown below. | -| **Example:** | `doi: "10.22541/au.148771883.35456290"` | - #### `serial-number` | | | |------------------|-----------------------------------------------------------| | **Data type:** | string or dictionary of strings | -| **Description:** | Any serial number, including article numbers. If you have serial numbers of well-known schemes like `doi`, you can 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. | +| **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. | | **Example:** | `serial-number: 2003.13722` or
serial-number:
doi: "10.22541/au.148771883.35456290"
arxiv: "1906.00356"
serial: "8516"
| #### `language` diff --git a/src/lib.rs b/src/lib.rs index 5b32bad5..6b31482a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -115,7 +115,8 @@ quantized-vortex: title: Structure of a Quantized Vortex in Boson Systems date: 1961-05 page-range: 454-477 - doi: 10.1007/BF02731494 + serial-number: + doi: 10.1007/BF02731494 parent: issue: 3 volume: 20 @@ -354,6 +355,7 @@ macro_rules! entry { struct MyVisitor; #[derive(Deserialize)] + #[serde(deny_unknown_fields)] struct NakedEntry { #[serde(rename = "type")] entry_type: Option,