# 绑定用户角色

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/users/{username}/role:
    patch:
      summary: 绑定用户角色
      deprecated: false
      description: ''
      operationId: bindRole
      tags:
        - 用户管理
        - user-controller
      parameters:
        - name: username
          in: path
          description: ''
          required: true
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              uniqueItems: true
              type: array
              items:
                type: string
            example: ''
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apifox-orders: []
                x-apifox-ignore-properties: []
          headers: {}
          x-apifox-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
          x-apifox-name: Bad Request
      security:
        - bearer: []
      x-apifox-folder: 用户管理
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/3525375/apis/api-121737375-run
components:
  schemas:
    ErrorResponse:
      required:
        - code
        - msg
      type: object
      properties:
        code:
          type: string
        msg:
          type: string
      x-apifox-orders:
        - code
        - msg
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: http://dev-cn.your-api-server.com
    description: 开发环境
security:
  - bearer: []

```
