Java API - MVC, JPA and Hibernate Part 1 Workshop - Extension Criteria (0.2.4)

Download OpenAPI specification:Download

Extension Criteria for Java, MVC, JPA and Hibernate Workshop

teachers

Create a new teacher

Create a new teacher and add them to the list

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

Responses

Request samples

Content type
application/json
{
  • "name": "Dave Ames",
  • "location": "Lancashire",
  • "subject": "Java",
  • "email": "dave@dave.com"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "location": "Lancashire",
  • "subject": "Java",
  • "email": "dave@dave.com"
}

Get all teachers

Get all of the teachers from the list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a teacher

Get a teacher by ID

path Parameters
id
required
integer

The ID of the teacher to get

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "location": "Lancashire",
  • "subject": "Java",
  • "email": "dave@dave.com"
}

Update a teacher

Update the teacher with the given id in the list

path Parameters
id
required
integer

The ID of the teacher to update

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

Responses

Request samples

Content type
application/json
{
  • "name": "Dave Ames",
  • "location": "Lancashire",
  • "subject": "Java",
  • "email": "dave@dave.com"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "location": "Lancashire",
  • "subject": "Java",
  • "email": "dave@dave.com"
}

Delete a teacher

Delete the teacher with the given id from the list and return their details

path Parameters
id
required
integer

The ID of the teacher to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Dave Ames",
  • "location": "Lancashire",
  • "subject": "Java",
  • "email": "dave@dave.com"
}

subjects

Create a new subject

Create a new subject and add it to the list

Request Body schema: application/json
id
integer
title
required
string
level
required
string

Responses

Request samples

Content type
application/json
{
  • "id": 1,
  • "title": "Mathematics",
  • "level": "Level 3"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Mathematics",
  • "level": "Level 3"
}

Get all subjects

Get all of the subjects from the list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a subject

Get a subject by ID

path Parameters
id
required
integer

The ID of the subject to get

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Mathematics",
  • "level": "Level 3"
}

Update a subject

Update the subject with the given id in the list

path Parameters
id
required
integer

The ID of the subject to update

Request Body schema: application/json
id
integer
title
required
string
level
required
string

Responses

Request samples

Content type
application/json
{
  • "id": 1,
  • "title": "Mathematics",
  • "level": "Level 3"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Mathematics",
  • "level": "Level 3"
}

Delete a subject

Delete the subject with the given id from the list and return their details

path Parameters
id
required
integer

The ID of the subject to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Mathematics",
  • "level": "Level 3"
}