Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 8.05 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3.   description: "This is a sample server Petstore server.  You can find out more about     Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).      For this sample, you can use the api key `special-key` to test the authorization     filters."
  4.   version: "1.0.0"
  5.   title: "Swagger Petstore"
  6.   termsOfService: "http://swagger.io/terms/"
  7.   contact:
  8.     email: "apiteam@swagger.io"
  9.   license:
  10.     name: "Apache 2.0"
  11.     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  12. host: "petstore.swagger.io"
  13. basePath: "/v2"
  14. tags:
  15. - name: "transactions"
  16. - name: "transactionId"
  17. - name: "user"
  18. - name: "statistics"
  19. - name: "enter"
  20. - name: "groups"
  21. - name: "groupId"
  22. schemes:
  23. - "http"
  24. paths:
  25.   /transactions:
  26.     post:
  27.       tags:
  28.      - "transactions"
  29.       summary: "Add a new transaction"
  30.       description: ""
  31.       consumes:
  32.      - "application/json"
  33.       produces:
  34.      - "application/json"
  35.       parameters:
  36.       - in: "body"
  37.         name: "body"
  38.         description: "Transaction-input object"
  39.         required: true
  40.         schema:
  41.           $ref: "#/definitions/Pet"
  42.       responses:
  43.         400:
  44.           description: "Invalid input"
  45.       security:
  46.       - petstore_auth:
  47.        - "write:pets"
  48.         - "read:pets"
  49.     get:
  50.       tags:
  51.      - "transactions"
  52.       summary: "Get all transactions"
  53.       description: ""
  54.       operationId: "updatePet"
  55.       produces:
  56.      - "application/json"
  57.       responses:
  58.         404:
  59.           description: "Transactions not found"
  60.       security:
  61.       - petstore_auth:
  62.        - "write:pets"
  63.         - "read:pets"
  64.   /groups:
  65.     post:
  66.       tags:
  67.      - "groups"
  68.       summary: "Create group"
  69.       description: ""
  70.       consumes:
  71.      - "application/json"
  72.       produces:
  73.      - "application/json"
  74.       parameters:
  75.       - in: "body"
  76.         name: "body"
  77.         description: "Pet object that needs to be added to the store"
  78.         required: true
  79.         schema:
  80.           $ref: "#/definitions/Tag"
  81.       responses:
  82.         400:
  83.           description: "Invalid input"
  84.       security:
  85.       - petstore_auth:
  86.        - "write:pets"
  87.         - "read:pets"
  88.     get:
  89.       tags:
  90.      - "groups"
  91.       summary: "Get all groups where you are member"
  92.       description: ""
  93.       consumes:
  94.      - "application/json"
  95.       produces:
  96.      - "application/json"
  97.       responses:
  98.         404:
  99.           description: "Pet not found"
  100.       security:
  101.       - petstore_auth:
  102.        - "write:pets"
  103.         - "read:pets"
  104.   /transactionId:
  105.     get:
  106.       tags:
  107.      - "transactionId"
  108.       summary: "Get all about transaction"
  109.       produces:
  110.      - "application/json"
  111.       parameters:
  112.       - name: "id"
  113.         in: "query"
  114.         description: "Status values that need to be considered for filter"
  115.         required: true
  116.         type: "integer"
  117.       responses:
  118.         200:
  119.           description: "successful operation"
  120.           schema:
  121.             $ref: "#/definitions/Pet"
  122.         404:
  123.           description: "Not found"
  124.     delete:
  125.       tags:
  126.      - "transactionId"
  127.       summary: "Delete transaction"
  128.       parameters:
  129.       - name: "id"
  130.         in: "query"
  131.         description: "Status values that need to be considered for filter"
  132.         required: true
  133.         type: "integer"
  134.       responses:
  135.         200:
  136.           description: "successful operation"
  137.         404:
  138.           description: "Not found"
  139.   /groupId:
  140.     get:
  141.       tags:
  142.      - "groupId"
  143.       summary: "Get group"
  144.       description: "Multiple status values can be provided with comma separated strings"
  145.       produces:
  146.      - "application/json"
  147.       parameters:
  148.       - name: "id"
  149.         in: "query"
  150.         description: "Status values that need to be considered for filter"
  151.         required: true
  152.         type: "integer"
  153.       responses:
  154.         200:
  155.           description: "successful operation"
  156.           schema:
  157.             $ref: "#/definitions/Tag"
  158.         400:
  159.           description: "Invalid id"
  160.     delete:
  161.       tags:
  162.      - "groupId"
  163.       summary: "Delete group"
  164.       parameters:
  165.       - name: "id"
  166.         in: "query"
  167.         description: "Status values that need to be considered for filter"
  168.         required: true
  169.         type: "integer"
  170.       responses:
  171.         200:
  172.           description: "successful operation"
  173.         404:
  174.           description: "Not found"
  175.   /user:
  176.     get:
  177.       tags:
  178.      - "user"
  179.       summary: "Get user info"
  180.       description: "This can only be done by the logged in user."
  181.       produces:
  182.      - "application/json"
  183.       parameters:
  184.       - in: "body"
  185.         name: "id"
  186.         description: "Return user object"
  187.         required: true
  188.       responses:
  189.         200:
  190.           description: "successful operation"
  191.           schema:
  192.           $ref: "#/definitions/User"
  193.   /enter:
  194.     post:
  195.       tags:
  196.      - "enter"
  197.       summary: "Post google token to auth"
  198.       description: "This can only be done by the logged in user."
  199.       produces:
  200.      - "application/xml"
  201.       - "application/json"
  202.       parameters:
  203.       - in: "body"
  204.         name: "body"
  205.         description: "Created user object"
  206.         required: true
  207.         schema:
  208.           $ref: "#/definitions/User"
  209.       responses:
  210.         default:
  211.           description: "successful operation"
  212.   /statistics:
  213.     get:
  214.       tags:
  215.      - "statistics"
  216.       summary: "Get statistics"
  217.       description: "This can only be done by the logged in user."
  218.       produces:
  219.      - "application/xml"
  220.       - "application/json"
  221.       parameters:
  222.       - in: "body"
  223.         name: "body"
  224.         description: "Created user object"
  225.         required: true
  226.         schema:
  227.           $ref: "#/definitions/User"
  228.       responses:
  229.         default:
  230.           description: "successful operation"
  231. securityDefinitions:
  232.   petstore_auth:
  233.     type: "oauth2"
  234.     authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  235.     flow: "implicit"
  236.     scopes:
  237.       write:pets: "modify pets in your account"
  238.       read:pets: "read your pets"
  239.   api_key:
  240.     type: "apiKey"
  241.     name: "api_key"
  242.     in: "header"
  243. definitions:
  244.   Order:
  245.     type: "object"
  246.     properties:
  247.       id:
  248.         type: "integer"
  249.         format: "int64"
  250.       petId:
  251.         type: "integer"
  252.         format: "int64"
  253.       quantity:
  254.         type: "integer"
  255.         format: "int32"
  256.       shipDate:
  257.         type: "string"
  258.         format: "date-time"
  259.       status:
  260.         type: "string"
  261.         description: "Order Status"
  262.         enum:
  263.        - "placed"
  264.         - "approved"
  265.         - "delivered"
  266.       complete:
  267.         type: "boolean"
  268.         default: false
  269.     xml:
  270.       name: "Order"
  271.   Category:
  272.     type: "object"
  273.     properties:
  274.       id:
  275.         type: "integer"
  276.         format: "int64"
  277.       name:
  278.         type: "string"
  279.     xml:
  280.       name: "Category"
  281.   User:
  282.     type: "object"
  283.     properties:
  284.       id:
  285.         type: "integer"
  286.         format: "int64"
  287.       nick:
  288.         type: "string"
  289.     xml:
  290.       name: "User"
  291.   Tag:
  292.     type: "object"
  293.     properties:
  294.       id:
  295.         type: "integer"
  296.         format: "int64"
  297.       name:
  298.         type: "string"
  299.       creatorId:
  300.         type: "integer"
  301.         format: "int64"
  302.     xml:
  303.       name: "Tag"
  304.   Pet:
  305.     type: "object"
  306.     properties:
  307.       group:
  308.         type: "integer"
  309.         format: "int64"
  310.       source:
  311.         type: "integer"
  312.         format: "int64"
  313.       sum:
  314.         type: "integer"
  315.         format: "int64"
  316.       matter:
  317.         type: "string"
  318.         example: "doggie"
  319.       targets:
  320.         type: "string"
  321.         example: "1 2 3 4"
  322.       comment:
  323.         type: "string"
  324.         example: "doggie"
  325.     xml:
  326.       name: "Pet"
  327.   ApiResponse:
  328.     type: "object"
  329.     properties:
  330.       code:
  331.         type: "integer"
  332.         format: "int32"
  333.       type:
  334.         type: "string"
  335.       message:
  336.         type: "string"
  337. externalDocs:
  338.   description: "Find out more about Swagger"
  339.   url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement