Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.37 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3.   description: "Description of Worldnet's API "
  4.   version: "1.0.0"
  5.   title: "Worldnet International"
  6.   termsOfService: "https://www.worldnet-intl.com/privacy-policy"
  7.   contact:
  8.     email: "dev@worldnet-intl.com"
  9.   license:
  10.     name: "TBD"
  11.     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  12. host: "apidev.lightening.co"
  13. #basePath: ""
  14. tags:
  15. - name: "login"
  16.   description: "Route for login"
  17. - name: "pet"
  18.   description: "Access to Petstore orders"
  19. - name: "user"
  20.   description: "Operations about user"
  21.   externalDocs:
  22.     description: "Find out more about our store"
  23.     url: "http://swagger.io"
  24. schemes:
  25. - "https"
  26. paths:
  27.   /login:
  28.     post:
  29.       tags:
  30.      - "login"
  31.       summary: "Login"
  32.       description: ""
  33.       operationId: "login"
  34.       consumes:
  35.      - "application/json"
  36.       produces:
  37.      - "application/json"
  38.       parameters:
  39.       - in: "body"
  40.         name: "body"
  41.         description: "Credentials for logging in"
  42.         required: true
  43.         schema:
  44.           $ref: "#/definitions/Login"
  45.       responses:
  46.         422:
  47.           description: "Invalid Authentication"
  48.         202:
  49.           description: "Authentication Success"
  50.   /pet/{petId}:
  51.     get:
  52.       tags:
  53.      - "pet"
  54.       summary: "Find pet by ID"
  55.       description: "Returns a single pet"
  56.       operationId: "getPetById"
  57.       produces:
  58.      - "application/xml"
  59.       - "application/json"
  60.       parameters:
  61.       - name: "petId"
  62.         in: "path"
  63.         description: "ID of pet to return"
  64.         required: true
  65.         type: "integer"
  66.         format: "int64"
  67.       responses:
  68.         200:
  69.           description: "successful operation"
  70.           schema:
  71.             $ref: "#/definitions/Pet"
  72.         400:
  73.           description: "Invalid ID supplied"
  74.         404:
  75.           description: "Pet not found"
  76.       security:
  77.       - api_key: []
  78.     post:
  79.       tags:
  80.      - "pet"
  81.       summary: "Updates a pet in the store with form data"
  82.       description: ""
  83.       operationId: "updatePetWithForm"
  84.       consumes:
  85.      - "application/x-www-form-urlencoded"
  86.       produces:
  87.      - "application/xml"
  88.       - "application/json"
  89.       parameters:
  90.       - name: "petId"
  91.         in: "path"
  92.         description: "ID of pet that needs to be updated"
  93.         required: true
  94.         type: "integer"
  95.         format: "int64"
  96.       - name: "name"
  97.         in: "formData"
  98.         description: "Updated name of the pet"
  99.         required: false
  100.         type: "string"
  101.       - name: "status"
  102.         in: "formData"
  103.         description: "Updated status of the pet"
  104.         required: false
  105.         type: "string"
  106.       responses:
  107.         405:
  108.           description: "Invalid input"
  109.       security:
  110.       - petstore_auth:
  111.        - "write:pets"
  112.         - "read:pets"
  113.     delete:
  114.       tags:
  115.      - "pet"
  116.       summary: "Deletes a pet"
  117.       description: ""
  118.       operationId: "deletePet"
  119.       produces:
  120.      - "application/xml"
  121.       - "application/json"
  122.       parameters:
  123.       - name: "api_key"
  124.         in: "header"
  125.         required: false
  126.         type: "string"
  127.       - name: "petId"
  128.         in: "path"
  129.         description: "Pet id to delete"
  130.         required: true
  131.         type: "integer"
  132.         format: "int64"
  133.       responses:
  134.         400:
  135.           description: "Invalid ID supplied"
  136.         404:
  137.           description: "Pet not found"
  138.       security:
  139.       - petstore_auth:
  140.        - "write:pets"
  141.         - "read:pets"
  142. securityDefinitions:
  143.   petstore_auth:
  144.     type: "oauth2"
  145.     authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  146.     flow: "implicit"
  147.     scopes:
  148.       write:pets: "modify pets in your account"
  149.       read:pets: "read your pets"
  150.   api_key:
  151.     type: "apiKey"
  152.     name: "api_key"
  153.     in: "header"
  154. definitions:
  155.   Order:
  156.     type: "object"
  157.     properties:
  158.       id:
  159.         type: "integer"
  160.         format: "int64"
  161.       petId:
  162.         type: "integer"
  163.         format: "int64"
  164.       quantity:
  165.         type: "integer"
  166.         format: "int32"
  167.       shipDate:
  168.         type: "string"
  169.         format: "date-time"
  170.       status:
  171.         type: "string"
  172.         description: "Order Status"
  173.         enum:
  174.        - "placed"
  175.         - "approved"
  176.         - "delivered"
  177.       complete:
  178.         type: "boolean"
  179.         default: false
  180.     xml:
  181.       name: "Order"
  182.   Category:
  183.     type: "object"
  184.     properties:
  185.       id:
  186.         type: "integer"
  187.         format: "int64"
  188.       name:
  189.         type: "string"
  190.     xml:
  191.       name: "Category"
  192.   User:
  193.     type: "object"
  194.     properties:
  195.       id:
  196.         type: "integer"
  197.         format: "int64"
  198.       username:
  199.         type: "string"
  200.       firstName:
  201.         type: "string"
  202.       lastName:
  203.         type: "string"
  204.       email:
  205.         type: "string"
  206.       password:
  207.         type: "string"
  208.       phone:
  209.         type: "string"
  210.       userStatus:
  211.         type: "integer"
  212.         format: "int32"
  213.         description: "User Status"
  214.     xml:
  215.       name: "User"
  216.   Tag:
  217.     type: "object"
  218.     properties:
  219.       id:
  220.         type: "integer"
  221.         format: "int64"
  222.       name:
  223.         type: "string"
  224.     xml:
  225.       name: "Tag"
  226.   Login:
  227.     type: "object"
  228.     required:
  229.    - "username"
  230.     - "password"
  231.     properties:
  232.       username:
  233.         type: "string"
  234.       password:
  235.         type: "string"
  236.   Pet:
  237.     type: "object"
  238.     required:
  239.    - "name"
  240.     - "photoUrls"
  241.     properties:
  242.       id:
  243.         type: "integer"
  244.         format: "int64"
  245.       category:
  246.         $ref: "#/definitions/Category"
  247.       name:
  248.         type: "string"
  249.         example: "doggie"
  250.       photoUrls:
  251.         type: "array"
  252.         xml:
  253.           name: "photoUrl"
  254.           wrapped: true
  255.         items:
  256.           type: "string"
  257.       tags:
  258.         type: "array"
  259.         xml:
  260.           name: "tag"
  261.           wrapped: true
  262.         items:
  263.           $ref: "#/definitions/Tag"
  264.       status:
  265.         type: "string"
  266.         description: "pet status in the store"
  267.         enum:
  268.        - "available"
  269.         - "pending"
  270.         - "sold"
  271.     xml:
  272.       name: "Pet"
  273.   ApiResponse:
  274.     type: "object"
  275.     properties:
  276.       code:
  277.         type: "integer"
  278.         format: "int32"
  279.       type:
  280.         type: "string"
  281.       message:
  282.         type: "string"
  283. externalDocs:
  284.   description: "Find out more about Swagger"
  285.   url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement