jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/389876 )

Change subject: Update swagger spec with the media endpoint updates
......................................................................


Update swagger spec with the media endpoint updates

Change-Id: I196429595a1a21099a812edb709de00b7a617098
---
M spec.yaml
M test/features/app/spec.js
2 files changed, 70 insertions(+), 0 deletions(-)

Approvals:
  BearND: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/spec.yaml b/spec.yaml
index c009d74..d24f2be 100644
--- a/spec.yaml
+++ b/spec.yaml
@@ -568,6 +568,15 @@
       description: Gets the images and videos which appear on a given wiki page
       produces:
         - application/json
+      responses:
+        '200':
+          description: Gets media items from a wiki page
+          schema:
+            $ref: '#/definitions/media_list'
+        default:
+          description: Error
+          schema:
+            $ref: '#/definitions/problem'
       x-amples:
         - title: retrieve images and videos of en.wp Cat page via media route
           request:
@@ -581,8 +590,12 @@
               items:
                 - title: /.+/
                   url: /.+/
+                  thumbUrl: /.+/
+                  mime: /.+/
                   width: /.+/
                   height: /.+/
+                  size: /.+/
+                  ext: /.+/
 
   # from routes/definition.js
   /{domain}/v1/page/definition/{title}:
@@ -1189,6 +1202,58 @@
       - size
       - timestamp
 
+  media_list:
+    type: object
+    properties:
+      items:
+        type: array
+        description: a list of media items
+        items:
+          $ref: '#/definitions/media_item'
+    required:
+      - items
+
+  media_item:
+    type: object
+    properties:
+      title:
+        type: string
+        description: the prefixed DB title for the item
+      url:
+        type: string
+        description: the content URL for the original item
+      thumbUrl:
+        type: string
+        description: the URL for a thumbnail of the original item
+      mime:
+        type: string
+        description: the MIME type
+      width:
+        type: integer
+        description: the original width
+      height:
+        type: integer
+        description: the original height
+      size:
+        type: integer
+        description: the original file size (sizes are not provided for video 
derivatives)
+      derivatives:
+        type: array
+        description: a list of derivatives of the original file (applies only 
to videos)
+      ext:
+        type: object
+        description: extended metadata about the object (provided by the 
CommonsMetadata extension)
+    required:
+      - title
+      - url
+      - thumbUrl
+      - mime
+      - width
+      - height
+      - size
+      - derivatives
+      - ext
+
   action:
     type: object
     properties:
diff --git a/test/features/app/spec.js b/test/features/app/spec.js
index cee7d9f..c5abfb0 100644
--- a/test/features/app/spec.js
+++ b/test/features/app/spec.js
@@ -359,6 +359,11 @@
             return assertValidSchema(uri, '#/definitions/summary');
         });
 
+        it('media response should conform to schema', () => {
+            const uri = `${baseUri}page/media/Hummingbird`;
+            return assertValidSchema(uri, '#/definitions/media_list');
+        });
+
         // Bad requests return empty response for aggregated=true
 
         it('featured article response should conform to schema (invalid lang, 
agg=true)', () => {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I196429595a1a21099a812edb709de00b7a617098
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Fjalapeno <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ppchelko <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to