Skip to content

Instantly share code, notes, and snippets.

@carmandomx
Created May 25, 2023 20:11
Show Gist options
  • Save carmandomx/7db22aabd083467973457ae5e21d44e3 to your computer and use it in GitHub Desktop.
Save carmandomx/7db22aabd083467973457ae5e21d44e3 to your computer and use it in GitHub Desktop.
APIDOC
openapi: 3.1.0
info:
title: Recruitment Form
description: |-
Let's create a restful API for the previous ReactJS Project
Some useful links:
- [Base repo](https://github.com/swagger-api/swagger-petstore)
version: 0.0.1
servers:
- url: http://localhost:5000/api/v1
tags:
- name: user
description: Operations about user
- name: personalInfo
description: CRUD for PersonalInfo
- name: address
description: CRUD for addresses
- name: addressExtraInfo
description: CRUD for addressExtraInfo
- name: governmentInfo
description: CRUD for governmentInfo
- name: profile
description: CRUD for profile
- name: academicInfo
description: CRUD for academicInfo
- name: formalEducationInfo
description: CRUD for formalEducationInfo
- name: scholarshipInfo
description: CRUD for scholarshipInfo
- name: bankAccountInfo
description: CRUD for bankAccountInfo
- name: skills
description: CRUD for skills
paths:
/personalInfo:
post:
tags:
- personalInfo
summary: create personalInfo
description: Create a PersonalInfo record
operationId: createPersonalInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/PersonalInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/PersonalInfo'
/personalInfo/{id}:
get:
tags:
- personalInfo
summary: read personalInfo
operationId: fetchPersonalInfo
description: Read a PersonalInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/PersonalInfo'
'400':
description: Invalid id supplied
'404':
description: PersonalInfo not found
put:
tags:
- personalInfo
summary: update personalInfo
description: Update personalInfo; You need to provide the full model as body
operationId: updatePersonalInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent PersonalInfo record
content:
application/json:
schema:
$ref: '#/components/schemas/PersonalInfo'
responses:
default:
description: successful operation
delete:
tags:
- personalInfo
summary: delete personalInfo
description: This can only be done by the user that created it
operationId: deletePersonalInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: PersonalInfo not found
/address:
post:
tags:
- address
summary: create address
description: Create a Address record
operationId: createAddress
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
/address/{id}:
get:
tags:
- address
summary: read Address
operationId: fetchAddress
description: Read a Address record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
'400':
description: Invalid id supplied
'404':
description: Address not found
put:
tags:
- address
summary: update Address
description: Update Address; You need to provide the full model as body
operationId: updateAddress
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent Address record
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
responses:
default:
description: successful operation
delete:
tags:
- address
summary: delete personalInfo
description: This can only be done by the user that created it
operationId: deleteAddress
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: PersonalInfo not found
/addressExtraInfo:
post:
tags:
- addressExtraInfo
summary: create addressExtraInfo
description: Create a addressExtraInfo record
operationId: createAddressExtraInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
/addressExtraInfo/{id}:
get:
tags:
- addressExtraInfo
summary: read AddressExtraInfo
operationId: fetchAddressExtraInfo
description: Read a GovernmentInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
'400':
description: Invalid id supplied
'404':
description: GovernmentInfo not found
put:
tags:
- addressExtraInfo
summary: update AddressExtraInfo
description: Update AddressExtraInfo; You need to provide the full model as body
operationId: updateAddressExtraInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent Address record
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
responses:
default:
description: successful operation
delete:
tags:
- addressExtraInfo
summary: delete personalInfo
description: This can only be done by the user that created it
operationId: deleteAddressExtraInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: AddressExtraInfo not found
/governmentInfo:
post:
tags:
- governmentInfo
summary: create GovernmentInfo
description: Create a GovernmentInfo record
operationId: createGovernmentInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
/governmentInfo/{id}:
get:
tags:
- governmentInfo
summary: read governmentInfo
operationId: fetchgovernmentInfo
description: Read a governmentInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
'400':
description: Invalid id supplied
'404':
description: GovernmentInfo not found
put:
tags:
- governmentInfo
summary: update GovernmentInfo
description: Update GovernmentInfo; You need to provide the full model as body
operationId: updateGovernmentInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent Address record
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
responses:
default:
description: successful operation
delete:
tags:
- governmentInfo
summary: delete GovernmentInfo
description: This can only be done by the user that created it
operationId: deleteGovernmentInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: GovernmentInfo not found
/profile:
post:
tags:
- profile
summary: create profile
description: Create a profile record
operationId: createProfile
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/Profile'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Profile'
/profile/{id}:
get:
tags:
- profile
summary: read profile
operationId: fetchProfile
description: Read a profile record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
'400':
description: Invalid id supplied
'404':
description: GovernmentInfo not found
put:
tags:
- profile
summary: update profile
description: Update profile; You need to provide the full model as body
operationId: updateProfile
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent profile record
content:
application/json:
schema:
$ref: '#/components/schemas/GovernmentInfo'
responses:
default:
description: successful operation
delete:
tags:
- profile
summary: delete profile
description: This can only be done by the user that created it
operationId: deleteProfile
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: profile not found
/skills:
post:
tags:
- skills
summary: create Skills
description: Create a Skills record
operationId: createSkills
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/Skills'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Skills'
/skills/{id}:
get:
tags:
- skills
summary: read Skills
operationId: fetchSkills
description: Read a Skills record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Skills'
'400':
description: Invalid id supplied
'404':
description: Skills not found
put:
tags:
- skills
summary: update Skills
description: Update Skills; You need to provide the full model as body
operationId: updateSkills
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent Skills record
content:
application/json:
schema:
$ref: '#/components/schemas/Skills'
responses:
default:
description: successful operation
delete:
tags:
- skills
summary: delete Skills
description: This can only be done by the user that created it
operationId: deleteSkills
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: Skills not found
/academicInfo:
post:
tags:
- academicInfo
summary: create AcademicInfo
description: Create a AcademicInfo record
operationId: createAcademicInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/AcademicInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/AcademicInfo'
/academicInfo/{id}:
get:
tags:
- academicInfo
summary: read academicInfo
operationId: fetchAcademicInfo
description: Read a AcademicInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/AcademicInfo'
'400':
description: Invalid id supplied
'404':
description: AcademicInfo not found
put:
tags:
- academicInfo
summary: update AcademicInfo
description: Update AcademicInfo; You need to provide the full model as body
operationId: updateAcademicInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent AcademicInfo record
content:
application/json:
schema:
$ref: '#/components/schemas/AcademicInfo'
responses:
default:
description: successful operation
delete:
tags:
- academicInfo
summary: delete AcademicInfo
description: This can only be done by the user that created it
operationId: deleteAcademicInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: AcademicInfo not found
/formalEducationInfo:
post:
tags:
- formalEducationInfo
summary: create FormalEducationInfo
description: Create a FormalEducationInfo record
operationId: createFormalEducationInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/FormalEducationInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/FormalEducationInfo'
/formalEducationInfo/{id}:
get:
tags:
- formalEducationInfo
summary: read FormalEducationInfo
operationId: fetchFormalEducationInfo
description: Read a FormalEducationInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/FormalEducationInfo'
'400':
description: Invalid id supplied
'404':
description: FormalEducationInfo not found
put:
tags:
- formalEducationInfo
summary: update FormalEducationInfo
description: Update FormalEducationInfo; You need to provide the full model as body
operationId: updateFormalEducationInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent FormalEducationInfo record
content:
application/json:
schema:
$ref: '#/components/schemas/FormalEducationInfo'
responses:
default:
description: successful operation
delete:
tags:
- formalEducationInfo
summary: delete FormalEducationInfo
description: This can only be done by the user that created it
operationId: deleteFormalEducationInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: FormalEducationInfo not found
/scholarshipInfo:
post:
tags:
- scholarshipInfo
summary: create ScholarshipInfo
description: Create a ScholarshipInfo record
operationId: createScholarshipInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/ScholarshipInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ScholarshipInfo'
/scholarshipInfo/{id}:
get:
tags:
- scholarshipInfo
summary: read ScholarshipInfo
operationId: fetchScholarshipInfo
description: Read a ScholarshipInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ScholarshipInfo'
'400':
description: Invalid id supplied
'404':
description: ScholarshipInfo not found
put:
tags:
- scholarshipInfo
summary: update ScholarshipInfo
description: Update ScholarshipInfo; You need to provide the full model as body
operationId: updateScholarshipInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent ScholarshipInfo record
content:
application/json:
schema:
$ref: '#/components/schemas/ScholarshipInfo'
responses:
default:
description: successful operation
delete:
tags:
- scholarshipInfo
summary: delete ScholarshipInfo
description: This can only be done by the user that created it
operationId: deleteScholarshipInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: ScholarshipInfo not found
/bankAccountInfo:
post:
tags:
- bankAccountInfo
summary: create BankAccountInfo
description: Create a BankAccountInfo record
operationId: createBankAccountInfo
requestBody:
description: Object
content:
application/json:
schema:
$ref: '#/components/schemas/BankAccountInfo'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/BankAccountInfo'
/bankAccountInfo/{id}:
get:
tags:
- bankAccountInfo
summary: read BankAccountInfo
operationId: fetchBankAccountInfo
description: Read a BankAccountInfo record
parameters:
- name: id
in: path
description: 'The id that needs to be fetched. Use 1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/BankAccountInfo'
'400':
description: Invalid id supplied
'404':
description: BankAccountInfo not found
put:
tags:
- bankAccountInfo
summary: update BankAccountInfo
description: Update BankAccountInfo; You need to provide the full model as body
operationId: updateBankAccountInfo
parameters:
- name: id
in: path
description: id that is being updated
required: true
schema:
type: string
requestBody:
description: Update an existent BankAccountInfo record
content:
application/json:
schema:
$ref: '#/components/schemas/BankAccountInfo'
responses:
default:
description: successful operation
delete:
tags:
- bankAccountInfo
summary: delete BankAccountInfo
description: This can only be done by the user that created it
operationId: deleteBankAccountInfo
parameters:
- name: id
in: path
description: The id of the record to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid id supplied
'404':
description: BankAccountInfo not found
/user:
post:
tags:
- user
summary: Create user
description: This can only be done by the logged in user.
operationId: createUser
requestBody:
description: Created user object
content:
application/json:
schema:
$ref: '#/components/schemas/User'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/user/{username}:
get:
tags:
- user
summary: Get user by user name
description: ''
operationId: getUserByName
parameters:
- name: username
in: path
description: 'The name that needs to be fetched. Use user1 for testing. '
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/User'
application/xml:
schema:
$ref: '#/components/schemas/User'
'400':
description: Invalid username supplied
'404':
description: User not found
put:
tags:
- user
summary: Update user
description: This can only be done by the logged in user.
operationId: updateUser
parameters:
- name: username
in: path
description: name that need to be deleted
required: true
schema:
type: string
requestBody:
description: Update an existent user in the store
content:
application/json:
schema:
$ref: '#/components/schemas/User'
application/xml:
schema:
$ref: '#/components/schemas/User'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/User'
responses:
default:
description: successful operation
delete:
tags:
- user
summary: Delete user
description: This can only be done by the logged in user.
operationId: deleteUser
parameters:
- name: username
in: path
description: The name that needs to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid username supplied
'404':
description: User not found
components:
schemas:
PersonalInfo:
type: object
properties:
id:
type: integer
format: int64
example: 10
name:
type: string
example: Carlos
last_name:
type: string
example: Reyes
second_last_name:
type: string
example: Castillo
gender:
type: string
example: male
enum:
- male
- female
- decline
- other
gender_other:
type: string
example: null
date_of_birth:
type: string
format: date
example: 01-01-1994
city_of_birth:
type: string
example: Queretaro
state_of_birth:
type: string
example: Queretaro
country_of_birth:
type: string
example: Mexico
user_id:
type: integer
format: int64
description: FKey to User
Address:
type: object
properties:
street:
type: string
example: 437 Lytton
in_between_street_a:
type: string
example: 437 Lytton
in_between_street_b:
type: string
example: 437 Lytton
city:
type: string
example: Palo Alto
state:
type: string
example: CA
country:
type: string
example: US
zip:
type: string
example: '94301'
proof_of_address:
type: string
contentMediaType: image/png, image/jpg, application/pdf
contentEncoding: base64
user_id:
type: integer
format: int64
description: FKey to User
AddressExtraInfo:
type: object
properties:
type_of_residency:
type: string
example: rented
enum:
- rented
- owned
- other
other_residency:
type: string
example: mortgage
people:
type: string
enum:
- alone
- parents
- couple
- couple_childs
address_id:
type: integer
format: int64
example: 5
description: FKey to Address
GovernmentInfo:
type: object
properties:
CURP:
type: string
example: HEGG560427MVZRRL04
description: Null if Mexico is not the country, required otherwise
identification_number:
type: string
description: Passport number or National ID number equivalent
user_id:
type: integer
format: int64
description: FKey to User
Profile:
type: object
properties:
phone:
type: string
format: tel
example: 0123456789
country_code:
type: string
example: +52
email:
type: string
format: email
example: test@test.org
description: This should be the same email as in User
alt_email:
type: string
format: email
description: Can be null
reference:
type: string
enum:
- recommendation
- facebook
- linkedin
- instragram
- university
- google
- other
example: google
other_reference:
type: string
example: TikTok
user_id:
type: integer
format: int64
description: FKey to User
AcademicInfo:
type: object
properties:
software_devel_comments:
type: string
description: Textarea - lots of text
degree_level:
type: string
enum:
- highschool
- incomplete_university
- university
- masters
- incomplete_masters
- phd
- incomplete_phd
- none
- other
informal_education:
type: string
description: only if none is selected on degree_level
other_education:
type: string
description: only if other is selected on degree_level
user_id:
type: integer
format: int64
description: FKey to User
FormalEducationInfo:
type: object
properties:
university_name:
type: string
example: UAQ
state:
type: string
country:
type: string
career_name:
type: string
example: Computers Science
classes_completed:
type: boolean
proof_classes_completed:
type: string
contentMediaType: image/png, image/jpg, application/pdf
contentEncoding: base64
degree_completed:
type: boolean
proof_degree_completed:
type: string
contentMediaType: image/png, image/jpg, application/pdf
contentEncoding: base64
license_completed:
type: boolean
proof_license_completed:
type: string
contentMediaType: image/png, image/jpg, application/pdf
contentEncoding: base64
user_id:
type: integer
format: int64
description: FKey to User
ScholarshipInfo:
type: object
properties:
level:
type: string
enum:
- highschool
- university
- masters
- phd
kind:
type: string
enum:
- academics
- sports
- government
period:
type: number
format: int64
description: Duration of the scholarship in months
example: 5
user_id:
type: integer
format: int64
description: FKey to User
BankAccountInfo:
type: object
properties:
acc_number:
type: number
example: 12912819281
clabe:
type: number
example: 01923012930129301293
description: Mexican bank-related number
bank:
type: string
description: All the mexican banks
enum:
- BBVA
- etc
user_id:
type: integer
format: int64
description: FKey to User
Skills:
type: object
properties:
preferred_programming_language:
type: string
example: Javascript
experience:
type: string
enum:
- less_than_three
- three_to_six
- six_to_twelve
- more_than_twelve
disability:
type: string
enum:
- motor
- auditory
- visual
- null
user_id:
type: integer
format: int64
description: FKey to User
User:
type: object
properties:
id:
type: integer
format: int64
example: 10
username:
type: string
example: theUser
firstName:
type: string
example: John
lastName:
type: string
example: James
email:
type: string
example: john@email.com
phone:
type: string
example: '12345'
ApiResponse:
type: object
properties:
code:
type: integer
format: int32
type:
type: string
message:
type: string
requestBodies:
UserArray:
description: List of user object
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment