Advertisement
Guest User

Swagger_API

a guest
Jan 24th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 17.45 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3.   version: v1
  4.   title: Authorization API
  5. paths:
  6.   /api/Authentication/login:
  7.     post:
  8.       tags:
  9.        - Authentication
  10.       operationId: Login
  11.       consumes:
  12.        - application/json-patch+json
  13.         - application/json
  14.         - text/json
  15.         - application/*+json
  16.       produces: []
  17.       parameters:
  18.         - name: loginRequest
  19.           in: body
  20.           required: false
  21.           schema:
  22.             $ref: '#/definitions/LoginRequestDto'
  23.       responses:
  24.         '200':
  25.           description: Success
  26.   /api/Authentication/loginas:
  27.     post:
  28.       tags:
  29.        - Authentication
  30.       operationId: LoginAs
  31.       consumes:
  32.        - application/json-patch+json
  33.         - application/json
  34.         - text/json
  35.         - application/*+json
  36.       produces: []
  37.       parameters:
  38.         - name: loginAsDto
  39.           in: body
  40.           required: false
  41.           schema:
  42.             $ref: '#/definitions/LoginAsDto'
  43.       responses:
  44.         '200':
  45.           description: Success
  46.   /api/Authentication/twofactorverify:
  47.     post:
  48.       tags:
  49.        - Authentication
  50.       operationId: TwoFactorVerify
  51.       consumes:
  52.        - application/json-patch+json
  53.         - application/json
  54.         - text/json
  55.         - application/*+json
  56.       produces: []
  57.       parameters:
  58.         - name: twoFactorRequest
  59.           in: body
  60.           required: false
  61.           schema:
  62.             $ref: '#/definitions/TwoFactorVerifyDto'
  63.       responses:
  64.         '200':
  65.           description: Success
  66.   /api/Authentication/.well-known/fake-openid-configuration:
  67.     get:
  68.       tags:
  69.        - Authentication
  70.       operationId: GetFakeOpenIdConfig
  71.       consumes: []
  72.       produces: []
  73.       parameters: []
  74.       responses:
  75.         '200':
  76.           description: Success
  77.   /api/Authentication/forgotpassword:
  78.     post:
  79.       tags:
  80.        - Authentication
  81.       operationId: ForgotPassword
  82.       consumes:
  83.        - application/json-patch+json
  84.         - application/json
  85.         - text/json
  86.         - application/*+json
  87.       produces: []
  88.       parameters:
  89.         - name: request
  90.           in: body
  91.           required: false
  92.           schema:
  93.             $ref: '#/definitions/ForgotPasswordDto'
  94.       responses:
  95.         '200':
  96.           description: Success
  97.   /api/Authentication/initresetpassword:
  98.     post:
  99.       tags:
  100.        - Authentication
  101.       operationId: InitResetPassword
  102.       consumes:
  103.        - application/json-patch+json
  104.         - application/json
  105.         - text/json
  106.         - application/*+json
  107.       produces: []
  108.       parameters:
  109.         - name: request
  110.           in: body
  111.           required: false
  112.           schema:
  113.             $ref: '#/definitions/InitResetPasswordRequest'
  114.       responses:
  115.         '200':
  116.           description: Success
  117.   /api/Authentication/resetpassword:
  118.     post:
  119.       tags:
  120.        - Authentication
  121.       operationId: ResetPassword
  122.       consumes:
  123.        - application/json-patch+json
  124.         - application/json
  125.         - text/json
  126.         - application/*+json
  127.       produces: []
  128.       parameters:
  129.         - name: resetPasswordDto
  130.           in: body
  131.           required: false
  132.           schema:
  133.             $ref: '#/definitions/ResetPasswordDto'
  134.       responses:
  135.         '200':
  136.           description: Success
  137.   /api/Role:
  138.     get:
  139.       tags:
  140.        - Role
  141.       operationId: GetAll
  142.       consumes: []
  143.       produces:
  144.        - application/json
  145.       parameters: []
  146.       responses:
  147.         '200':
  148.           description: Success
  149.           schema:
  150.             uniqueItems: false
  151.             type: array
  152.             items:
  153.               $ref: '#/definitions/RoleDto'
  154.     post:
  155.       tags:
  156.        - Role
  157.       operationId: Post
  158.       consumes:
  159.        - application/json-patch+json
  160.         - application/json
  161.         - text/json
  162.         - application/*+json
  163.       produces:
  164.        - application/json
  165.       parameters:
  166.         - name: role
  167.           in: body
  168.           required: false
  169.           schema:
  170.             $ref: '#/definitions/RoleDto'
  171.       responses:
  172.         '201':
  173.           description: Success
  174.           schema:
  175.             $ref: '#/definitions/RoleDto'
  176.         '500':
  177.           description: Server Error
  178.           schema:
  179.             uniqueItems: false
  180.             type: array
  181.             items:
  182.               type: string
  183.   '/api/Role/{id}':
  184.     get:
  185.       tags:
  186.        - Role
  187.       operationId: Get
  188.       consumes: []
  189.       produces:
  190.        - application/json
  191.       parameters:
  192.         - name: id
  193.           in: path
  194.           required: true
  195.           type: string
  196.           format: uuid
  197.       responses:
  198.         '200':
  199.           description: Success
  200.           schema:
  201.             $ref: '#/definitions/RoleDto'
  202.         '404':
  203.           description: Not Found
  204.           schema:
  205.             $ref: '#/definitions/ProblemDetails'
  206.     delete:
  207.       tags:
  208.        - Role
  209.       operationId: Delete
  210.       consumes: []
  211.       produces:
  212.        - application/json
  213.       parameters:
  214.         - name: id
  215.           in: path
  216.           required: true
  217.           type: string
  218.           format: uuid
  219.       responses:
  220.         '204':
  221.           description: Success
  222.         '404':
  223.           description: Not Found
  224.           schema:
  225.             $ref: '#/definitions/ProblemDetails'
  226.         '500':
  227.           description: Server Error
  228.           schema:
  229.             uniqueItems: false
  230.             type: array
  231.             items:
  232.               type: string
  233.     patch:
  234.       tags:
  235.        - Role
  236.       operationId: Patch
  237.       consumes:
  238.        - application/json-patch+json
  239.         - application/json
  240.         - text/json
  241.         - application/*+json
  242.       produces:
  243.        - application/json
  244.       parameters:
  245.         - name: id
  246.           in: path
  247.           required: true
  248.           type: string
  249.           format: uuid
  250.         - name: update
  251.           in: body
  252.           required: false
  253.           schema:
  254.             uniqueItems: false
  255.             type: array
  256.             items:
  257.               $ref: '#/definitions/Operation'
  258.       responses:
  259.         '204':
  260.           description: Success
  261.         '404':
  262.           description: Not Found
  263.           schema:
  264.             $ref: '#/definitions/ProblemDetails'
  265.         '500':
  266.           description: Server Error
  267.           schema:
  268.             uniqueItems: false
  269.             type: array
  270.             items:
  271.               type: string
  272.   '/api/User/{userId}/roles':
  273.     get:
  274.       tags:
  275.        - User
  276.       operationId: GetRolesForUser
  277.       consumes:
  278.        - application/json
  279.       produces:
  280.        - application/json
  281.       parameters:
  282.         - name: userId
  283.           in: path
  284.           required: true
  285.           type: string
  286.       responses:
  287.         '200':
  288.           description: Success
  289.           schema:
  290.             uniqueItems: false
  291.             type: array
  292.             items:
  293.               $ref: '#/definitions/T'
  294.         '204':
  295.           description: Success
  296.     post:
  297.       tags:
  298.        - User
  299.       operationId: AddToRoles
  300.       consumes:
  301.        - application/json
  302.       produces:
  303.        - application/json
  304.       parameters:
  305.         - name: userId
  306.           in: path
  307.           required: true
  308.           type: string
  309.           format: uuid
  310.         - name: roles
  311.           in: body
  312.           required: false
  313.           schema:
  314.             uniqueItems: false
  315.             type: array
  316.             items:
  317.               $ref: '#/definitions/RoleDto'
  318.       responses:
  319.         '204':
  320.           description: Success
  321.         '500':
  322.           description: Server Error
  323.           schema:
  324.             uniqueItems: false
  325.             type: array
  326.             items:
  327.               type: string
  328.   '/api/User/{userId}/roles/{roleId}':
  329.     delete:
  330.       tags:
  331.        - User
  332.       operationId: DeleteRoleFromUser
  333.       consumes:
  334.        - application/json
  335.       produces:
  336.        - application/json
  337.       parameters:
  338.         - name: userId
  339.           in: path
  340.           required: true
  341.           type: string
  342.         - name: roleId
  343.           in: path
  344.           required: true
  345.           type: string
  346.           format: uuid
  347.       responses:
  348.         '204':
  349.           description: Success
  350.         '404':
  351.           description: Not Found
  352.           schema:
  353.             type: string
  354.         '500':
  355.           description: Server Error
  356.           schema:
  357.             uniqueItems: false
  358.             type: array
  359.             items:
  360.               type: string
  361.   '/api/User/{userId}/roles/delete':
  362.     post:
  363.       tags:
  364.        - User
  365.       operationId: DeleteRolesFromUser
  366.       consumes:
  367.        - application/json
  368.       produces:
  369.        - application/json
  370.       parameters:
  371.         - name: userId
  372.           in: path
  373.           required: true
  374.           type: string
  375.         - name: deleteRolesDto
  376.           in: body
  377.           required: false
  378.           schema:
  379.             uniqueItems: false
  380.             type: array
  381.             items:
  382.               $ref: '#/definitions/RoleDto'
  383.       responses:
  384.         '204':
  385.           description: Success
  386.         '404':
  387.           description: Not Found
  388.           schema:
  389.             type: string
  390.         '500':
  391.           description: Server Error
  392.           schema:
  393.             uniqueItems: false
  394.             type: array
  395.             items:
  396.               type: string
  397.   /api/User:
  398.     get:
  399.       tags:
  400.        - User
  401.       operationId: GetAll
  402.       consumes:
  403.        - application/json
  404.       produces:
  405.        - application/json
  406.       parameters: []
  407.       responses:
  408.         '200':
  409.           description: Success
  410.           schema:
  411.             uniqueItems: false
  412.             type: array
  413.             items:
  414.               $ref: '#/definitions/UserDto'
  415.     post:
  416.       tags:
  417.        - User
  418.       operationId: Create
  419.       consumes:
  420.        - application/json
  421.       produces:
  422.        - application/json
  423.       parameters:
  424.         - name: userDto
  425.           in: body
  426.           required: false
  427.           schema:
  428.             $ref: '#/definitions/UserDto'
  429.       responses:
  430.         '200':
  431.           description: Success
  432.           schema:
  433.             $ref: '#/definitions/UserDto'
  434.         '500':
  435.           description: Server Error
  436.           schema:
  437.             uniqueItems: false
  438.             type: array
  439.             items:
  440.               type: string
  441.   '/api/User/{userId}':
  442.     get:
  443.       tags:
  444.        - User
  445.       operationId: GetById
  446.       consumes:
  447.        - application/json
  448.       produces:
  449.        - application/json
  450.       parameters:
  451.         - name: id
  452.           in: query
  453.           required: false
  454.           type: string
  455.         - name: userId
  456.           in: path
  457.           required: true
  458.           type: string
  459.       responses:
  460.         '200':
  461.           description: Success
  462.           schema:
  463.             $ref: '#/definitions/UserDto'
  464.         '404':
  465.           description: Not Found
  466.           schema:
  467.             $ref: '#/definitions/ProblemDetails'
  468.     patch:
  469.       tags:
  470.        - User
  471.       operationId: Update
  472.       consumes:
  473.        - application/json
  474.       produces:
  475.        - application/json
  476.       parameters:
  477.         - name: userId
  478.           in: path
  479.           required: true
  480.           type: string
  481.         - name: user
  482.           in: body
  483.           required: false
  484.           schema:
  485.             uniqueItems: false
  486.             type: array
  487.             items:
  488.               $ref: '#/definitions/Operation'
  489.       responses:
  490.         '200':
  491.           description: Success
  492.           schema:
  493.             $ref: '#/definitions/UserDto'
  494.         '404':
  495.           description: Not Found
  496.           schema:
  497.             $ref: '#/definitions/ProblemDetails'
  498.   '/api/User/{userId}/claims':
  499.     get:
  500.       tags:
  501.        - User
  502.       operationId: GetUserClaims
  503.       consumes:
  504.        - application/json
  505.       produces:
  506.        - application/json
  507.       parameters:
  508.         - name: userId
  509.           in: path
  510.           required: true
  511.           type: string
  512.       responses:
  513.         '200':
  514.           description: Success
  515.           schema:
  516.             uniqueItems: false
  517.             type: array
  518.             items:
  519.               $ref: '#/definitions/Claim'
  520.         '404':
  521.           description: Not Found
  522.           schema:
  523.             $ref: '#/definitions/ProblemDetails'
  524.     post:
  525.       tags:
  526.        - User
  527.       operationId: AddClaimsToUser
  528.       consumes:
  529.        - application/json
  530.       produces:
  531.        - application/json
  532.       parameters:
  533.         - name: userId
  534.           in: path
  535.           required: true
  536.           type: string
  537.         - name: claims
  538.           in: body
  539.           required: false
  540.           schema:
  541.             uniqueItems: false
  542.             type: array
  543.             items:
  544.               $ref: '#/definitions/ClaimDto'
  545.       responses:
  546.         '204':
  547.           description: Success
  548.         '404':
  549.           description: Not Found
  550.           schema:
  551.             $ref: '#/definitions/ProblemDetails'
  552.         '500':
  553.           description: Server Error
  554.           schema:
  555.             uniqueItems: false
  556.             type: array
  557.             items:
  558.               type: string
  559.   '/api/User/{userId}/claims/remove':
  560.     post:
  561.       tags:
  562.        - User
  563.       operationId: RemoveClaimsAsync
  564.       consumes:
  565.        - application/json
  566.       produces:
  567.        - application/json
  568.       parameters:
  569.         - name: userId
  570.           in: path
  571.           required: true
  572.           type: string
  573.         - name: claimsToRemove
  574.           in: body
  575.           required: false
  576.           schema:
  577.             uniqueItems: false
  578.             type: array
  579.             items:
  580.               $ref: '#/definitions/ClaimDto'
  581.       responses:
  582.         '204':
  583.           description: Success
  584.         '404':
  585.           description: Not Found
  586.           schema:
  587.             $ref: '#/definitions/ProblemDetails'
  588.         '500':
  589.           description: Server Error
  590.           schema:
  591.             uniqueItems: false
  592.             type: array
  593.             items:
  594.               type: string
  595. definitions:
  596.   LoginRequestDto:
  597.     required:
  598.      - email
  599.     type: object
  600.     properties:
  601.       email:
  602.         type: string
  603.       password:
  604.         type: string
  605.       rememberMe:
  606.         type: boolean
  607.   LoginAsDto:
  608.     required:
  609.      - claim
  610.       - value
  611.       - email
  612.     type: object
  613.     properties:
  614.       claim:
  615.         type: string
  616.       value:
  617.         type: string
  618.       email:
  619.         type: string
  620.       reason:
  621.         type: string
  622.   TwoFactorVerifyDto:
  623.     type: object
  624.     properties:
  625.       email:
  626.         type: string
  627.       password:
  628.         type: string
  629.       rememberMe:
  630.         type: boolean
  631.       code:
  632.         type: string
  633.   ForgotPasswordDto:
  634.     type: object
  635.     properties:
  636.       email:
  637.         type: string
  638.       returnUrl:
  639.         type: string
  640.   InitResetPasswordRequest:
  641.     required:
  642.      - token
  643.     type: object
  644.     properties:
  645.       token:
  646.         format: uuid
  647.         type: string
  648.   ResetPasswordDto:
  649.     required:
  650.      - token
  651.       - password
  652.       - password2
  653.     type: object
  654.     properties:
  655.       token:
  656.         format: uuid
  657.         type: string
  658.       password:
  659.         type: string
  660.       password2:
  661.         type: string
  662.   RoleDto:
  663.     required:
  664.      - name
  665.     type: object
  666.     properties:
  667.       name:
  668.         type: string
  669.   ProblemDetails:
  670.     type: object
  671.     properties:
  672.       type:
  673.         type: string
  674.       title:
  675.         type: string
  676.       status:
  677.         format: int32
  678.         type: integer
  679.       detail:
  680.         type: string
  681.       instance:
  682.         type: string
  683.     additionalProperties:
  684.       type: object
  685.   Operation:
  686.     type: object
  687.     properties:
  688.       value:
  689.         type: object
  690.       path:
  691.         type: string
  692.       op:
  693.         type: string
  694.       from:
  695.         type: string
  696.   T:
  697.     type: object
  698.     properties: {}
  699.   UserDto:
  700.     type: object
  701.     properties:
  702.       firstName:
  703.         type: string
  704.       email:
  705.         type: string
  706.       lastName:
  707.         type: string
  708.       username:
  709.         type: string
  710.       password:
  711.         type: string
  712.   Claim:
  713.     type: object
  714.     properties:
  715.       issuer:
  716.         type: string
  717.         readOnly: true
  718.       originalIssuer:
  719.         type: string
  720.         readOnly: true
  721.       properties:
  722.         type: object
  723.         additionalProperties:
  724.           type: string
  725.         readOnly: true
  726.       subject:
  727.         $ref: '#/definitions/ClaimsIdentity'
  728.         readOnly: true
  729.       type:
  730.         type: string
  731.         readOnly: true
  732.       value:
  733.         type: string
  734.         readOnly: true
  735.       valueType:
  736.         type: string
  737.         readOnly: true
  738.   ClaimsIdentity:
  739.     type: object
  740.     properties:
  741.       authenticationType:
  742.         type: string
  743.         readOnly: true
  744.       isAuthenticated:
  745.         type: boolean
  746.         readOnly: true
  747.       actor:
  748.         $ref: '#/definitions/ClaimsIdentity'
  749.       bootstrapContext:
  750.         type: object
  751.       claims:
  752.         uniqueItems: false
  753.         type: array
  754.         items:
  755.           $ref: '#/definitions/Claim'
  756.         readOnly: true
  757.       label:
  758.         type: string
  759.       name:
  760.         type: string
  761.         readOnly: true
  762.       nameClaimType:
  763.         type: string
  764.         readOnly: true
  765.       roleClaimType:
  766.         type: string
  767.         readOnly: true
  768.   ClaimDto:
  769.     required:
  770.      - claimType
  771.       - claimValue
  772.     type: object
  773.     properties:
  774.       claimType:
  775.         type: string
  776.       claimValue:
  777.         type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement