Solution for Chapter 3: Modeling APIs

Design and Build Great Web APIs — by Mike Amundsen (114 / 127)

The Pragmatic Programmers
The Pragmatic Programmers
3 min readApr 28, 2021

--

👈 2: HTTP, REST, and APIs | TOC | 4: g APIs 👉

In the Chapter Exercise, we introduced the related CreditCheck service. This will be used to check the creditworthiness of our new on-boarded customers.

The specific task is to create the credit-check-workflow.txt document. By inspecting the credit-check-story.md and credit-check-story.pdf documents in the code download for this chapter, you should be able to come up with a simple workflow that captures the CreditCheck service.

Updating the Credit-Check-Workflow Document

To make this a bit easier, you have a partially completed credit-check-workflow.txt document to start with. It has two steps in the flow already named (Home and CreditCheckForm) and two steps identified but not named (Action1??? and Action2???). By reading through the story you should be able to come up with the two remaining steps that aren’t in the workflow document.

The two unnamed workflow actions are CreditCheckHistory and CreditCheckItem. When you update your document, it should look like this:

Saving the Documents to the assets Folder

After saving the updated document (credit-check-workflow.txt), copy that document and the others for this solution (credit-check-story.md and credit-check-form.pdf) into a subfolder of the onboarding project (onboarding/assets). Your folder should now look like this:

Updating the Project with Git

The final step is to commit these changes to the project using Git:

👈 2: HTTP, REST, and APIs | TOC | 4: g APIs 👉

Design and Build Great Web APIs by Mike Amundsen can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

Unlisted

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.