Skip to content

Commit

Permalink
Use Hackathan swagger docs for development
Browse files Browse the repository at this point in the history
  • Loading branch information
okeneo committed Feb 24, 2024
1 parent a8bc9ca commit 3a7d18c
Showing 1 changed file with 171 additions and 2 deletions.
173 changes: 171 additions & 2 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -135,8 +198,7 @@ definitions:
skills:
type: array
items:
type: string
minLength: 1
$ref: '#/definitions/Skill'
TokenObtainPair:
required:
- email
Expand Down Expand Up @@ -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

0 comments on commit 3a7d18c

Please sign in to comment.