Advertisement
Guest User

Swagga

a guest
Jun 2nd, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.06 KB | None | 0 0
  1. {
  2.     "swagger":     "2.0",
  3.     "info":        {
  4.         "title":   "API",
  5.         "version": "0.2"
  6.     },
  7.     "host":        "xxx.yy.z",
  8.     "basePath":    "/api",
  9.     "schemes":     [
  10.         "https"
  11.     ],
  12.     "tags":        [
  13.         {
  14.             "name":        "users",
  15.             "description": "Actions involving users"
  16.         }
  17.     ],
  18.     "parameters":  {
  19.         "userIdParam": {
  20.             "name":        "id",
  21.             "in":          "path",
  22.             "description": "User id",
  23.             "required":    "true",
  24.             "type":        "integer",
  25.             "format":      "int64"
  26.         }
  27.     },
  28.     "definitions": {
  29.         "user": {
  30.             "type":       "object",
  31.             "properties": {
  32.                 "user_id":         {
  33.                     "type":        "integer",
  34.                     "description": "User ID.",
  35.                     "example":     55
  36.                 },
  37.                 "user_name_first": {
  38.                     "type":        "string",
  39.                     "description": "User's first name",
  40.                     "example":     "Jan "
  41.                 },
  42.                 "user_name_last":  {
  43.                     "type":        "string",
  44.                     "description": "User's last name",
  45.                     "example":     "Nowak"
  46.                 }
  47.             }
  48.         }
  49.     },
  50.     "paths":       {
  51.         "/users/{id}": {
  52.             "get": {
  53.                 "tags":       [
  54.                     "users"
  55.                 ],
  56.                 "summary":    "Returns user data specified by user ID",
  57.                 "parameters": [
  58.                     {
  59.                         "$ref": "#/parameters/userIdParam"
  60.                     }
  61.                 ],
  62.                 "responses":  {
  63.                     "200": {
  64.                         "description": "Single user details",
  65.                         "schema":      {
  66.                             "type":       "object",
  67.                             "properties": {
  68.                                 "data":    {
  69.                                     "$ref": "#/definitions/user"
  70.                                 },
  71.                                 "code":    {
  72.                                     "type":        "string",
  73.                                     "description": "Response code",
  74.                                     "example":     "200"
  75.                                 },
  76.                                 "success": {
  77.                                     "type":        "boolean",
  78.                                     "description": "Operation status",
  79.                                     "example":     true
  80.                                 },
  81.                                 "type":    {
  82.                                     "type":        "string",
  83.                                     "description": "Action type",
  84.                                     "example":     "Users"
  85.                                 }
  86.                             }
  87.                         }
  88.                     }
  89.                 }
  90.             }
  91.         }
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement