BT

InfoQ Homepage News GitHub's OpenAPI Spec Open-Sourced in Beta

GitHub's OpenAPI Spec Open-Sourced in Beta

Bookmarks

GitHub has open sourced an OpenAPI description of its API. Aimed to allow developers to discover the API capabilities first-hand, GitHub's OpenAPI also enables the programmatic creation of mock servers, test suites, and language bindings.

According to GitHub, its OpenAPI description contains more than 600 operations that can be explored using a Postman Collection. Two formats are provided: a bundled version which is easier to read and use, and a dereferenced version for tools that have poor support for inline references to components. The bundled version is based on OpenAPI Components, which use the JSON Reference specification to bundle together multiple files into a unique, coherent entity, which makes reuse and collaboration easier.

Describing a 12-year-old API is no easy task. We’ve built this description using a mix of existing JSON schemas, documented examples, contract testing, and love. We expect to make the description even more complete and accurate as we go forward and as OpenAPI becomes central to our developer experience — internally and externally.

GitHub used a few custom extensions to the standard to model concepts that are not a good fit with OpenAPI components. Such extensions are used to handle additional data, including a displayName, and custom information required by OctoKit.

Once you have imported GitHub's OpenAPI into Postman, you can easily browse all available operations and send request to GitHub REST API, as the image below shows for a specific case:

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic way of describing HTTP APIs. It serves both as a contract between API provider and API consumer, as well as single source of truth. One of the advantages granted by an OpenAPI spec is enabling front-end and back-end developers to work independently by relying on an automatically generate API mockup.

GitHub plans to make releases available on a quarterly basis for GitHub Enterprise Server and GitHub Private Instances, and more frequently for the public facing github.com API.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.