diff --git a/swagger.yaml b/swagger.yaml index 718e7c8..74aefb8 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -92,7 +92,70 @@ paths: tags: - schools parameters: [] + /user/: + get: + operationId: user_list + summary: Get a user's profile data. + description: |- + In order to view more data, the user must be logged in (authenticated) and must + be the owner of the account. + parameters: + - name: email + in: query + description: User's email + type: string + responses: + '200': + description: '' + schema: + $ref: '#/definitions/UserPublic' + '400': + description: Bad Request + '401': + description: Unauthorized Request + '404': + description: User Not Found + tags: + - user + put: + operationId: user_update + description: Update a user's profile information. + parameters: + - name: data + in: body + required: true + schema: + required: + - email + type: object + properties: + email: + type: string + responses: + '200': + description: '' + schema: + $ref: '#/definitions/UserPrivate' + '400': + description: Bad Request + '401': + description: Unauthorized Request + '404': + description: User Not Found + tags: + - user + parameters: [] definitions: + Skill: + required: + - name + type: object + properties: + name: + title: Name + type: string + maxLength: 100 + minLength: 1 UserRegister: required: - email @@ -135,8 +198,7 @@ definitions: skills: type: array items: - type: string - minLength: 1 + $ref: '#/definitions/Skill' TokenObtainPair: required: - email @@ -178,3 +240,110 @@ definitions: - Univerisity of Winnipeg - RRC Polytech - Université de Saint-Boniface + UserPublic: + required: + - skills + type: object + properties: + first_name: + title: First name + type: string + maxLength: 150 + last_name: + title: Last name + type: string + maxLength: 150 + bio: + title: Bio + type: string + maxLength: 255 + school: + title: School + type: integer + x-nullable: true + skills: + type: array + items: + $ref: '#/definitions/Skill' + UserPrivate: + required: + - skills + type: object + properties: + id: + title: ID + type: integer + readOnly: true + email: + title: Email + type: string + format: email + maxLength: 255 + minLength: 1 + first_name: + title: First name + type: string + maxLength: 150 + minLength: 1 + last_name: + title: Last name + type: string + maxLength: 150 + minLength: 1 + school: + title: School + type: string + maxLength: 100 + minLength: 1 + skills: + type: array + items: + $ref: '#/definitions/Skill' + last_login: + title: Last login + type: string + format: date-time + x-nullable: true + is_superuser: + title: Superuser status + description: Designates that this user has all permissions without explicitly + assigning them. + type: boolean + is_staff: + title: Staff status + description: Designates whether the user can log into this admin site. + type: boolean + is_active: + title: Active + description: Designates whether this user should be treated as active. Unselect + this instead of deleting accounts. + type: boolean + date_joined: + title: Date joined + type: string + format: date-time + username: + title: Username + type: string + maxLength: 30 + x-nullable: true + bio: + title: Bio + type: string + maxLength: 255 + groups: + description: The groups this user belongs to. A user will get all permissions + granted to each of their groups. + type: array + items: + description: The groups this user belongs to. A user will get all permissions + granted to each of their groups. + type: integer + uniqueItems: true + user_permissions: + description: Specific permissions for this user. + type: array + items: + description: Specific permissions for this user. + type: integer + uniqueItems: true