Last updated

Project 17: Vendor APIs (URL remote content)

ScheduleFlex Meld
Time allowed3 hours

Update Realm

Update to the latest minor version of Realm.

At the time I write this, it's 0.92.5.

Cheat: How to do this

Edit the package.json and replace the version of Realm with 0.91.5 (or any other latest version).

package.json
 "dependencies": {
    "@redocly/realm": "0.92.5"
  }

It is important to update to the latest version because it fixes a Redoc performance bug.

Challenge accepted

So, maybe you had trouble with the GitHub REST API?

Good news and bad news.

The bad news is the boss is waiting for the vendor APIs to be usable (in particular the GitHub REST API).

The good news is it can be done. You just needed a little guidance.

And in particular, four things to help you:

  1. Update to the latest version 0.92.5.
  2. Write a custom decorator to swap the description and summary for each webhook operation. Why did they get it backwards? Didn't Adam and Roman advise them? 🤔
  3. Write a custom decorator to add a tag to each webhook. Alternatively, you could update to 0.92.6 (an even later version) which adds the tag automatically.
    openapi.yaml snippet example
    tags:
      - Webhooks
    
  4. The boss says GitHub updates their API regularly. And you should use remote content from URL to grab this one.
  5. The boss says GitHub's API has broken links because we're not grabbing corresponding doc pages they link out to from the descriptions. We need to ignore only those so that we don't accidentally break broken links in the other content that we actually control. Your job is to configure Reunite to ignore only the broken links from vendors APIs and not from others or other Markdown pages. As an alternative, the boss said you can fix the links by prepending https://docs.github.com/ to each link. For example, "[Creating a GitHub App](/developers/apps/creating-a-github-app)" would change to "[Creating a GitHub App](https://docs.github.com/developers/apps/creating-a-github-app)" You would need to do this in an automated way using a decorator because the API will update regularly from the remote content source.

Debrief

Debrief on your experience.

  • What made you smile?
  • What did you find confusing?