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

Download OpenAPI specification:Download

Core Criteria for Java API JPA 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"
}