So far, we have seen about defining the operations for the causes, but we have seen various operations
for causes and then causes Cosini the damage to the individual cause and finally causes a slash cause
it slash students.
They refer to the students of an individual cause as a next step.
Let us go ahead and define the list of operations for the students, but.
As you might have guessed, the definition of the students is going to be quite similar to that of the
courses, if you go and expand our current courses and its corresponding collections, we have the summary
description and along with the get and post operation, notice that we don't have the undelete operation
for this specific part because the courses part refers to the collection of courses.
So as for the recommended approach, for this specific part, we get one leader get an post operation
and as now go on and implement similarly for the students.
But in order to find the new path, we enter the park as slash students.
This is going to haunt us the all the operations for the students.
But next, just like the courses where we had the summary and description and as add the similar way
for the students.
First, we will start with the summary.
Since we are going to deal with students, we give the summary as operations about students.
Next, we go out and add the description for this newly added part description, followed by the description
for this specific.
But let me give the description as contains the list of operations update on students.
Next, we cannot go out and define the first operation for this specific part, namely get in order
to implement the get, we used the key word get.
First, we have attacks since we want to add a student back for this, we use the key word student.
This is a bag that we have added before.
If you go back and expand our tech section, we have noticed that we have added the student as one of
the tags before, and the same is being referred in this specific.
But so we can go in and minimize attacks and causes and we have the back section being defined the next
we need to go and give somebody
like me.
You'd get all the students next can give a description, which is an optional parameter.
It is going to return the list of all students present in the system.
Next, we have to give an operation for this specific operation for the specific, but it will give
the operation ideas, simply get students, because we are going to get all the students present in
the system and the next section is going to be the responses.
Notice that we have not included the request body for this specific operation because for the get operation,
we don't require any parameter to be passed.
Hence we don't have the parameters as well as the requested body for this specific operation, for the
response section.
Let us go and define the status quo.
Two hundred and various responses for four and five response codes to begin with will define first for
the 200 quo.
For this, we first enter the status code.
Value has 200, followed by the definition for this specific responses.
The first is going to be a description followed by the content.
In our case, we can give the description as successfully.
All student entries.
Next, we need to define the content that is going to be returned when we call this particular EPA operation,
in our case, we need to return an array of student hands.
Let's go and define the content for this specific response.
Body content.
In our case, the content is going to be applications.
Jason?
Next, we need to define the schema under this.
Here we have again, two options, either we can go and define the student type again or we can go ahead
and reuse from the component sections.
In one of the past video, we had defined the student type under the component sections.
If you now go in and expand the components and within that schemas we have a course type define as well
as the student type defined so we can now word and reuse this student reference within the schema.
In order to reference these components inside the schema, we have to use the keyword ref.
Once you do this, then it's going to show us the only time which is defined under the components followed
by the ski mask, but in our case we are interested in the student.
Hence we go in and select the student from this dropdown list, which shows that our current response
is going to return a single student.
However, since our operation is about get for the students collection, it has to be an array.
Hence we can go and tweak the schema in order to return an array to make it return an array.
We need to mention the type as three and then it has to be followed by the list of items.
In our case, these items are the individual student.
This completes the response code 200.
If you go back and scroll the UI, we have this student collection that has been added as part of the
tags.
Once we expand this, we can see the new method, namely get implemented for this particular part.
In our case, the box is students.
This operation get is going to return all the students that is present in our system.
Once we expand this, we can see the various parameters that is defined for this specific operation.
Once we scroll down a bit further, we can see the response section.
So far we have defined just one status code that is two hundred.
It is going to successfully return all student entries, the type as application, Jason.
And we have a schema and discuss, for example, value that has been defined from the component section.
Next, we can go in and implement Mostert as code for this operation for completeness, its goal and
implement for four and five six.
Again, since we have defined these four execs and five execs under the component sections, we are
going to directly reference it.
If you go back to the components responses section, we have defined the four execs response and five
execs response.
So we go back to the section and then again use the keyword ref in order to reference this.
In this specific operation, we then use for execs response.
Similarly, we go and define five execs.
Reduce fight response from the Dromgoole, if you know, scroll back in our documentation, Yuya, we
can see two new sections added for and fight with for the request on internal server, respectively.
And this completes the definition for the responses.
Also, this completes the definition of the git operation for the student election.