<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Paul B.</title>
    <description>The latest articles on DEV Community by Paul B. (@paulrbr).</description>
    <link>https://dev.to/paulrbr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F619042%2Fc97b0d1d-7b61-461f-a7f5-d336d44a106e.jpeg</url>
      <title>DEV Community: Paul B.</title>
      <link>https://dev.to/paulrbr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paulrbr"/>
    <language>en</language>
    <item>
      <title>Bump diff, the missing piece for an API “design-first” approach</title>
      <dc:creator>Paul B.</dc:creator>
      <pubDate>Wed, 07 Jul 2021 08:55:21 +0000</pubDate>
      <link>https://dev.to/bump/bump-diff-the-missing-piece-for-an-api-design-first-approach-2756</link>
      <guid>https://dev.to/bump/bump-diff-the-missing-piece-for-an-api-design-first-approach-2756</guid>
      <description>&lt;p&gt;While building APIs, are you more of a &lt;strong&gt;design-first&lt;/strong&gt; or a &lt;strong&gt;code-first&lt;/strong&gt; type of person? The former approach is usually done when designing APIs for clients, while the latter one is usually used for internal APIs.&lt;/p&gt;

&lt;p&gt;At Bump we like to focus on design-first APIs because we think an API - be it RESTful, Messaging, GraphQL, … - needs more love during its design phase. This is why we have improved our tools to go in that direction.&lt;/p&gt;

&lt;p&gt;By focusing on the API contract first, we step into the shoes of API consumers. And it is a great way to make sure we build consumer-friendly APIs. Thus making the API clearer, easier to use, and improving its adoptability.&lt;/p&gt;

&lt;p&gt;However, until today, we had one missing piece to offer a good design-first approach for our users. Read on for some good news if you are a “design-first” person or &lt;em&gt;maybe&lt;/em&gt; a good argument to convince you to become one 😊&lt;/p&gt;

&lt;h2&gt;
  
  
  API contract development
&lt;/h2&gt;

&lt;p&gt;For clarity we will focus on a tiny &lt;a href="https://demo.bump.sh/doc/users-account"&gt;API from our demo train company&lt;/a&gt; which retrieves the current logged-in users account details. It’s made up of a single &lt;code&gt;GET /account&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;Now, imagine you want to change the API to add a list of tickets in the user details, and also want to add a new endpoint to be able to fetch a specific ticket. The changes are easily described in human words, but &lt;strong&gt;what does it represent from your API contract point of view?&lt;/strong&gt; You will modify the JSON or YAML contract  with your favorite tool, but now what? &lt;code&gt;git diff&lt;/code&gt; will probably be a bit hard to read…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is where our &lt;a href="https://www.npmjs.com/package/bump-cli#bump-diff-file"&gt;new &lt;code&gt;bump diff&lt;/code&gt; command&lt;/a&gt; comes into play.&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Make sure to upgrade your &lt;code&gt;bump-cli&lt;/code&gt; package to at least &lt;a href="https://github.com/bump-sh/cli/releases/tag/v2.1.0"&gt;&lt;code&gt;v2.1.0&lt;/code&gt;&lt;/a&gt; to test it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Straight from your CLI, you are now able to describe the changes made in your contract:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; bump diff &lt;span class="nt"&gt;--doc&lt;/span&gt; users-account api-specification.yaml
Updated: GET /account
  Response modified: 200
    Body attribute added: ticket_ids
Added: GET /tickets/&lt;span class="o"&gt;{&lt;/span&gt;ticket_id&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new command will output a quick summary of what has changed between your latest deployed API contract and the one you have changed locally.&lt;/p&gt;

&lt;p&gt;If you need more context, with a visual diff for instance, you can even use the &lt;code&gt;--open&lt;/code&gt; flag to open the diff directly in your browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; bump diff &lt;span class="nt"&gt;--open&lt;/span&gt; &lt;span class="nt"&gt;--doc&lt;/span&gt; users-account api-specification.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command will return the diff summary and &lt;strong&gt;&lt;a href="https://demo.bump.sh/doc/users-account/changes/1fa5b84c-e304-4188-abaf-a71ab54d61eb"&gt;open this documentation diff in your browser&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---ITquNrU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://storage.googleapis.com/bump-blog-resources/building-api/bump-diff-users-account-framed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---ITquNrU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://storage.googleapis.com/bump-blog-resources/building-api/bump-diff-users-account-framed.png" alt="Bump visual diff of users API" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Collaborating on API design
&lt;/h2&gt;

&lt;p&gt;So, you have made some changes to the contract locally but now you want to receive suggestions and reviews from your team. It’s a good time to open a pull request.&lt;/p&gt;

&lt;p&gt;If you use &lt;a href="https://github.com/features/actions"&gt;Github Actions&lt;/a&gt; to launch your automation workflows, we have some more good news for you: &lt;strong&gt;we now offer a stable &lt;code&gt;bump-sh/github-action@v1&lt;/code&gt; action&lt;/strong&gt;. And &lt;a href="https://github.com/bump-sh/github-action/releases/tag/v1.0.0"&gt;this release&lt;/a&gt; includes &lt;strong&gt;automatic API contract changelog pushed as a comment for each pull request&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_SkPhUA1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://storage.googleapis.com/bump-blog-resources/building-api/bump-diff-in-PRs-framed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_SkPhUA1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://storage.googleapis.com/bump-blog-resources/building-api/bump-diff-in-PRs-framed.png" alt="Bump diff inside a PR timeline" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your team can now directly discuss on the pull request and suggest improvements by reading the diff summary without needing to dig into the JSON diff - which you’ll have to admit is a PITA to read 😅 -. If you update the contract again, the initial comment will be updated accordingly.&lt;/p&gt;

&lt;p&gt;We find this bot comment really useful because it helps the team to jump in API design decisions quickly without having to step into a full code review. And it’s a win-win situation, because the person implementing the changes doesn’t have to focus on the code directly to receive quick feedback.&lt;/p&gt;

&lt;h2&gt;
  
  
  More to come soon
&lt;/h2&gt;

&lt;p&gt;If you are still unsure whether you want to work with a design-first or code-first approach when building your APIs here are two good reads from the community:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;A design-first &lt;a href="https://www.asyncapi.com/blog/designing_your_apis_with_asyncapi_part_1#designing-the-apis-with-asyncapi"&gt;example from the AsyncAPI community&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;a comparison of both methods &lt;a href="https://blog.restcase.com/api-development-with-design-first-approach/"&gt;from the OpenAPI community&lt;/a&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regarding our two novelties, if you want to try them, you can visit our dedicated help pages or &lt;a href="//mailto:hello@bump.sh"&gt;contact us&lt;/a&gt; anytime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://help.bump.sh/bump-cli#validate-the-documentation-file-"&gt;Help page for the new &lt;code&gt;bump diff&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://help.bump.sh/continuous-integration/github-actions#api-diff-on-pull-requests"&gt;Setting up API diff on pull requests with our Github Action&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will soon see some more improvements, on the way we display diff summaries, helping you identify breaking changes by warning the reviewers or even break the Continuous Integration checks if you desire… So stay tuned.&lt;br&gt;
Until then we will continue to work on one of our initial mission: &lt;a href="https://twitter.com/bump_hq/status/1083402953422196743/photo/1"&gt;“Git diff, for your APIs”&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have fun, stay free and stay kind.&lt;/p&gt;

&lt;p&gt;✨&lt;/p&gt;

</description>
      <category>api</category>
      <category>apidesign</category>
      <category>openapi</category>
      <category>asyncapi</category>
    </item>
    <item>
      <title>Playing with Twilio's OpenAPI specifications</title>
      <dc:creator>Paul B.</dc:creator>
      <pubDate>Thu, 22 Apr 2021 12:46:47 +0000</pubDate>
      <link>https://dev.to/bump/playing-with-twilio-s-openapi-specifications-552n</link>
      <guid>https://dev.to/bump/playing-with-twilio-s-openapi-specifications-552n</guid>
      <description>&lt;p&gt;This week, &lt;a href="https://www.twilio.com/blog/introducing-twilio-open-api-specification-beta" rel="noopener noreferrer"&gt;Twilio published OpenAPI definitions&lt;/a&gt; for all of their APIs. Let's see together the small steps we can take to transform those definitions into a nice looking API Reference documentation page which tracks API changes automatically.&lt;/p&gt;

&lt;p&gt;If you wonder what Twilio is, here's a paragraph taken from their about page:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Twilio has democratized communications channels like voice, text, chat, video, and email by virtualizing the world’s communications infrastructure through APIs that are simple enough for any developer to use, yet robust enough to power the world’s most demanding applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Note: this is an experiment demonstration which is not endorsed, nor affiliated by, the Twilio company.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Definition files hierarchy
&lt;/h2&gt;

&lt;p&gt;First let's take a look at &lt;a href="https://github.com/twilio/twilio-oai" rel="noopener noreferrer"&gt;the repository with their published files&lt;/a&gt;. The OpenAPI definition files are available in the &lt;code&gt;spec/&lt;/code&gt; folder in both JSON or YAML formats. Here's a sneak peek of some of the JSON files available:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;spec/
└── json/
    ├── twilio_accounts_v1.json
    ├── twilio_chat_v2.json
    ├── twilio_conversations_v1.json
    ├── twilio_events_v1.json
    ├── twilio_fax_v1.json
    ├── twilio_messaging_v1.json
    ├── twilio_notify_v1.json
    ├── twilio_numbers_v2.json
    ├── twilio_verify_v2.json
    ├── twilio_video_v1.json
    ├── twilio_voice_v1.json
    └── …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;At first glance we can imagine a quick way of generating the documentation pages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  For each file from the available &lt;code&gt;*.json&lt;/code&gt; files

&lt;ul&gt;
&lt;li&gt;  Extract the API name from filename &lt;code&gt;twilio_&amp;lt;api_name&amp;gt;_vN.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  Create documentation &lt;code&gt;api_name&lt;/code&gt; from the api definition file &lt;code&gt;twilio_&amp;lt;api_name&amp;gt;_vN.json&lt;/code&gt; within a &lt;a href="https://bump.sh/#hubs" rel="noopener noreferrer"&gt;single Hub&lt;/a&gt; named Twilio&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;  Enjoy the result and customise the UI!&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Automatically publish the documentation on changes
&lt;/h2&gt;

&lt;p&gt;In order to demonstrate the magic on each commit I've forked their repository &lt;a href="https://github.com/paulRbr/twilio-oai" rel="noopener noreferrer"&gt;on my Github namespace&lt;/a&gt; where I will be able to push to my &lt;code&gt;main&lt;/code&gt; branch and use Github Actions on my fork.&lt;/p&gt;

&lt;p&gt;Now let's write a tiny shell script &lt;em&gt;- Don't worry it's only an experiment -&lt;/em&gt; which will do what we imagined in the previous paragraph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env sh&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-eu&lt;/span&gt;

&lt;span class="c"&gt;# Install bump-cli (published as a Ruby gem)&lt;/span&gt;
gem &lt;span class="nb"&gt;install &lt;/span&gt;bump-cli

&lt;span class="c"&gt;# For each file from the available `*.json` files&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;api &lt;span class="k"&gt;in &lt;/span&gt;spec/json/&lt;span class="k"&gt;*&lt;/span&gt;.json&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="c"&gt;# Extract the API name from filename `twilio_&amp;lt;api_name&amp;gt;_vN.json`&lt;/span&gt;
    &lt;span class="nv"&gt;apiName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;api&lt;/span&gt;&lt;span class="p"&gt;%_*&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="c"&gt;# remove everything after the last '_'&lt;/span&gt;
    &lt;span class="nv"&gt;apiName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;apiName&lt;/span&gt;&lt;span class="p"&gt;#*_&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="c"&gt;# remove everything before the first '_'&lt;/span&gt;

    &lt;span class="c"&gt;# Auto-create documentation &amp;lt;apiName&amp;gt; from the api definition file&lt;/span&gt;
    &lt;span class="c"&gt;# in the 'twilio' hub&lt;/span&gt;
    bump deploy &lt;span class="se"&gt;\&lt;/span&gt;
      &lt;span class="nt"&gt;--doc&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;apiName&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--token&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;BUMP_TOKEN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
      &lt;span class="nt"&gt;--hub&lt;/span&gt; twilio &lt;span class="nt"&gt;--auto-create&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
      &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;api&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;bump deploy&lt;/code&gt; command is where all the magic happens: it will push the api definition file to generate its documentation on Bump. By passing the &lt;code&gt;--auto-create&lt;/code&gt; flag together with the &lt;code&gt;--hub twilio&lt;/code&gt; and &lt;code&gt;--doc ${apiName}&lt;/code&gt; flags we are going to &lt;strong&gt;create&lt;/strong&gt; a documentation called &lt;code&gt;${apiName}&lt;/code&gt; &lt;strong&gt;if it doesn't exist&lt;/strong&gt;. On all future changes of the definition files, it will simply be &lt;strong&gt;updated&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And now the Github Action workflow to use the script above on each commit of the &lt;code&gt;main&lt;/code&gt; branch of our git repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy twilio API documentations on Bump&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;deploy-doc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ruby/setup-ruby@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ruby-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2.7&lt;/span&gt;
          &lt;span class="na"&gt;bundler-cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sh ./.github/scripts/deploy-all.sh&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;BUMP_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.BUMP_TOKEN }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are almost there! You might notice we are using a &lt;code&gt;secrets.BUMP_TOKEN&lt;/code&gt; variable which needs to be added in the settings of my Github repository. Let's get our hub access token from Bump.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Twilio hub page on Bump.sh
