OpenAPI specification activity: Create your own specification document

Activity

The OpenAPI tutorial walked you through 8 steps in building the OpenAPI specification document. Now it’s your turn to practice building out an OpenAPI specification document on your own.

Identify an API

First, find an API that’s relatively simple. If you’re already documenting an API for your work, by all means use that API. But if you’re just taking this course to learn general API documentation, try creating an OpenAPI specification document for this simple Sunrise and sunset times API. This API doesn’t require authentication with requests, so it removes some of the more complicated authentication workflows.

Depending on the API you choose to work with, you could potentially use this specification document as part of your portfolio.

Follow the OpenAPI tutorial

Go each step of the OpenAPI specification tutorial to build out the specification document:

Make sure your spec validates

Validate your specification document in the Swagger Editor. Execute a request to make sure it’s working correctly.

Check your spec against mine

If you get stuck or want to compare your spec with mine, see openapi_sunrise_sunset.yml.

Note that the Sunrise and sunset times API doesn’t require authorization, so you can skip Step 6: security object.

You can use this OpenAPI specification document when working through the Swagger UI activity.

Get new posts delivered straight to your inbox.

Subscriber count: 4,285