Advertisement
sentinelwex

epiherd-api-swagger

Feb 9th, 2023 (edited)
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 20.21 KB | None | 0 0
  1. openapi: 3.0.1
  2. info:
  3.   title: OpenAPI definition
  4.   version: v0
  5. servers:
  6.   - url: http://localhost:8080
  7.     description: Generated server url
  8. paths:
  9.   /api/order/{id}:
  10.     get:
  11.       tags:
  12.        - product-order-controller
  13.       operationId: getTestOrderById
  14.       parameters:
  15.         - name: id
  16.           in: path
  17.           required: true
  18.           schema:
  19.             type: integer
  20.             format: int64
  21.       responses:
  22.         '200':
  23.           description: OK
  24.           content:
  25.             '*/*':
  26.               schema:
  27.                 $ref: '#/components/schemas/ProductOrderDTO'
  28.     put:
  29.       tags:
  30.        - product-order-controller
  31.       operationId: updateOrder
  32.       parameters:
  33.         - name: id
  34.           in: path
  35.           required: true
  36.           schema:
  37.             type: integer
  38.             format: int64
  39.       requestBody:
  40.         content:
  41.           application/json:
  42.             schema:
  43.               $ref: '#/components/schemas/ProductOrderDTO'
  44.         required: true
  45.       responses:
  46.         '200':
  47.           description: OK
  48.           content:
  49.             '*/*':
  50.               schema:
  51.                 $ref: '#/components/schemas/ProductOrderDTO'
  52.   /api/user:
  53.     get:
  54.       tags:
  55.        - user-controller
  56.       operationId: getUser
  57.       parameters:
  58.         - name: userName
  59.           in: query
  60.           required: false
  61.           schema:
  62.             type: string
  63.         - name: page
  64.           in: query
  65.           required: false
  66.           schema:
  67.             type: integer
  68.             format: int32
  69.             default: 0
  70.         - name: size
  71.           in: query
  72.           required: false
  73.           schema:
  74.             type: integer
  75.             format: int32
  76.             default: 10
  77.       responses:
  78.         '200':
  79.           description: OK
  80.           content:
  81.             '*/*':
  82.               schema:
  83.                 type: object
  84.                 additionalProperties:
  85.                   type: object
  86.     post:
  87.       tags:
  88.        - user-controller
  89.       operationId: createNewUser
  90.       requestBody:
  91.         content:
  92.           application/json:
  93.             schema:
  94.               $ref: '#/components/schemas/NewUserAccountDTO'
  95.         required: true
  96.       responses:
  97.         '200':
  98.           description: OK
  99.           content:
  100.             '*/*':
  101.               schema:
  102.                 $ref: '#/components/schemas/UserAccountDTO'
  103.   /api/order:
  104.     get:
  105.       tags:
  106.        - product-order-controller
  107.       operationId: getOrders
  108.       parameters:
  109.         - name: status
  110.           in: query
  111.           required: false
  112.           schema:
  113.             type: string
  114.         - name: page
  115.           in: query
  116.           required: false
  117.           schema:
  118.             type: integer
  119.             format: int32
  120.             default: 0
  121.         - name: size
  122.           in: query
  123.           required: false
  124.           schema:
  125.             type: integer
  126.             format: int32
  127.             default: 10
  128.       responses:
  129.         '200':
  130.           description: OK
  131.           content:
  132.             '*/*':
  133.               schema:
  134.                 type: object
  135.                 additionalProperties:
  136.                   type: object
  137.     post:
  138.       tags:
  139.        - product-order-controller
  140.       operationId: createOrder
  141.       requestBody:
  142.         content:
  143.           application/json:
  144.             schema:
  145.               $ref: '#/components/schemas/NewProductOrderDTO'
  146.         required: true
  147.       responses:
  148.         '200':
  149.           description: OK
  150.           content:
  151.             '*/*':
  152.               schema:
  153.                 $ref: '#/components/schemas/ProductOrderDTO'
  154.   /api/notification:
  155.     post:
  156.       tags:
  157.        - notification-controller
  158.       operationId: createNotification
  159.       requestBody:
  160.         content:
  161.           application/json:
  162.             schema:
  163.               $ref: '#/components/schemas/NewNotificationDTO'
  164.         required: true
  165.       responses:
  166.         '200':
  167.           description: OK
  168.           content:
  169.             '*/*':
  170.               schema:
  171.                 $ref: '#/components/schemas/NotificationDTO'
  172.   /api/herd/{id}/animal:
  173.     get:
  174.       tags:
  175.        - herd-controller
  176.       operationId: getAnimalsByHerd
  177.       parameters:
  178.         - name: id
  179.           in: path
  180.           required: true
  181.           schema:
  182.             type: integer
  183.             format: int64
  184.       responses:
  185.         '200':
  186.           description: OK
  187.           content:
  188.             '*/*':
  189.               schema:
  190.                 type: array
  191.                 items:
  192.                   $ref: '#/components/schemas/AnimalDTO'
  193.     post:
  194.       tags:
  195.        - herd-controller
  196.       operationId: createNewAnimalInHerd
  197.       parameters:
  198.         - name: id
  199.           in: path
  200.           required: true
  201.           schema:
  202.             type: integer
  203.             format: int64
  204.       requestBody:
  205.         content:
  206.           application/json:
  207.             schema:
  208.               $ref: '#/components/schemas/NewAnimalDTO'
  209.         required: true
  210.       responses:
  211.         '200':
  212.           description: OK
  213.           content:
  214.             '*/*':
  215.               schema:
  216.                 $ref: '#/components/schemas/AnimalDTO'
  217.   /api/file/upload:
  218.     post:
  219.       tags:
  220.        - file-upload-controller
  221.       operationId: upload
  222.       parameters:
  223.         - name: farmId
  224.           in: query
  225.           required: true
  226.           schema:
  227.             type: integer
  228.             format: int64
  229.       requestBody:
  230.         content:
  231.           application/json:
  232.             schema:
  233.               required:
  234.                - file
  235.               type: object
  236.               properties:
  237.                 file:
  238.                   type: string
  239.                   format: binary
  240.       responses:
  241.         '200':
  242.           description: OK
  243.           content:
  244.             '*/*':
  245.               schema:
  246.                 type: string
  247.   /api/farm:
  248.     get:
  249.       tags:
  250.        - farm-controller
  251.       operationId: getFarm
  252.       parameters:
  253.         - name: name
  254.           in: query
  255.           required: false
  256.           schema:
  257.             type: string
  258.         - name: page
  259.           in: query
  260.           required: false
  261.           schema:
  262.             type: integer
  263.             format: int32
  264.             default: 0
  265.         - name: size
  266.           in: query
  267.           required: false
  268.           schema:
  269.             type: integer
  270.             format: int32
  271.             default: 10
  272.       responses:
  273.         '200':
  274.           description: OK
  275.           content:
  276.             '*/*':
  277.               schema:
  278.                 type: object
  279.                 additionalProperties:
  280.                   type: object
  281.     post:
  282.       tags:
  283.        - farm-controller
  284.       operationId: createNewFarm
  285.       requestBody:
  286.         content:
  287.           application/json:
  288.             schema:
  289.               $ref: '#/components/schemas/NewFarmDTO'
  290.         required: true
  291.       responses:
  292.         '200':
  293.           description: OK
  294.           content:
  295.             '*/*':
  296.               schema:
  297.                 $ref: '#/components/schemas/FarmDTO'
  298.   /api/farm/{id}/owner:
  299.     post:
  300.       tags:
  301.        - farm-controller
  302.       operationId: addOwnerToFarm
  303.       parameters:
  304.         - name: id
  305.           in: path
  306.           required: true
  307.           schema:
  308.             type: integer
  309.             format: int64
  310.       requestBody:
  311.         content:
  312.           application/json:
  313.             schema:
  314.               $ref: '#/components/schemas/UserToFarmForm'
  315.         required: true
  316.       responses:
  317.         '200':
  318.           description: OK
  319.           content:
  320.             '*/*':
  321.               schema:
  322.                 type: string
  323.   /api/farm/{id}/herd:
  324.     get:
  325.       tags:
  326.        - farm-controller
  327.       operationId: getFarmHerdsById
  328.       parameters:
  329.         - name: id
  330.           in: path
  331.           required: true
  332.           schema:
  333.             type: integer
  334.             format: int64
  335.       responses:
  336.         '200':
  337.           description: OK
  338.           content:
  339.             '*/*':
  340.               schema:
  341.                 type: array
  342.                 items:
  343.                   $ref: '#/components/schemas/HerdDTO'
  344.     post:
  345.       tags:
  346.        - farm-controller
  347.       operationId: addNewHerdToFarm
  348.       parameters:
  349.         - name: id
  350.           in: path
  351.           required: true
  352.           schema:
  353.             type: integer
  354.             format: int64
  355.       requestBody:
  356.         content:
  357.           application/json:
  358.             schema:
  359.               $ref: '#/components/schemas/HerdToFarmForm'
  360.         required: true
  361.       responses:
  362.         '200':
  363.           description: OK
  364.           content:
  365.             '*/*':
  366.               schema:
  367.                 $ref: '#/components/schemas/HerdDTO'
  368.   /api/farm/{id}/award:
  369.     get:
  370.       tags:
  371.        - farm-controller
  372.       operationId: getFarmAwardsByFarmId
  373.       parameters:
  374.         - name: id
  375.           in: path
  376.           required: true
  377.           schema:
  378.             type: integer
  379.             format: int64
  380.         - name: page
  381.           in: query
  382.           required: false
  383.           schema:
  384.             type: integer
  385.             format: int32
  386.             default: 0
  387.         - name: size
  388.           in: query
  389.           required: false
  390.           schema:
  391.             type: integer
  392.             format: int32
  393.             default: 10
  394.       responses:
  395.         '200':
  396.           description: OK
  397.           content:
  398.             '*/*':
  399.               schema:
  400.                 type: object
  401.                 additionalProperties:
  402.                   type: object
  403.     post:
  404.       tags:
  405.        - farm-controller
  406.       operationId: addNewAwardToFarm
  407.       parameters:
  408.         - name: id
  409.           in: path
  410.           required: true
  411.           schema:
  412.             type: integer
  413.             format: int64
  414.       requestBody:
  415.         content:
  416.           application/json:
  417.             schema:
  418.               $ref: '#/components/schemas/AwardToFarmForm'
  419.         required: true
  420.       responses:
  421.         '200':
  422.           description: OK
  423.           content:
  424.             '*/*':
  425.               schema:
  426.                 type: string
  427.   /api/admin/user/{id}/role:
  428.     post:
  429.       tags:
  430.        - admin-controller
  431.       operationId: assignRoleToUser
  432.       parameters:
  433.         - name: id
  434.           in: path
  435.           required: true
  436.           schema:
  437.             type: integer
  438.             format: int64
  439.       requestBody:
  440.         content:
  441.           application/json:
  442.             schema:
  443.               $ref: '#/components/schemas/RoleToUserForm'
  444.         required: true
  445.       responses:
  446.         '200':
  447.           description: OK
  448.           content:
  449.             '*/*':
  450.               schema:
  451.                 type: string
  452.   /api/admin/role:
  453.     post:
  454.       tags:
  455.        - admin-controller
  456.       operationId: createNewRole
  457.       requestBody:
  458.         content:
  459.           application/json:
  460.             schema:
  461.               $ref: '#/components/schemas/NewRoleForm'
  462.         required: true
  463.       responses:
  464.         '200':
  465.           description: OK
  466.           content:
  467.             '*/*':
  468.               schema:
  469.                 $ref: '#/components/schemas/RoleDTO'
  470.   /info:
  471.     get:
  472.       tags:
  473.        - info-controller
  474.       operationId: getInfo
  475.       responses:
  476.         '200':
  477.           description: OK
  478.           content:
  479.             '*/*':
  480.               schema:
  481.                 type: string
  482.   /api/user/{id}:
  483.     get:
  484.       tags:
  485.        - user-controller
  486.       operationId: getUserById
  487.       parameters:
  488.         - name: id
  489.           in: path
  490.           required: true
  491.           schema:
  492.             type: integer
  493.             format: int64
  494.       responses:
  495.         '200':
  496.           description: OK
  497.           content:
  498.             '*/*':
  499.               schema:
  500.                 $ref: '#/components/schemas/UserAccountDTO'
  501.   /api/user/{id}/farm:
  502.     get:
  503.       tags:
  504.        - user-controller
  505.       operationId: getOwnedFarmsByUser
  506.       parameters:
  507.         - name: id
  508.           in: path
  509.           required: true
  510.           schema:
  511.             type: integer
  512.             format: int64
  513.       responses:
  514.         '200':
  515.           description: OK
  516.           content:
  517.             '*/*':
  518.               schema:
  519.                 type: array
  520.                 items:
  521.                   $ref: '#/components/schemas/FarmDTO'
  522.   /api/product:
  523.     get:
  524.       tags:
  525.        - product-order-controller
  526.       operationId: getProducts
  527.       parameters:
  528.         - name: page
  529.           in: query
  530.           required: false
  531.           schema:
  532.             type: integer
  533.             format: int32
  534.             default: 0
  535.         - name: size
  536.           in: query
  537.           required: false
  538.           schema:
  539.             type: integer
  540.             format: int32
  541.             default: 10
  542.       responses:
  543.         '200':
  544.           description: OK
  545.           content:
  546.             '*/*':
  547.               schema:
  548.                 type: object
  549.                 additionalProperties:
  550.                   type: object
  551.   /api/farm/{id}:
  552.     get:
  553.       tags:
  554.        - farm-controller
  555.       operationId: getFarmById
  556.       parameters:
  557.         - name: id
  558.           in: path
  559.           required: true
  560.           schema:
  561.             type: integer
  562.             format: int64
  563.       responses:
  564.         '200':
  565.           description: OK
  566.           content:
  567.             '*/*':
  568.               schema:
  569.                 $ref: '#/components/schemas/FarmDTO'
  570.   /api/farm/{id}/notification:
  571.     get:
  572.       tags:
  573.        - farm-controller
  574.       operationId: getNotificationsByFarm
  575.       parameters:
  576.         - name: id
  577.           in: path
  578.           required: true
  579.           schema:
  580.             type: integer
  581.             format: int64
  582.       responses:
  583.         '200':
  584.           description: OK
  585.           content:
  586.             '*/*':
  587.               schema:
  588.                 type: array
  589.                 items:
  590.                   $ref: '#/components/schemas/NotificationDTO'
  591.   /api/award/farm:
  592.     get:
  593.       tags:
  594.        - award-controller
  595.       operationId: getFarmAwards
  596.       parameters:
  597.         - name: name
  598.           in: query
  599.           required: false
  600.           schema:
  601.             type: string
  602.         - name: page
  603.           in: query
  604.           required: false
  605.           schema:
  606.             type: integer
  607.             format: int32
  608.             default: 0
  609.         - name: size
  610.           in: query
  611.           required: false
  612.           schema:
  613.             type: integer
  614.             format: int32
  615.             default: 10
  616.       responses:
  617.         '200':
  618.           description: OK
  619.           content:
  620.             '*/*':
  621.               schema:
  622.                 type: object
  623.                 additionalProperties:
  624.                   type: object
  625.   /api/animal/{id}:
  626.     get:
  627.       tags:
  628.        - animal-controller
  629.       operationId: getAnimalById
  630.       parameters:
  631.         - name: id
  632.           in: path
  633.           required: true
  634.           schema:
  635.             type: integer
  636.             format: int64
  637.       responses:
  638.         '200':
  639.           description: OK
  640.           content:
  641.             '*/*':
  642.               schema:
  643.                 $ref: '#/components/schemas/AnimalDTO'
  644. components:
  645.   schemas:
  646.     AnimalDTO:
  647.       type: object
  648.       properties:
  649.         animalId:
  650.           type: integer
  651.           format: int64
  652.         animalName:
  653.           type: string
  654.         uniqueIdentifier:
  655.           type: string
  656.         uniqueIdentifierIssuer:
  657.           type: string
  658.         sex:
  659.           type: string
  660.         breed:
  661.           type: string
  662.         species:
  663.           type: string
  664.         dateCreated:
  665.           type: string
  666.         dateLastUpdated:
  667.           type: string
  668.         activeTestOrders:
  669.           type: array
  670.           items:
  671.             $ref: '#/components/schemas/ProductOrderDTO'
  672.     ProductOrderDTO:
  673.       type: object
  674.       properties:
  675.         orderId:
  676.           type: integer
  677.           format: int64
  678.         productId:
  679.           type: integer
  680.           format: int64
  681.         productName:
  682.           type: string
  683.         customerId:
  684.           type: integer
  685.           format: int64
  686.         customerUserName:
  687.           type: string
  688.         farmId:
  689.           type: integer
  690.           format: int64
  691.         farmName:
  692.           type: string
  693.         status:
  694.           type: string
  695.         dateCreated:
  696.           type: string
  697.         animals:
  698.           type: array
  699.           items:
  700.             $ref: '#/components/schemas/AnimalDTO'
  701.     NewUserAccountDTO:
  702.       type: object
  703.       properties:
  704.         username:
  705.           type: string
  706.         password:
  707.           type: string
  708.         streetLine1:
  709.           type: string
  710.         streetLine2:
  711.           type: string
  712.         city:
  713.           type: string
  714.         postCode:
  715.           type: string
  716.         country:
  717.           type: string
  718.         gender:
  719.           type: string
  720.         phoneNumber:
  721.           type: string
  722.     UserAccountDTO:
  723.       type: object
  724.       properties:
  725.         id:
  726.           type: integer
  727.           format: int64
  728.         userName:
  729.           type: string
  730.         userStatus:
  731.           type: string
  732.         dateCreated:
  733.           type: string
  734.         dateLastLogin:
  735.           type: string
  736.         gender:
  737.           type: string
  738.         phoneNumber:
  739.           type: string
  740.         role:
  741.           type: string
  742.     NewProductOrderDTO:
  743.       type: object
  744.       properties:
  745.         animalIds:
  746.           uniqueItems: true
  747.           type: array
  748.           items:
  749.             type: integer
  750.             format: int64
  751.         productId:
  752.           type: integer
  753.           format: int64
  754.         farmId:
  755.           type: integer
  756.           format: int64
  757.     NewNotificationDTO:
  758.       type: object
  759.       properties:
  760.         farmId:
  761.           type: integer
  762.           format: int64
  763.         animalId:
  764.           type: integer
  765.           format: int64
  766.         category:
  767.           type: string
  768.         message:
  769.           type: string
  770.     NotificationDTO:
  771.       type: object
  772.       properties:
  773.         notificationId:
  774.           type: integer
  775.           format: int64
  776.         category:
  777.           type: string
  778.         message:
  779.           type: string
  780.     NewAnimalDTO:
  781.       type: object
  782.       properties:
  783.         animalName:
  784.           type: string
  785.         uniqueIdentifier:
  786.           type: string
  787.         uniqueIdentifierIssuer:
  788.           type: string
  789.         sex:
  790.           type: string
  791.         breed:
  792.           type: string
  793.         species:
  794.           type: string
  795.     NewFarmDTO:
  796.       type: object
  797.       properties:
  798.         name:
  799.           type: string
  800.         streetLine1:
  801.           type: string
  802.         streetLine2:
  803.           type: string
  804.         city:
  805.           type: string
  806.         postCode:
  807.           type: string
  808.         country:
  809.           type: string
  810.     FarmDTO:
  811.       type: object
  812.       properties:
  813.         farmId:
  814.           type: integer
  815.           format: int64
  816.         farmName:
  817.           type: string
  818.         streetLine1:
  819.           type: string
  820.         streetLine2:
  821.           type: string
  822.         city:
  823.           type: string
  824.         postCode:
  825.           type: string
  826.         country:
  827.           type: string
  828.         numberOfAnimals:
  829.           type: integer
  830.           format: int32
  831.         herds:
  832.           type: array
  833.           items:
  834.             $ref: '#/components/schemas/HerdDTO'
  835.     HerdDTO:
  836.       type: object
  837.       properties:
  838.         herdId:
  839.           type: integer
  840.           format: int64
  841.         herdName:
  842.           type: string
  843.         numOfAnimals:
  844.           type: integer
  845.           format: int32
  846.     UserToFarmForm:
  847.       type: object
  848.       properties:
  849.         userId:
  850.           type: integer
  851.           format: int64
  852.     HerdToFarmForm:
  853.       type: object
  854.       properties:
  855.         herdName:
  856.           type: string
  857.     AwardToFarmForm:
  858.       type: object
  859.       properties:
  860.         farmAwardId:
  861.           type: integer
  862.           format: int64
  863.     RoleToUserForm:
  864.       type: object
  865.       properties:
  866.         roleId:
  867.           type: integer
  868.           format: int64
  869.     NewRoleForm:
  870.       type: object
  871.       properties:
  872.         roleName:
  873.           type: string
  874.     RoleDTO:
  875.       type: object
  876.       properties:
  877.         roleId:
  878.           type: integer
  879.           format: int64
  880.         roleName:
  881.           type: string
  882.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement