Skip to content

Commit

Permalink
feature(profile): view user profile
Browse files Browse the repository at this point in the history
write using test to view user profile by username
create a route to view profile
create user controller to view
  • Loading branch information
allebd committed Aug 2, 2019
1 parent 80afc92 commit 7887758
Show file tree
Hide file tree
Showing 28 changed files with 687 additions and 248 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# Authors Haven - A Social platform for the creative at heart.


# Team Dahlia

## Vision
Expand Down
79 changes: 64 additions & 15 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ tags:
- name: Users
description: Operations available for user endpoints

security:
- ApiKeyAuth: []
paths:
/users:
post:
tags:
- Users
summary: Creates a new user
summary: Creates a new user.
security:
- ApiKeyAuth: []
requestBody:
description: fields containing user data
content:
Expand Down Expand Up @@ -112,7 +112,7 @@ paths:
type: string
responses:
200:
description: succesful request
description: successful request
content:
application/json:
schema:
Expand All @@ -129,15 +129,47 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/StandardServerResponse'

'/profiles/{userId}':
get:
summary: View a user profile.
parameters:
- name: userId
in: path
required: true
schema:
type: integer
example: '1'
responses:
200:
description: profile details of user
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Profile'
404:
description: user not found
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
message:
type: string
example: 'user not found'


components:
schemas:
User:
required:
- firstName
- lastName
- email
- username
type: object
properties:
firstName:
Expand All @@ -149,9 +181,9 @@ components:
email:
type: string
example: johndoe@email.com
username:
type: string
example: johnnydoe12
id:
type: integer
example: 1
bio:
type: string
example: I am awesome
Expand All @@ -178,9 +210,6 @@ components:
lastName:
type: string
example: doe
username:
type: string
example: johnnydoe12
email:
type: string
example: johndoe@email.com
Expand All @@ -199,8 +228,8 @@ components:
properties:
token:
type: string
username:
type: string
id:
type: integer
bio:
type: string
ForgotPasswordUser:
Expand All @@ -219,7 +248,27 @@ components:
example: success
message:
type: string
example: internal server error
example: internal server error
Profile:
required:
- id
- bio
- image
- following
type: object
properties:
id:
type: integer
example: 1
bio:
type: string
example: I love novels
image:
type: string
example: ''
following:
type: boolean
example: true
securitySchemes:
ApiKeyAuth:
type: apiKey
Expand Down
Loading

0 comments on commit 7887758

Please sign in to comment.