Advertisement
Te4nick

idanpowAPI

Apr 8th, 2024
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 7.98 KB | Software | 0 0
  1. openapi: 3.0.3
  2. info:
  3.   title: idanpow API
  4.   version: 0.0.1
  5.   description: API with only one handle to calculate the power of matrix
  6. paths:
  7.   /matrix/multiplication/scalar:
  8.     get:
  9.       operationId: matrix_multiplication_scalar_retrieve
  10.       summary: Get matrix scalar multiplication operation details
  11.       parameters:
  12.       - in: query
  13.         name: id
  14.         schema:
  15.           type: string
  16.           format: uuid
  17.         required: true
  18.       tags:
  19.      - matrix
  20.       responses:
  21.         '200':
  22.           content:
  23.             application/json:
  24.               schema:
  25.                 $ref: '#/components/schemas/Operation'
  26.               examples:
  27.                 ValidExample1:
  28.                   value:
  29.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  30.                     done: true
  31.                     result:
  32.                       matrix:
  33.                      - - 1
  34.                         - 2
  35.                       - - 3
  36.                         - 4
  37.                   summary: Operation Success
  38.                   description: Operation successfully returned matrix
  39.                 ValidExample2:
  40.                   value:
  41.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  42.                     done: false
  43.                     result: null
  44.                   summary: Operation pending
  45.                   description: Operation is pending for execution
  46.           description: ''
  47.         '404':
  48.           description: No response body
  49.         '422':
  50.           content:
  51.             application/json:
  52.               schema:
  53.                 $ref: '#/components/schemas/ValidationError'
  54.           description: ''
  55.         '500':
  56.           description: No response body
  57.     post:
  58.       operationId: matrix_multiplication_scalar_create
  59.       summary: Post matrix and scalar to execute scalar multiplication operation
  60.       tags:
  61.      - matrix
  62.       requestBody:
  63.         content:
  64.           application/json:
  65.             schema:
  66.               $ref: '#/components/schemas/MultiplyMatrix'
  67.           application/x-www-form-urlencoded:
  68.             schema:
  69.               $ref: '#/components/schemas/MultiplyMatrix'
  70.           multipart/form-data:
  71.             schema:
  72.               $ref: '#/components/schemas/MultiplyMatrix'
  73.         required: true
  74.       responses:
  75.         '200':
  76.           content:
  77.             application/json:
  78.               schema:
  79.                 $ref: '#/components/schemas/Operation'
  80.               examples:
  81.                 ValidExample1:
  82.                   value:
  83.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  84.                     done: true
  85.                     result:
  86.                       matrix:
  87.                      - - 1
  88.                         - 2
  89.                       - - 3
  90.                         - 4
  91.                   summary: Operation Success
  92.                   description: Operation successfully returned matrix
  93.                 ValidExample2:
  94.                   value:
  95.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  96.                     done: false
  97.                     result: null
  98.                   summary: Operation pending
  99.                   description: Operation is pending for execution
  100.           description: ''
  101.         '422':
  102.           content:
  103.             application/json:
  104.               schema:
  105.                 $ref: '#/components/schemas/ValidationError'
  106.           description: ''
  107.         '500':
  108.           description: No response body
  109.   /matrix/power:
  110.     get:
  111.       operationId: matrix_power_retrieve
  112.       summary: Get matrix power operation details
  113.       parameters:
  114.       - in: query
  115.         name: id
  116.         schema:
  117.           type: string
  118.           format: uuid
  119.         required: true
  120.       tags:
  121.      - matrix
  122.       responses:
  123.         '200':
  124.           content:
  125.             application/json:
  126.               schema:
  127.                 $ref: '#/components/schemas/Operation'
  128.               examples:
  129.                 ValidExample1:
  130.                   value:
  131.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  132.                     done: true
  133.                     result:
  134.                       matrix:
  135.                      - - 1
  136.                         - 2
  137.                       - - 3
  138.                         - 4
  139.                   summary: Operation Success
  140.                   description: Operation successfully returned matrix
  141.                 ValidExample2:
  142.                   value:
  143.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  144.                     done: false
  145.                     result: null
  146.                   summary: Operation pending
  147.                   description: Operation is pending for execution
  148.           description: ''
  149.         '404':
  150.           description: No response body
  151.         '422':
  152.           content:
  153.             application/json:
  154.               schema:
  155.                 $ref: '#/components/schemas/ValidationError'
  156.           description: ''
  157.         '500':
  158.           description: No response body
  159.     post:
  160.       operationId: matrix_power_create
  161.       summary: Post matrix and exponent to execute power operation
  162.       tags:
  163.      - matrix
  164.       requestBody:
  165.         content:
  166.           application/json:
  167.             schema:
  168.               $ref: '#/components/schemas/PowerSquareMatrix'
  169.           application/x-www-form-urlencoded:
  170.             schema:
  171.               $ref: '#/components/schemas/PowerSquareMatrix'
  172.           multipart/form-data:
  173.             schema:
  174.               $ref: '#/components/schemas/PowerSquareMatrix'
  175.         required: true
  176.       responses:
  177.         '200':
  178.           content:
  179.             application/json:
  180.               schema:
  181.                 $ref: '#/components/schemas/Operation'
  182.               examples:
  183.                 ValidExample1:
  184.                   value:
  185.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  186.                     done: true
  187.                     result:
  188.                       matrix:
  189.                      - - 1
  190.                         - 2
  191.                       - - 3
  192.                         - 4
  193.                   summary: Operation Success
  194.                   description: Operation successfully returned matrix
  195.                 ValidExample2:
  196.                   value:
  197.                     id: c3799cf2-6cf9-4925-916f-0736562e9930
  198.                     done: false
  199.                     result: null
  200.                   summary: Operation pending
  201.                   description: Operation is pending for execution
  202.           description: ''
  203.         '422':
  204.           content:
  205.             application/json:
  206.               schema:
  207.                 $ref: '#/components/schemas/ValidationError'
  208.           description: ''
  209.         '500':
  210.           description: No response body
  211. components:
  212.   schemas:
  213.     MultiplyMatrix:
  214.       type: object
  215.       properties:
  216.         matrix:
  217.           type: array
  218.           items:
  219.             type: array
  220.             items:
  221.               type: number
  222.               format: double
  223.             minItems: 2
  224.           minItems: 2
  225.         scalar:
  226.           type: number
  227.           format: double
  228.       required:
  229.      - matrix
  230.       - scalar
  231.     Operation:
  232.       type: object
  233.       properties:
  234.         id:
  235.           type: string
  236.           format: uuid
  237.         done:
  238.           type: boolean
  239.         result:
  240.           type: object
  241.           additionalProperties: {}
  242.       required:
  243.      - done
  244.       - id
  245.       - result
  246.     PowerSquareMatrix:
  247.       type: object
  248.       properties:
  249.         matrix:
  250.           type: array
  251.           items:
  252.             type: array
  253.             items:
  254.               type: number
  255.               format: double
  256.             minItems: 2
  257.           minItems: 2
  258.         exponent:
  259.           type: integer
  260.           minimum: 2
  261.       required:
  262.      - exponent
  263.       - matrix
  264.     ValidationError:
  265.       type: object
  266.       properties:
  267.         errors:
  268.           type: object
  269.           additionalProperties:
  270.             type: array
  271.             items:
  272.               type: string
  273.       required:
  274.      - errors
  275.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement