Diff

mod_rest/openapi.yaml @ 4495:cdc530ec76d6

mod_rest/openapi: Improve ping (XEP-0199) representation
author Kim Alvefur <zash@zash.se>
date Thu, 04 Mar 2021 01:26:41 +0100
parent 4494:aa4dcd4b39c8
child 4496:8e9bff3cde4f
line wrap: on
line diff
--- a/mod_rest/openapi.yaml	Thu Mar 04 01:21:11 2021 +0100
+++ b/mod_rest/openapi.yaml	Thu Mar 04 01:26:41 2021 +0100
@@ -3,7 +3,7 @@
 
 info:
   title: mod_rest API
-  version: 0.2.1
+  version: 0.3.0
   description: |
     API for sending and receiving stanzas, in a REST-ish fashion or by
     responding to webhooks. Multiple formats supported, including native XML
@@ -57,7 +57,15 @@
       - $ref: '#/components/parameters/to'
       responses:
         200:
-          $ref: '#/components/responses/success'
+          description: Test reachability of some address
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/iq_pong'
+            application/xmpp+xml:
+              schema:
+                $ref: '#/components/schemas/iq_pong'
+
 
   /rest/version/{to}:
     get:
@@ -188,6 +196,19 @@
         error:
           $ref: '#/components/schemas/error'
 
+    iq_pong:
+      description: Test reachability of some XMPP address
+      type: object
+      xml:
+        name: iq
+      properties:
+        type:
+          type: string
+          enum:
+          - result
+          xml:
+            attribute: true
+
     iq_result_version:
       description: Version query response
       type: object