Question: You are provided with the implementation of the models required for all the APIs. The task is to implement a set of REST services that

You are provided with the implementation of the models required for all the APIs. The task is to implement a set of REST services that exposes the endpoints and allows for filtering and sorting the collection of product records in the following ways:
GET request to/filter/price/{initial_range}/{final_range}:
returns a collection of all products whose price is between the initial and the final range supplied
The response code is 200, and the response body is an array of products in the price range provided.
In case there are no such products return status code 400.
GET request to/sort/price:
returns a collection of all products sorted by their pricing
The response code is 200 and the reppanse body is an array of the product names sorted in ascending ofder of price
Complete the given project so that it passes all the test cases when running the provided unit tests.
Example requests and responses
 You are provided with the implementation of the models required for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!