Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.05 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3.   description: |
  4.    This is where you can find all the User Stories we created
  5.     [Google Sheet](https://docs.google.com/spreadsheets/d/1qIuBUrLQgBTlntmr3HLEKPQhXrZkuE8ijw9zai3r7zg/edit?usp=sharing)
  6.   version: 1.0.0
  7.   title: Prisoners at School
  8.   termsOfService: https://www.unitn.it/en/ateneo/51110/legal-information
  9.   contact:
  10.     name: Issues page
  11.     url: https://github.com/MattiaCarolo/SE2_Project/issues
  12.     email: vittoria.chierzi@studenti.unitn.it
  13.   license:
  14.     name: Node JS
  15.     url: https://github.com/nodejs/node/blob/master/LICENSE
  16.  
  17.  
  18.  
  19. tags:
  20. - name: Teacher
  21.   description: Tools to manage courses
  22.  
  23.  
  24. consumes:
  25.  - application/json
  26. produces:
  27.  - application/json
  28.  
  29. paths:
  30.   /course/calendar:
  31.     post:
  32.       tags:
  33.      - Teacher
  34.       summary: Add all calendars to the course
  35.       operationId: createAllCalendar
  36.       consumes:
  37.      - application/json
  38.       produces:
  39.      - application/json
  40.       parameters:
  41.       - in: body
  42.         name: name
  43.         description: Calendar object that needs to be added
  44.         required: true
  45.         schema:
  46.             type:
  47.             properties:
  48.                name:
  49.                  type: string
  50.                lunedi:
  51.                  type: string
  52.                martedi:
  53.                  type: string
  54.                mercoledi:
  55.                  type: string
  56.                giovedi:
  57.                  type: string
  58.                venerdi:
  59.                  type: string
  60.       responses:
  61.         200:
  62.           description: successful operation
  63.           schema:
  64.               $ref: '#/definitions/Calendars'
  65.         405:
  66.           description: Invalid input
  67.  
  68.    
  69.   /course/calendar/{id}:
  70.     get:
  71.       tags:
  72.      - Teacher
  73.       summary: Return calendar based on course
  74.       operationId: getCalendarByCourse
  75.       produces:
  76.      - application/json
  77.       parameters:
  78.       - name: id
  79.         in: query
  80.         description: Course id that need to be retrived
  81.         required: true
  82.         type: string
  83.       responses:
  84.         200:
  85.           description: successful operation
  86.           schema:
  87.               $ref: '#/definitions/Calendars2'
  88.         400:
  89.           description: Invalid status value
  90.    
  91.     post:
  92.       tags:
  93.      - Teacher
  94.       summary: Add all calendars to the course
  95.       operationId: createAllCalendar
  96.       consumes:
  97.      - application/json
  98.       produces:
  99.      - application/json
  100.       parameters:
  101.       - in: body
  102.         name: body
  103.         description: Calendar object that needs to be added
  104.         required: true
  105.         schema:
  106.           $ref: '#/definitions/Calendars2'
  107.  
  108.       responses:
  109.         200:
  110.           description: successful operation
  111.           schema:
  112.               $ref: '#/definitions/Calendars'
  113.         405:
  114.           description: Invalid input
  115.           schema:
  116.               $ref: '#/definitions/Calendars'
  117.        
  118.      
  119.   /course/calendar/{id}/{name}:
  120.     put:
  121.       tags:
  122.      - Teacher
  123.       summary: Update an existing calendar
  124.       operationId: modifyCalendarByName
  125.       consumes:
  126.      - application/json
  127.       produces:
  128.      - application/json
  129.       parameters:
  130.       - name: id
  131.         in: body
  132.         description: id of the course
  133.         required: true
  134.         schema:
  135.           type: object
  136.           properties:
  137.            name:
  138.              type: string
  139.            lunedi:
  140.              type: string
  141.            martedi:
  142.              type: string
  143.            mercoledi:
  144.              type: string
  145.            giovedi:
  146.              type: string
  147.            venerdi:
  148.              type: string
  149.       - name: name
  150.         in: body
  151.         description: name of the course
  152.         required: true
  153.         schema:
  154.           type: object
  155.           properties:
  156.            name:
  157.              type: string
  158.            lunedi:
  159.              type: string
  160.            martedi:
  161.              type: string
  162.            mercoledi:
  163.              type: string
  164.            giovedi:
  165.              type: string
  166.            venerdi:
  167.              type: string
  168.       responses:
  169.         200:
  170.           description: successful operation
  171.           schema:
  172.             $ref: '#/definitions/Calendars2'
  173.         400:
  174.           description: Invalid ID supplied
  175.         404:
  176.           description: calendar not found
  177.         405:
  178.           description: Validation exception
  179.          
  180.     delete:
  181.       tags:
  182.      - Teacher
  183.       summary: Deletes a single calendar
  184.       operationId: deleteCalendarByName
  185.       produces:
  186.      - application/json
  187.       parameters:
  188.       - in: body
  189.         name: id
  190.         description: id of the course
  191.         required: true
  192.         schema:
  193.               $ref: '#/definitions/Calendars2'
  194.       - in: body
  195.         name: name
  196.         description: id of the course
  197.         required: true
  198.         schema:
  199.             $ref: '#/definitions/Calendars2'      
  200.       responses:
  201.         200:
  202.           description: successful operation
  203.           schema:
  204.             $ref: '#/definitions/Calendars2'
  205.         400:
  206.           description: Invalid ID supplied
  207.         404:
  208.           description: calendar not found
  209.      
  210.  
  211. definitions:
  212.   Calendars:
  213.    allOf:
  214.     - $ref: '#/definitions/Calendars2'
  215.     - required:
  216.      - idcourse
  217.       - Calendars2
  218.      
  219.       properties:
  220.        idcourse:
  221.          type: integer
  222.        Calendars2:
  223.          type: object
  224.        
  225.   Calendars2:
  226.     allOf:
  227.       - required:
  228.        - name
  229.         - lunedi
  230.         - martedi
  231.         - mercoledi
  232.         - giovedi
  233.         - venerdi
  234.        
  235.         properties:
  236.          name:
  237.            type: string
  238.          lunedi:
  239.            type: string
  240.          martedi:
  241.            type: string
  242.          mercoledi:
  243.            type: string
  244.          giovedi:
  245.            type: string
  246.          venerdi:
  247.            type: string
  248.        
  249.  
  250. externalDocs:
  251.   description: Find out more about Swagger
  252.   url: http://swagger.io
  253. # Added by API Auto Mocking Plugin
  254. host: virtserver.swaggerhub.com
  255. basePath: /VittoriaChierzi/try/1.0.0
  256. schemes:
  257. - https
  258.  - http
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement