<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Api-Platform on Coderrob</title><link>https://coderrob.com/tags/api-platform/</link><description>Recent content in Api-Platform on Coderrob</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 20 Feb 2025 22:49:06 -0600</lastBuildDate><atom:link href="https://coderrob.com/tags/api-platform/index.xml" rel="self" type="application/rss+xml"/><item><title>GitHub Actions: GitHub Api Rate Limit Check Action</title><link>https://coderrob.com/posts/github-actions-github-api-rate-limit-check-action/</link><pubDate>Thu, 20 Feb 2025 22:49:06 -0600</pubDate><guid>https://coderrob.com/posts/github-actions-github-api-rate-limit-check-action/</guid><description>&lt;p>GitHub Actions doesn&amp;rsquo;t (seem to?) provide built-in insights into API rate limits, making it difficult to diagnose runtime failures caused by hitting request limits.&lt;/p>
&lt;p>To address this, I created a reusable GitHub Action that proactively logs GitHub current limit, the max limit, and the next reset time in UTC.&lt;/p>
&lt;p>This GitHub Action provides an automated, real-time check of your repository’s GitHub API rate limits, giving you instant visibility into your API consumption. With detailed reporting and proactive alerts, you can prevent unexpected disruptions and optimize API usage in your workflows.&lt;/p></description></item><item><title>Streamlining GitHub Actions Development with Self-Documenting GitHub Actions</title><link>https://coderrob.com/posts/streamlining-github-actions-development-with-self-documenting-github-actions/</link><pubDate>Wed, 05 Feb 2025 08:57:23 -0600</pubDate><guid>https://coderrob.com/posts/streamlining-github-actions-development-with-self-documenting-github-actions/</guid><description>&lt;p>In my recent project, I&amp;rsquo;ve focused on streamlining the development workflow for Cisco Collaboration by migrating thousands of repository build processes to GitHub Actions. This transition has brought numerous benefits in terms of automation and efficiency, but it also presented a challenge &lt;strong>in keeping in-development GitHub Action documentation up-to-date&lt;/strong> and ensuring consistency across all actions.&lt;/p>
&lt;p>One area that became a repetitive drain on productivity was documenting actions, specifically details like inputs, outputs, environment variable usage, and other metadata values of interest. &lt;strong>The lack of consistency was the only consistency&lt;/strong>; every existing and even newly created action had either no documentation, or had its own unique way to document the action.&lt;/p></description></item><item><title>Backstage.io Cisco Webex Scaffolder Backend Plugin</title><link>https://coderrob.com/posts/backstage-plugin-scaffolder-backend-module-webex/</link><pubDate>Mon, 09 Sep 2024 20:35:53 -0500</pubDate><guid>https://coderrob.com/posts/backstage-plugin-scaffolder-backend-module-webex/</guid><description>&lt;p>Looking to integrate Webex messaging in Backstage? The &lt;strong>Webex Module for Backstage Scaffolder&lt;/strong> makes it simple.&lt;/p>
&lt;p>This plugin enables seamless integration with &lt;a href="https://apphub.webex.com/applications/incoming-webhooks-cisco-systems-38054-23307-75252">Webex Incoming Hooks&lt;/a>, allowing you to send messages to one or more spaces within your template actions. Just efficient, automated messaging right from your Backstage workflows.&lt;/p>
&lt;p>Ready to enhance your Webex integrations?&lt;/p>
&lt;p>Check out the &lt;a href="https://www.npmjs.com/package/@coderrob/backstage-plugin-scaffolder-backend-module-webex">&lt;code>@coderrob/backstage-plugin-scaffolder-backend-module-webex&lt;/code>&lt;/a> details and installation guide on &lt;a href="https://www.npmjs.com/package/@coderrob/backstage-plugin-scaffolder-backend-module-webex">NPM&lt;/a>.&lt;/p>
&lt;p>&lt;img src="https://coderrob.com/img/new-backstage-cisco-webex-scaffolder-actions.jpg" alt="Backstage.io Plugins List with the new Webex Module for Backstage Scaffolder">&lt;/p></description></item><item><title>Partial Updates with PATCH: Targeting Only What Needs to Change</title><link>https://coderrob.com/posts/partial-updates-with-patch-targeting-only-what-needs-to-change/</link><pubDate>Sun, 01 Sep 2024 19:01:56 -0500</pubDate><guid>https://coderrob.com/posts/partial-updates-with-patch-targeting-only-what-needs-to-change/</guid><description>&lt;p>When working with RESTful APIs, there are times when you need to update an entire resource, and other times when you only need to tweak a specific part of it.&lt;/p>
&lt;p>This is where the &lt;code>PATCH&lt;/code> method shines. Unlike &lt;code>PUT&lt;/code>, which expects the complete resource object to be sent in the request body, &lt;code>PATCH&lt;/code> is all about making targeted updates.&lt;/p>
&lt;p>You provide the resource’s ID in the URL, and only the properties you want to change in the request body.&lt;/p></description></item><item><title>A Quick Guide to Designing RESTful Endpoints for Your Api</title><link>https://coderrob.com/posts/a-quick-guide-to-designing-restful-endpoints-for-your-api/</link><pubDate>Sun, 01 Sep 2024 16:45:12 -0500</pubDate><guid>https://coderrob.com/posts/a-quick-guide-to-designing-restful-endpoints-for-your-api/</guid><description>&lt;p>Let’s dive into the world of RESTful API design, especially for those of you transitioning from Java or other back-end heavy environments.&lt;/p>
&lt;p>One of the common mistakes I see everyday is naming API endpoints based on the actions they perform, using prefixes like &lt;code>/submitSomething/&lt;/code>, &lt;code>/startSomething/&lt;/code>, &lt;code>/getSomething/&lt;/code>, or &lt;code>/updateSomething/&lt;/code>.&lt;/p>
&lt;p>While this might feel natural for function naming, it’s not the &lt;em>RESTful&lt;/em> way to do things.&lt;/p>
&lt;h3 id="rest-basics-start-with-the-resource">REST Basics: Start with the Resource&lt;/h3>
&lt;p>When designing a RESTful API, everything starts with the &lt;strong>resource&lt;/strong>. If you can name it (think nouns), then it’s probably a resource.&lt;/p></description></item><item><title>Rollup, UUID, and Error Crypto getRandomValues() Not Supported - Solved</title><link>https://coderrob.com/posts/rollup-and-error-crypto-getrandomvalues-not-supported/</link><pubDate>Sat, 24 Aug 2024 00:32:53 -0500</pubDate><guid>https://coderrob.com/posts/rollup-and-error-crypto-getrandomvalues-not-supported/</guid><description>&lt;p>I ran into this error while using Rollup and the &lt;code>uuid&lt;/code> package:&lt;/p>
&lt;p>&lt;code>Error: Crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported&lt;/code>&lt;/p>
&lt;p>The problem? It boiled down to this small mistake in my Rollup config:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-js" data-lang="js">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">// rollup.config.js
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">&lt;/span>plugins: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> nodeResolve({
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> extensions: [&lt;span style="color:#87ceeb">&amp;#39;.ts&amp;#39;&lt;/span>, &lt;span style="color:#87ceeb">&amp;#39;.js&amp;#39;&lt;/span>],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> exportConditions: &lt;span style="color:#87ceeb">&amp;#39;node&amp;#39;&lt;/span>, &lt;span style="color:#0f0">// Wrong: should be an array
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">&lt;/span> }),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#0f0">// Other plugins...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">&lt;/span>],
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The solution was simple. &lt;code>exportConditions&lt;/code> needs an array, not a string:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-js" data-lang="js">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">// rollup.config.js
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">&lt;/span>plugins: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> nodeResolve({
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> extensions: [&lt;span style="color:#87ceeb">&amp;#39;.ts&amp;#39;&lt;/span>, &lt;span style="color:#87ceeb">&amp;#39;.js&amp;#39;&lt;/span>],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> exportConditions: [&lt;span style="color:#87ceeb">&amp;#39;node&amp;#39;&lt;/span>], &lt;span style="color:#0f0">// Fixed: now it&amp;#39;s an array
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">&lt;/span> }),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#0f0">// Other plugins...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0f0">&lt;/span>],
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>TypeScript would&amp;rsquo;ve caught this, but in plain JS, it slipped through. Lesson (re)learned. Always verify.&lt;/p></description></item><item><title>How to Create a Backstage.io Custom Entity Relationship: A Complete Guide</title><link>https://coderrob.com/posts/how-to-create-custom-backstage.io-relationships/</link><pubDate>Thu, 08 Jun 2023 16:38:49 -0500</pubDate><guid>https://coderrob.com/posts/how-to-create-custom-backstage.io-relationships/</guid><description>&lt;p>While working with Backstage.io, you might come across a requirement to create a custom entity relationship. Though the official documentation provides some insights, you may find it too high level. This post offers a practical, step-by-step walkthrough of how to create a custom entity relationship.&lt;/p>
&lt;h2 id="understanding-entity-relationships">Understanding Entity Relationships&lt;/h2>
&lt;p>To start, we must understand what types of relationships we wish to create. Relationships in Backstage.io can be one of two types:&lt;/p></description></item><item><title>Building Better REST APIs: A Hybrid Approach with JSend and JSON:API Guidelines</title><link>https://coderrob.com/posts/building-better-rest-apis/</link><pubDate>Mon, 01 May 2023 18:00:00 -0600</pubDate><guid>https://coderrob.com/posts/building-better-rest-apis/</guid><description>&lt;p>This hybrid API design guide combines elements from both &lt;a href="https://github.com/omniti-labs/jsend">JSend&lt;/a> and &lt;a href="https://jsonapi.org/">JSON:API&lt;/a> to create a powerful and user-friendly approach for developing REST APIs. By adopting the best practices from both, this guide offers a consistent and maintainable API design.&lt;/p>
&lt;h2 id="versioning">Versioning&lt;/h2>
&lt;p>API versioning can be achieved using a variety of methods such as URI-based route prefix, version in the header of the request, or as a query string value.&lt;/p>
&lt;p>The most common approach is using a URI-based route prefix for RESTful routes to define versions. This approach requires including the API version identifier as a part of the URL path, preferably as the first segment. For example, the API endpoint URL could look like:&lt;/p></description></item><item><title>Netlify Functions RESTful API Without Express</title><link>https://coderrob.com/posts/netlify-functions-restful-api-without-express/</link><pubDate>Sun, 14 Nov 2021 12:27:52 -0600</pubDate><guid>https://coderrob.com/posts/netlify-functions-restful-api-without-express/</guid><description>&lt;h3 id="what-are-netlify-functions">What are Netlify Functions?&lt;/h3>
&lt;p>Netlify Functions provide a simple way to build a serverless API layer for any front-end projects.&lt;/p>
&lt;p>These serverless functions are executed atop AWS&amp;rsquo;s Lambda platform. The rule here is keep it simple&amp;hellip; keep it safe. No, wait, keep it simple, and keep it fast.&lt;/p>
&lt;p>These functions have a default timeout of 10 seconds. Netlify does support background functions that can run around 15 minutes, but focus here is on the short-lived functions.&lt;/p></description></item></channel></rss>