Swagger response returns multiple instances

use swagger 2.0 to generate documents, and you now expect response to return multiple instances. However, the official examples are all for one schema instance, so ask for help on how to write the information that returns multiple instances.


create a new class, including those instances, and write the new class


in response.

official examples are directly returned to schema without a package key, ignoring that you can wrap it with object. The problem has been resolved, and the code is as follows

"get": {
  "tags": [
    "option_types"
    ],
  "responses": {
    "200": {
    "description": "optionType: {}; OptionValues: []",
    "schema": {
      "type": "object",
      "properties": {
        "option_type": {
          "$ref": "-sharp/definitions/OptionType"
          },
        "option_values": {
          "type": "array",
          "items": {
            "$ref": "-sharp/definitions/OptionValue"
            }
          }
        }
      }
    }
  }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31fcd-2bde2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31fcd-2bde2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?