Demo: enforcing the Shop API style guide
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
write the guide and bring the API into line. Prepares JNR-020-LAB1.
Draft outline details
Step by step
- Write a one-page style guide: naming, money, dates, enums, errors, paging, filtering, versioning.
- Audit all endpoints in a table: rule, endpoint, pass or fail.
- Fix the failures: rename fields, switch prices to cents, use ISO dates.
- Planned mistake: a price returned as
19.99(double). Fix:priceCents: 1999, then update tests. - Add
category,minPrice, andmaxPricefilters toGET /productsand test them.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.