Skip to content
Snippets Groups Projects
swagger.json 3.93 KiB
Newer Older
{
  "openapi": "3.0.1",
  "info": {
Ole Voldsæter's avatar
Ole Voldsæter committed
    "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": [
    {
      "url": "/api"
    }
  ],
  "paths": {
    "/article/{dict_id}/{art_id}": {
      "get": {
        "summary": "Article lookup",
        "description": "Returns an article with a specific numerical ID",
        "parameters": [
          {
            "name": "dict_id",
            "in": "path",
            "required": true,
Ole Voldsæter's avatar
Ole Voldsæter committed
            "description": "Dictionary code, 'bob' for bokmål, 'nob' for nynorsk",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "art_id",
            "in": "path",
            "required": true,
            "description": "The numerical ID of an article",
Ole Voldsæter's avatar
Ole Voldsæter committed
              "type": "integer"
        ],
        "responses": {
          "200": {
            "description": "bla bla",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/article/{dict_id}/search": {
      "get": {
        "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)",
        "parameters": [
          {
            "name": "dict_id",
            "description": "Dictionary to search, 'bob' for bokmål, 'nob' for nynorsk, 'bob,nob' for both",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
Ole Voldsæter's avatar
Ole Voldsæter committed
            "description": "Query string",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "responses": {
          "200": {
            "description": "bla bla",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/article/{dict_id}/suggest": {
      "get": {
Ole Voldsæter's avatar
Ole Voldsæter committed
        "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",
Ole Voldsæter's avatar
Ole Voldsæter committed
            "description": "Dictionary to search, 'bob' for bokmål, 'nob' for nynorsk, 'bob,bob' for both",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
Ole Voldsæter's avatar
Ole Voldsæter committed
            "description": "Query string: prefix for autocomplete",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "responses": {
          "200": {
            "description": "bla bla",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      }
    }
  }
}