&lt;/h2&gt;

&lt;p&gt;OK let's leave the terminal and head to my &lt;a href="https://bump.sh/docs" rel="noopener noreferrer"&gt;Bump.sh&lt;/a&gt; account in order to &lt;a href="https://bump.sh/blog/organize-your-api-documentation-with-bump-hubs#creating-a-hub" rel="noopener noreferrer"&gt;create the hub&lt;/a&gt;. I'm headed to &lt;a href="https://bump.sh/hubs/new" rel="noopener noreferrer"&gt;bump.sh/hubs/new&lt;/a&gt; to do so.&lt;/p&gt;

&lt;p&gt;Now my hub is created, I can retrieve my &lt;code&gt;hub token&lt;/code&gt; from my hub &lt;code&gt;Settings &amp;gt; CI deployment&lt;/code&gt;  page&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub-token.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub-token.png" title="Hub token for CI deployments"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And adding the token to my Github repository secrets at the following location: &lt;a href="https://github.com/paulRbr/twilio-oai/settings/secrets/actions" rel="noopener noreferrer"&gt;https://github.com/paulRbr/twilio-oai/settings/secrets/actions&lt;/a&gt; &lt;em&gt;(Don't forget to change your project namespace in the URL if you're trying it out)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Fgithub-repository-secrets-bump-token.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Fgithub-repository-secrets-bump-token.png" title="Github  raw `secrets.BUMP_TOKEN` endraw "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are now ready to push our two files &lt;em&gt;- the sh script and the Github Action workflow -&lt;/em&gt; of the previous paragraph.&lt;/p&gt;

