Changeset

5922:7371320813a7

mod_rest: Add schema examples Also 'example' -> 'examples'
author Kim Alvefur <zash@zash.se>
date Sat, 04 May 2024 13:25:06 +0200
parents 5921:896e7c7bf87f
children 5923:694b62d8a82f
files mod_rest/res/schema-xmpp.json
diffstat 1 files changed, 43 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/res/schema-xmpp.json	Tue Apr 30 15:07:06 2024 -0500
+++ b/mod_rest/res/schema-xmpp.json	Sat May 04 13:25:06 2024 +0200
@@ -109,6 +109,9 @@
       },
       "delay" : {
          "description" : "Timestamp of when a stanza was delayed, in ISO 8601 / XEP-0082 format.",
+         "examples" : [
+            "2002-09-10T23:08:25Z"
+         ],
          "format" : "date-time",
          "title" : "XEP-0203: Delayed Delivery",
          "type" : "string",
@@ -120,7 +123,9 @@
       },
       "from" : {
          "description" : "the sender of the stanza",
-         "example" : "bob@example.net",
+         "examples" : [
+            "bob@example.net"
+         ],
          "format" : "xmpp-jid",
          "type" : "string",
          "xml" : {
@@ -129,6 +134,10 @@
       },
       "id" : {
          "description" : "Reasonably unique id. mod_rest generates one if left out.",
+         "examples" : [
+            "c6d02db2-5c1f-4e00-9014-4dd3e21309b0",
+            "EBRthZvxaAEXoTJ77w692pQW"
+         ],
          "type" : "string",
          "xml" : {
             "attribute" : true
@@ -136,7 +145,14 @@
       },
       "lang" : {
          "description" : "Language code",
-         "example" : "en",
+         "examples" : [
+            "de",
+            "en",
+            "en-UK",
+            "en-US",
+            "fr",
+            "sv-SE"
+         ],
          "type" : "string",
          "xml" : {
             "attribute" : true,
@@ -144,6 +160,9 @@
          }
       },
       "nick" : {
+         "examples" : [
+            "CallMeIshmael"
+         ],
          "type" : "string",
          "xml" : {
             "name" : "nick",
@@ -206,6 +225,9 @@
       "to" : {
          "description" : "the intended recipient for the stanza",
          "example" : "alice@example.com",
+         "examples" : [
+            "alice@example.com"
+         ],
          "format" : "xmpp-jid",
          "type" : "string",
          "xml" : {
@@ -662,14 +684,23 @@
                "properties" : {
                   "name" : {
                      "example" : "My Software",
+                     "examples" : [
+                        "My Software"
+                     ],
                      "type" : "string"
                   },
                   "os" : {
                      "example" : "Linux",
+                     "examples" : [
+                        "Linux"
+                     ],
                      "type" : "string"
                   },
                   "version" : {
                      "example" : "1.0.0",
+                     "examples" : [
+                        "1.0.0"
+                     ],
                      "type" : "string"
                   }
                },
@@ -730,6 +761,9 @@
             "body" : {
                "description" : "Human-readable chat message",
                "example" : "Hello, World!",
+               "examples" : [
+                  "Hello, World!"
+               ],
                "type" : "string"
             },
             "dataform" : {
@@ -864,6 +898,9 @@
                   "url" : {
                      "description" : "The URL of the attached media file",
                      "example" : "https://media.example.net/thisfile.jpg",
+                     "examples" : [
+                        "https://media.example.net/thisfile.jpg"
+                     ],
                      "format" : "uri",
                      "type" : "string"
                   }
@@ -1031,6 +1068,10 @@
             "subject" : {
                "description" : "Subject of message or group chat",
                "example" : "Talking about stuff",
+               "examples" : [
+                  "I implore you!",
+                  "Talking about stuff"
+               ],
                "type" : "string"
             },
             "thread" : {