Diff

mod_rest/openapi.yaml @ 4479:356b5ad521a5

mod_rest: Add schema for errors I forget, are these util.error objects in the json mapping?
author Kim Alvefur <zash@zash.se>
date Sun, 28 Feb 2021 20:47:32 +0100
parent 4478:7ab0c423688a
child 4486:4f41678ba00d
line wrap: on
line diff
--- a/mod_rest/openapi.yaml	Sun Feb 28 19:33:09 2021 +0100
+++ b/mod_rest/openapi.yaml	Sun Feb 28 20:47:32 2021 +0100
@@ -250,6 +250,8 @@
           $ref: '#/components/schemas/thread'
         command:
           $ref: '#/components/schemas/command'
+        error:
+          $ref: '#/components/schemas/error'
       type: object
       example:
         body: Hello
@@ -541,6 +543,29 @@
     nick:
       type: string
       description: Nickname of the sender
+    error:
+      type: object
+      description: Description of something gone wrong. See the Stanza Errors section in RFC 6120.
+      properties:
+        type:
+          description: General category of error
+          type: string
+          enum:
+          - auth
+          - cancel
+          - continue
+          - modify
+          - wait
+        condition:
+          description: Specific error condition.
+          type: string
+          # enum: [ full list available in RFC 6120 ]
+        code:
+          description: Legacy numeric error code. Similar to HTTP status codes.
+          type: integer
+        text:
+          description: Description of error intended for human eyes.
+          type: string
   securitySchemes:
     token:
       description: Tokens from mod_http_oauth2.