Skip to content

Commit

Permalink
Merge pull request #56 from kmcdon83/ken-mcdonald-added-My-API
Browse files Browse the repository at this point in the history
Added api/My-API.yaml
  • Loading branch information
kmcdon83 committed Feb 26, 2024
2 parents 4a482fc + 926645e commit a1557e0
Showing 1 changed file with 212 additions and 0 deletions.
212 changes: 212 additions & 0 deletions api/My-API.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
openapi: 3.1.0
x-stoplight:
id: kajsnfi4kbdro
info:
title: My API
version: '1.0'
summary: Test
servers:
- url: 'http://localhost:3000'
paths:
'/users/{userId}':
parameters:
- schema:
type: integer
name: userId
in: path
required: true
description: Id of an existing user.
get:
summary: Get User Info by User ID
tags: []
responses:
'200':
description: User Found
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
Get User Alice Smith:
value:
id: 142
firstName: Alice
lastName: Smith
email: alice.smith@gmail.com
dateOfBirth: '1997-10-31'
emailVerified: true
signUpDate: '2019-08-24'
'404':
description: User Not Found
operationId: get-users-userId
description: Retrieve the information of the user with the matching user ID.
x-stoplight:
id: ommsnsfk2yxya
patch:
summary: Update User Information
operationId: patch-users-userId
responses:
'200':
description: User Updated
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
Updated User Rebecca Baker:
value:
id: 13
firstName: Rebecca
lastName: Baker
email: rebecca@gmail.com
dateOfBirth: '1985-10-02'
emailVerified: false
createDate: '2019-08-24'
'404':
description: User Not Found
'409':
description: Email Already Taken
description: Update the information of an existing user.
requestBody:
content:
application/json:
schema:
type: object
properties:
firstName:
type: string
lastName:
type: string
email:
type: string
description: 'If a new email is given, the user''s email verified property will be set to false.'
dateOfBirth:
type: string
examples:
Update First Name:
value:
firstName: Rebecca
Update Email:
value:
email: rebecca@gmail.com
Update Last Name & Date of Birth:
value:
lastName: Baker
dateOfBirth: '1985-10-02'
description: Patch user properties to update.
x-stoplight:
id: yobxo97a7cfat
/user:
post:
summary: Create New User
operationId: post-user
responses:
'200':
description: User Created
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
New User Bob Fellow:
value:
id: 12
firstName: Bob
lastName: Fellow
email: bob.fellow@gmail.com
dateOfBirth: '1996-08-24'
emailVerified: false
createDate: '2020-11-18'
'400':
description: Missing Required Information
'409':
description: Email Already Taken
requestBody:
content:
application/json:
schema:
type: object
properties:
firstName:
type: string
lastName:
type: string
email:
type: string
dateOfBirth:
type: string
format: date
required:
- firstName
- lastName
- email
- dateOfBirth
examples:
Create User Bob Fellow:
value:
firstName: Bob
lastName: Fellow
email: bob.fellow@gmail.com
dateOfBirth: '1996-08-24'
description: Post the necessary fields for the API to create a new user.
description: Create a new user.
x-stoplight:
id: 3lwhfauywsx5z
components:
schemas:
User:
title: User
type: object
description: ''
examples:
- id: 142
firstName: Alice
lastName: Smith
email: alice.smith@gmail.com
dateOfBirth: '1997-10-31'
emailVerified: true
signUpDate: '2019-08-24'
properties:
id:
type: integer
description: Unique identifier for the given user.
x-stoplight:
id: tlfsp074k4czu
firstName:
type: string
x-stoplight:
id: 3mqgu4a0lg2i6
lastName:
type: string
x-stoplight:
id: xh2ooo3lbecv0
email:
type: string
format: email
x-stoplight:
id: 51wf80eyfdyh1
dateOfBirth:
type: string
format: date
example: '1997-10-31'
x-stoplight:
id: dmiuc68vijy1m
emailVerified:
type: boolean
description: Set to true if the user's email has been verified.
x-stoplight:
id: jfe41cwjtgi8a
createDate:
type: string
format: date
description: The date that the user was created.
x-stoplight:
id: qqhfbkqnt0bxn
required:
- id
- firstName
- lastName
- email
- emailVerified
x-stoplight:
id: iz2vea24m9le8

0 comments on commit a1557e0

Please sign in to comment.