From c53655bc525d7a50519c66d9442c3ccd8688fc80 Mon Sep 17 00:00:00 2001 From: Smitty Date: Sun, 26 Dec 2021 12:36:43 -0500 Subject: [PATCH] expand Entity::from_json docs --- src/entity.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/entity.rs b/src/entity.rs index c9075fd..211d59d 100755 --- a/src/entity.rs +++ b/src/entity.rs @@ -224,10 +224,13 @@ impl Entity { None } - /// Construct an entity from the Wikibase JSON repersentation. + /// Construct an entity from the Wikibase JSON repersentation. The input can either be an + /// object directly containing the Wikibase entity representation, or a multi-entity object + /// returned by some endpoints such as `Special:EntityData`. Multi-entity objects must only + /// contain one entity. /// /// # Errors - /// If the JSON reperesntation can't be parsed to an `Entity` an `EntityError` will be returned. + /// If the JSON reperesntation can't be parsed to an `Entity`, an `EntityError` will be returned. pub fn from_json(mut json: Value) -> Result { let mut json = match json.get_mut("entities") { Some(ents) => {