Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396095 )

Change subject: Summary: fix geo coordinates
......................................................................

Summary: fix geo coordinates

There were always coming back empty since we were looking for the wrong
keys in the MW API metadata response. Not sure how this regressed.

Updated the spec examples to include an example with coordinates.

Change-Id: If36017dffb8212f3537c5a27e6dba2c520911138
---
M lib/mobile-util.js
M spec.yaml
2 files changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/95/396095/1

diff --git a/lib/mobile-util.js b/lib/mobile-util.js
index 46a6c66..f32c1ab 100644
--- a/lib/mobile-util.js
+++ b/lib/mobile-util.js
@@ -243,9 +243,9 @@
         timestamp: meta.lastmodified,
         description: meta.description,
         coordinates: meta.geo && {
-            lat: meta.geo.lat,
-            lon: meta.geo.lon
-        },
+            lat: meta.geo.latitude,
+            lon: meta.geo.longitude
+        } || undefined,
         content_urls: mUtil.buildContentUrls(domain, title, meta),
         api_urls: mUtil.buildApiUrls(domain, title, meta),
     }, summary);
diff --git a/spec.yaml b/spec.yaml
index ed54015..8f13170 100644
--- a/spec.yaml
+++ b/spec.yaml
@@ -667,11 +667,11 @@
           schema:
             $ref: '#/definitions/problem'
       x-amples:
-        - title: Get summary for Barack Obama
+        - title: Get summary for Manitowoc, Wisconsin
           request:
             params:
               domain: en.wikipedia.org
-              title: Barack_Obama
+              title: Manitowoc,_Wisconsin
           response:
             status: 200
             headers:
@@ -702,6 +702,9 @@
               revision: /.+/
               tid: /.+/
               timestamp: /.+/
+              coordinates:
+                lat: /.+/
+                lon: /.+/
               description: /.+/
               content_urls:
                 desktop:

-- 
To view, visit https://gerrit.wikimedia.org/r/396095
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If36017dffb8212f3537c5a27e6dba2c520911138
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to