&lt;p&gt;Shall we try to &lt;code&gt;git push origin main&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Fgithub-action-twilio-deploy-all.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Fgithub-action-twilio-deploy-all.png" title="Github Action publish API documentation on Bump.sh"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screenshot above shows the &lt;a href="https://github.com/paulRbr/twilio-oai/actions/runs/766705170" rel="noopener noreferrer"&gt;Github Action logs that ran successfully&lt;/a&gt; on my &lt;code&gt;main&lt;/code&gt; branch after pushing. We can see everything seems to have worked as expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refining the resulting Twilio API reference hub
&lt;/h2&gt;

&lt;p&gt;It's live! &lt;a href="https://bump.sh/hub/twilio/" rel="noopener noreferrer"&gt;https://bump.sh/hub/twilio/&lt;/a&gt; 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub.png" title="Twilio API reference Hub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result is already pretty nice. We can browse each API documentation and have a good overview of what Twilio's API can offer. Let's see what we can change on Bump and in Twilio's definition files to make it even better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Grouping by categories and UI customisation
&lt;/h2&gt;

&lt;p&gt;Here are some of the configuration option I changed in my hub settings page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the grouping mode of API docs to “by category” from the hub &lt;code&gt;Settings &amp;gt; Customize UI&lt;/code&gt; page&lt;/li&gt;
&lt;li&gt;Adding a category to each documentation from their respective &lt;code&gt;Settings &amp;gt; Hubs settings&lt;/code&gt; page

