From f0fd46305d81934f3fc6004ec8589ad47b652574 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ole=20Volds=C3=A6ter?= <ole.voldsater@uib.no>
Date: Tue, 15 Sep 2020 11:27:08 +0200
Subject: [PATCH] mer dokumentasjon

---
 api_static/api/swagger.json | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/api_static/api/swagger.json b/api_static/api/swagger.json
index 0c0c31f9..8ae9beed 100644
--- a/api_static/api/swagger.json
+++ b/api_static/api/swagger.json
@@ -1,8 +1,9 @@
 {
   "openapi": "3.0.1",
   "info": {
-    "title": "ordbok-cache",
-    "version": "2020-02-17T12:44:25Z"
+    "title": "Dictionary JSON API",
+    "description": "This API is developed by the University of Bergen. Its purpose is to serve the new national dictionary website wich is under development. API keys are available upon request. No warranty.",
+    "version": "beta"
   },
   "servers": [
     {
@@ -17,6 +18,7 @@
             "name": "dict_id",
             "in": "path",
             "required": true,
+            "description": "Dictionary code, 'bob' for bokmål, 'nob' for nynorsk",
             "schema": {
               "type": "string"
             }
@@ -26,7 +28,7 @@
             "in": "path",
             "required": true,
             "schema": {
-              "type": "string"
+              "type": "integer"
             }
           }
         ],
@@ -50,10 +52,13 @@
       }
     },
     "/article/{dict_id}/search": {
+      "summary": "Search for a word",
+      "description": "Search for words as an article lemmas, or words occurring in certain article elements. For instance, old norse _fljúga_ will match the article for modern Norwegian verb _fly_ (meaning to fly)",
       "get": {
         "parameters": [
           {
             "name": "dict_id",
+            "description": "Dictionary to search, 'bob' for bokmål, 'nob' for nynorsk, 'bob,bob' for both",
             "in": "path",
             "required": true,
             "schema": {
@@ -62,6 +67,7 @@
           },
           {
             "name": "q",
+            "description": "Query string",
             "in": "query",
             "required": true,
             "schema": {
@@ -90,9 +96,12 @@
     },
     "/article/{dict_id}/suggest": {
       "get": {
+        "summary": "Get autocomplete suggestions for a prefix",
+        "description": "Returns articles for words that begin with the prefix specified in query string 'q'",
         "parameters": [
           {
             "name": "dict_id",
+            "description": "Dictionary to search, 'bob' for bokmål, 'nob' for nynorsk, 'bob,bob' for both",
             "in": "path",
             "required": true,
             "schema": {
@@ -101,6 +110,7 @@
           },
           {
             "name": "q",
+            "description": "Query string: prefix for autocomplete",
             "in": "query",
             "required": true,
             "schema": {
-- 
GitLab