To allow you to carry out these adjustment, the swagger.yml file from Part 1 will have to be modifiedStaff
Here’s what the above signal does:
Contours 1 – 9 significance some Flask modules to generate the REST API feedback, and additionally importing the db case from the config.py module. And also, it imports the SQLAlchemy individual and Marshmallow PersonSchema courses to view the individual database table and serialize the outcome.
Line 11 initiate the definition of read_all() that reacts into SLEEP API Address endpoint attain /api/people and returns all of the records inside the people database dining table arranged in ascending order by latest name.
Outlines 19 – 22 tell SQLAlchemy to question anyone databases desk for all your information, type them in ascending order (the standard sorting order), and get back a summary of people Python objects given that varying everyone . […]