&lt;ul&gt;
&lt;li&gt;Moving the main &lt;code&gt;api&lt;/code&gt; documentation into a dedicated category called &lt;strong&gt;“Main”&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Moving all docs containing the word &lt;code&gt;TODO:&lt;/code&gt; into a dedicated &lt;strong&gt;“Todo”&lt;/strong&gt; category (Might be useful for the Twilio dev team to track which api definition files needs attention)&lt;/li&gt;
&lt;li&gt;Moving all tools related docs into a category &lt;strong&gt;“Tools”&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;All the other docs will land in a category that I named &lt;strong&gt;“Uncategorized”&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Changing the hub defaults from the &lt;code&gt;Default settings&lt;/code&gt; page, which will apply to all documentations of that hub

&lt;ul&gt;
&lt;li&gt;Uploading Twilio's logo&lt;/li&gt;
&lt;li&gt;Change the color scheme to red&lt;/li&gt;
&lt;li&gt;Change default navigation to &lt;code&gt;Groups and operations with verbs&lt;/code&gt; to display all API operations with their associated HTTP verb in the navigation bar of each documentation page&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub-customized.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub-customized.png" title="Twilio API reference Hub customized"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating the api definition files
&lt;/h2&gt;

&lt;p&gt;Now the hub is looking all good. We can get back to API definitions in our favorite text editor.&lt;/p&gt;

&lt;p&gt;To demonstrate the automatic documentation updates I have &lt;a href="https://github.com/paulRbr/twilio-oai/commit/02bb6c99721372e1516b8c1fc1ce4594ece23814" rel="noopener noreferrer"&gt;commited some changes&lt;/a&gt; on all API &lt;code&gt;*.json&lt;/code&gt; files. The goal was to change their &lt;code&gt;description&lt;/code&gt; fields and mark all docs as “unofficial” to not confuse end-users.&lt;/p&gt;

&lt;p&gt;After 1min our Github Action workflow reports &lt;a href="https://github.com/paulRbr/twilio-oai/runs/2401968115" rel="noopener noreferrer"&gt;a successful run&lt;/a&gt;. Meaning our hub and all subsequent documenation pages have been updated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://bump.sh/hub/twilio/" rel="noopener noreferrer"&gt;https://bump.sh/hub/twilio/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub-final.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fbump-blog-resources%2Ftwilio-hub%2Ftwilio-hub-final.png" title="Twilio API reference Hub final"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's about it. If you have a set of different APIs and need a centralised public page for your docs Bump can help you out. &lt;a href="https://bump.sh/users/sign_in" rel="noopener noreferrer"&gt;Give it a try&lt;/a&gt; and &lt;a href="//mailto:hello@bump.sh"&gt;let us know&lt;/a&gt; what you think or how we can improve to better fit your needs.&lt;/p&gt;

&lt;p&gt;Have fun, stay free and stay kind.&lt;/p&gt;

&lt;p&gt;✨&lt;/p&gt;

</description>
      <category>experiment</category>
      <category>openapi</category>
      <category>documentation</category>
    </item>
  </channel>
</rss>
