Java API MVC With Postgres - Extension Criteria (0.2.3)

Download OpenAPI specification:Download

Extension API for Java API with Postgres Exercise

employees

Create a new employee

Add a new employee to our list of available employees

Request Body schema: application/json
name
required
string
jobName
required
string
salaryGrade
required
string
department
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Dave Ames",
  • "jobName": "Java Developer",
  • "salaryGrade": "8",
  • "department": "Software Development"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "jobName": "Java Developer",
  • "salaryGrade": "8",
  • "department": "Software Development"
}

Get all employees

Get all of the employees from our list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get an employee

Get an employee by ID

path Parameters
id
required
integer

The ID of the employee to get

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "jobName": "Java Developer",
  • "salaryGrade": "8",
  • "department": "Software Development"
}

Update an employee

Update an existing employee by ID

path Parameters
id
required
integer

The ID of the employee to update

Request Body schema: application/json
name
required
string
jobName
required
string
salaryGrade
required
string
department
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Dave Ames",
  • "jobName": "Java Developer",
  • "salaryGrade": "8",
  • "department": "Software Development"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "jobName": "Java Developer",
  • "salaryGrade": "8",
  • "department": "Software Development"
}

Delete an employee

Remove an employee from our list of employees

path Parameters
id
required
integer

The ID of the employee to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "jobName": "Java Developer",
  • "salaryGrade": "8",
  • "department": "Software Development"
}

salaries

Create a new salary grade

Add a new salary grade to our list of available salary grades

Request Body schema: application/json
grade
required
string
minSalary
required
integer
maxSalary
required
integer

Responses

Request samples

Content type
application/json
{
  • "grade": "8",
  • "minSalary": 25000,
  • "maxSalary": 30000
}

Response samples

Content type
application/json
{
  • "grade": "8",
  • "minSalary": 25000,
  • "maxSalary": 30000
}

Get all salary grades

Get all of the salary grades from our list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a salary grade

Get a salary grade by ID

path Parameters
id
required
integer

The ID of the salary grade to get

Responses

Response samples

Content type
application/json
{
  • "grade": "8",
  • "minSalary": 25000,
  • "maxSalary": 30000
}

Update a salary grade

Update an existing salary grade by ID

path Parameters
id
required
integer

The ID of the salary grade to update

Request Body schema: application/json
grade
required
string
minSalary
required
integer
maxSalary
required
integer

Responses

Request samples

Content type
application/json
{
  • "grade": "8",
  • "minSalary": 25000,
  • "maxSalary": 30000
}

Response samples

Content type
application/json
{
  • "grade": "8",
  • "minSalary": 25000,
  • "maxSalary": 30000
}

Delete a salary grade

Remove a salary grade from our list of salary grades

path Parameters
id
required
integer

The ID of the salary grade to delete

Responses

Response samples

Content type
application/json
{
  • "grade": "8",
  • "minSalary": 25000,
  • "maxSalary": 30000
}

departments

Create a new department

Add a new department to our list of available departments

Request Body schema: application/json
name
required
string
location
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Software Development",
  • "location": "Manchester, UK"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Software Development",
  • "location": "Manchester, UK"
}

Get all departments

Get all of the departments from our list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a department

Get a department by ID

path Parameters
id
required
integer

The ID of the department to get

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Software Development",
  • "location": "Manchester, UK"
}

Update a department

Update an existing department by ID

path Parameters
id
required
integer

The ID of the department to update

Request Body schema: application/json
name
required
string
location
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Software Development",
  • "location": "Manchester, UK"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Software Development",
  • "location": "Manchester, UK"
}

Delete a department

Remove a department from our list of departments

path Parameters
id
required
integer

The ID of the department to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Software Development",
  • "location": "Manchester, UK"
}