<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>LornaJane</title>
	<atom:link href="https://lornajane.net/feed" rel="self" type="application/rss+xml" />
	<link>https://lornajane.net</link>
	<description>Lorna Jane Mitchell&#039;s Website</description>
	<lastBuildDate>Mon, 22 Jan 2024 21:31:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
<site xmlns="com-wordpress:feed-additions:1">113654689</site>	<item>
		<title>Short tech writing style guide for developers</title>
		<link>https://lornajane.net/posts/2024/short-tech-writing-style-guide-for-developers</link>
					<comments>https://lornajane.net/posts/2024/short-tech-writing-style-guide-for-developers#comments</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Wed, 24 Jan 2024 09:18:00 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4700</guid>

					<description><![CDATA[Style guides are vital to successful publishing projects, but they are usually too extensive for casual contributors. After running a number of projects with developers rather than specialist documentarians as the main contributors, I&#8217;ve started using a short-form style guide, &#8230; <a href="https://lornajane.net/posts/2024/short-tech-writing-style-guide-for-developers">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>Style guides are vital to successful publishing projects, but they are usually too extensive for casual contributors. After running a number of projects with developers rather than specialist documentarians as the main contributors, I&#8217;ve started using a short-form style guide, short enough to be read and used by people who don&#8217;t spend as much time thinking about these things as a full time writer does. The main version is <a href="https://github.com/lornajane/developer-style-guide">published on GitHub</a>, but I&#8217;m also sharing the current version here.<span id="more-4700"></span></p>
<h2>Target a single audience and outcome</h2>
<p>Know who you are writing for. The new junior developer needs different context and explanation than the Ops person trying to follow disaster recovery documentation. If it helps to think of a specific individual, do that. The key here is to not write down what you know, but write down what the reader needs to reach the desired outcome. An example outcome could be completing a task, learning about a specific topic, or understanding a set of options.</p>
<h2>Structure your writing</h2>
<p>If your organisation offers templates, always use them; consistency helps readers a lot, even if the content is created by many authors. If not, try the <a href="https://diataxis.fr/">Diátaxis</a> framework as inspiration on how to frame different content types &#8211; and don&#8217;t be afraid to create more than one article from a single topic or assignment. If no structure is provided as a template, create your own by writing the subheadings of the piece before you write the words.</p>
<p>Use subheadings, images or diagrams, lists, and other content types to communicate to your readers. This &#8220;page furniture&#8221; helps them to navigate potentially long and complex technical articles.</p>
<h2>Be positive and inclusive</h2>
<p>Focus on things the user <em>can</em> do. Don&#8217;t explain what can&#8217;t be done, isn&#8217;t supported, or hasn&#8217;t been implmented yet unless these are central to the topic.</p>
<blockquote><p>
  Example: Instead of &#8220;you cannot back up your data yourself&#8221; you could say &#8220;data backups can be arranged by contacting the support team&#8221;.
</p></blockquote>
<p>Inclusive language helps make your writing useful to the widest possible range of people. Avoid gendered language, using &#8220;they&#8221; and &#8220;theirs&#8221; rather than &#8220;he&#8221; or &#8220;she&#8221;. Even when this feels clunky to write, it makes a positive impact on your readers. Other language to find alternatives for includes terms that could seem ableist such as using &#8220;OCD&#8221; or &#8220;crazy&#8221; in your writing. It&#8217;s already standard practice to avoid socially-loaded terminology such as master/slave, blacklist/whitelist, and so on. Keeping a wordlist that is automatically checked, or using a tool like <a href="https://alexjs.com/">AlexJS</a> can help with spotting words and phrases that can be improved.</p>
<p>Beware of jargon and abbreviations, because they can be difficult for newcomers to understand. Expand your abbreviations the first time you use them, and link to definitions or supporting content for any special terms to give the user the option of reading on , or clicking the link to learn more.</p>
<h2>Write commanding titles</h2>
<p>Titles should use <em>imperative</em> language to make it clear what the reader is doing in each section. It can feel like an abrupt style, but imagine ordering a small robot to perform each action and you will be pretty close. The side benefits of this approach are that it&#8217;s often easier to translate, and tends to match user search terms more closely.</p>
<blockquote><p>
  Example: Instead of &#8220;Configuring the widget&#8221; use &#8220;Configure the widget&#8221;
</p></blockquote>
<p>Use sentence case for titles, and check them automatically using a tool like <a href="https://vale.sh/">Vale</a>. Add product names and other proper nouns to Vale to avoid false reports.</p>
<h2>Choose examples and screenshots wisely</h2>
<p>If a picture is worth a thousand words, then a good example is worth at least twice that amount. In both cases:</p>
<ul>
<li>Choose content that the user will know or easily understand. Avoid &#8220;foo&#8221;, and instead use &#8220;Alice&#8221; if it&#8217;s a name, &#8220;Bucket&#8221; if it&#8217;s a product, &#8220;paleblue&#8221; if it&#8217;s a colour, and so on. Your reader will internalise that their data should look like your data.</li>
<li>Avoid pop culture references, using these can exclude groups from other demographics than your own.</li>
<li>Every example and screenshot needs text with it, explaining what it shows and why that&#8217;s useful to the user.</li>
</ul>
<p>Code examples are always valuable, adding more examples is usually a good thing.</p>
<p>Screenshots are both more difficult to get right and more difficult to maintain over time since small changes to a UI will mean repeating all the screenshots. Use them when you think the user would be likely to struggle with words alone. If you take a series of screenshots, use a small and consistent window size for them all. Always reduce the file size as much as you can, and include alt text on every image (tools such as <a href="https://github.com/DavidAnson/markdownlint">Markdownlint</a> can check for alt text automatically).</p>
<h2>Add hyperlinks</h2>
<p>Add links. Link to the tools you mention, the concepts that the user might not know already, and to other articles that are likely to be useful to this reader. Adding links to supporting material can enrich all content types, and help the reader to find their way to success.</p>
<p>Choose words that represent where the link goes to, such as &#8220;see the <a href="#add-hyperlinks">section on hyperlinks</a>&#8220;. Some tools will offer the links with their link text as a list, so meaningful words or phrases and avoiding duplicate link text within a page is good practice.</p>
<h2>Avoid technical documentation missteps</h2>
<p>Technical writing has some unwritten norms that exist for mostly good reasons of readability and comprehension. In particular, here are some things you should NOT do:</p>
<ul>
<li>Use exclamation points. It&#8217;s not a gossip magazine, it&#8217;s technical documentation.</li>
<li>Use question marks, especially in titles. It very easily reads like a car advert.</li>
<li>Add emoji, unless the platform you are writing for has it as an established acceptable practice. Emoji are difficult to keep consistent between authors, can be distracting, and can also make the content less accessible.</li>
</ul>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2024/short-tech-writing-style-guide-for-developers/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4700</post-id>	</item>
		<item>
		<title>API Linting Levels</title>
		<link>https://lornajane.net/posts/2024/api-linting-levels</link>
					<comments>https://lornajane.net/posts/2024/api-linting-levels#comments</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Thu, 11 Jan 2024 00:05:00 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[openapi]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4682</guid>

					<description><![CDATA[I&#8217;ve been thinking about API linting lately, partly because I work on a tool for API linting in my day job, and partly because I get quite a lot of questions from teams wanting to improve their API quality. The &#8230; <a href="https://lornajane.net/posts/2024/api-linting-levels">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>I&#8217;ve been thinking about API linting lately, partly because I work on <a href="https://github.com/redocly/redocly-cli">a tool for API linting</a> in my day job, and partly because I get quite a lot of questions from teams wanting to improve their API quality. The &#8220;best&#8221; ruleset depends entirely on your context, where you are in your API practice journey, and how much you want to invest in the API in question. I typically use a 4-levels model of API linting readiness, and I&#8217;m sharing them so that you can find yourself on the map and see where you might go from here.<span id="more-4682"></span></p>
<p><em>This post is part of <a href="https://matthewreinbold.github.io/APIFutures/">API Futures 2024</a>, a series of posts by different contributors focused on the challenges for this year. My big wish is for everyone to find API tooling and configuration that fits their own context, which is why I&#8217;m publishing this linting levels post a</em>s <em>part of the event.</em></p>
<h3>Level 0: A valid API description</h3>
<p>This sounds basic but a surprising number of public APIs either have no API description, or their OpenAPI description is actually invalid in some way. It may well work with the tools used in the producer organisation, but unless you supply a file that works with all other tools, there are limits to who can use and interact with your API.</p>
<p>Add some unopinionated validation to your CI workflow, and make sure that anyone who works on your API can also run those tools locally while they&#8217;re making changes &#8211; and you can graduate to the next level immediately :) Redocly has a rule for <a href="https://redocly.com/docs/cli/rules/spec/">linting against the specification</a> which is a great starting point (other API linting tools are available!). For the next level, there&#8217;s a great <a href="https://github.com/Redocly/redocly-cli-cookbook/tree/main/rulesets/spec-compliant">ruleset in the Redocly CLI Cookbook</a> that you can copy and paste into your own projects; it aims to catch the things that match the declared data structure of OpenAPI and yet make absolutely no sense in the real world!</p>
<h3>Level 1: Meets basic standards</h3>
<p>Every API probably should have its own set of basic standards but I typically ask about the API linting rules that are already in place, such as:<br />
&#8211; are there checks that security has been declared on every endpoint?<br />
&#8211; is there useful metadata, such as a license and some contact information?<br />
&#8211; does the API follow a design, such as RESTful API design, and how clear is that from the OpenAPI description?<br />
&#8211; are consistent data formats used, such as cents (or equivalent) for money, ISO format dates, standard scientific units for measures?</p>
<p>Having some sort of API design, with some level of data handling, some supporting metadata, and some security practices in place is a level 1 API. Some APIs only need to be at level 1, such as a service with one or two endpoints that handles something non-critical such as newsletter signups. Sure, this API could be brought to a higher API standard and that could be enforced by tools and linting. But not every API needs the same level of investment or must comply with the same standards. Within an organisation, have a few defined levels, and make clear which APIs meet which standards.</p>
<h3>Level 2: Has a consistent interface</h3>
<p>There are few things more irritating than an inconsistent API, and yet a deeply consistent API interface is essentially an invisible feature. Users will very quickly feel comfortable and be productive using your API platform, but not being irritating is rarely given as customer feedback! So what are the ingredients for this developer happiness level of API standard? You can think of it as having two main elements: the philosophy, and the mechanics.</p>
<p>The mechanics is the simplest thing to get right. It means using plurals (or not), absolutely everywhere. Always using exactly the same variable name to refer to the same data, wherever it is used, and validating that data exactly the same way in both request and response for every endpoint. Having endpoints that are consistent in their shape and depth, and keeping common parameter patterns for features such as filtering or pagination the same everywhere. Adding linting rules to an existing API for this level of API standard can be quite tough, but add the rules you want to follow, with exceptions for any existing/legacy endpoints that aren&#8217;t compliant. Enabling the checks on the API, and acknowledging the parts that are known and shouldn&#8217;t fail the build, means you can automate the checks and add no more violations! The ignores list can also serve as a to-do list for things to work on, either by making backwards-compatible changes or to revisit if a new API version is in the works.</p>
<p>The philosophy part is a bit more difficult to think about but building on prior art in your APIs, for example by following established RESTful API design practices very tightly and adopting other standards that are already known and accepted. This approach means you don&#8217;t have too many decisions to make since you&#8217;re following existing and established standards, and the ideas may be familiar/supported by the users/tools that access your API. I particularly recommend looking into <a href="https://en.wikipedia.org/wiki/Hypertext_Application_Language">Hypertext Application Language (HAL)</a> if you include links in the resources you return from your API endpoints, and <a href="https://www.rfc-editor.org/rfc/rfc9457.html">RFC 9457: Problem details for APIs</a> (replaces the better-known RFC 7807).</p>
<h3>Level 3: Is a joy to use</h3>
<p>We don&#8217;t describe developer experiences as &#8220;joy&#8221; often enough, but a really great API description definitely qualifies. If your API is your flagship product, or drives a lot of business value that is realised by strong integrations &#8211; this is the level you want to aim at. What&#8217;s funny about these top-level APIs is that their actual API design isn&#8217;t much different to the earlier levels, however the implementation and supporting materials are the special sauce.</p>
<p>To produce an API at this level, the API governance expands into a more holistic view of the API and what really makes an API experience joyful. This can be achieved with rich OpenAPI descriptions, and supporting documentation as the main pillars. I think there&#8217;s also an element here of discoverability, and that this aspect will only become more important in the future.</p>
<p>Enriching OpenAPI descriptions can take many forms. Make the most of the description fields; these support Markdown so don&#8217;t be afraid to add links, lists, or whatever else would help the user. From the very top level, where <code>info.description</code> sets the scene and purpose for the whole API, through the individual endpoint descriptions and down to the individual parameter and schema fields, the descriptions are the magic sauce. Explain not just what the thing <em>is</em>, but also what it <em>does</em>, and why the user would want to do that. Enrich also with meaningful and illustrative examples, using (culturally varied) example data that represents something a user really would be doing, rather than &#8220;foo&#8221; or &#8220;bar&#8221;. A project name could be &#8220;holiday_planning&#8221; and an email address &#8220;email@example.com&#8221;, and using values like this does make a more successful and happier end user.</p>
<p>The documentation is not just the reference documentation either. I haven&#8217;t seen linting rules for this, so perhaps it&#8217;s a little out of scope, but adding meaningful onboarding documentation or getting started guides, and tutorials for the most common tasks in an API are both excellent additions that make a good API into a great API.</p>
<h3>Make your API next-level</h3>
<p>Don&#8217;t be put off by API standards tooling that comes with big opinions of its own. Reflecting on what your API needs, and what your organisation can support, will help you find which level you are on and where you want to be and set your API projects up for success. Tune the API linting rules to get the support you need, but don&#8217;t be afraid to turn things off that aren&#8217;t important to you! All the tools come with default rules, but every situation is different so take the time to adjust it for your context rather than gritting your teeth and dealing with someone else&#8217;s ideals.</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2024/api-linting-levels/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4682</post-id>	</item>
		<item>
		<title>Add OpenAI flags to OpenAPI descriptions</title>
		<link>https://lornajane.net/posts/2023/add-openai-consequential-to-openapi</link>
					<comments>https://lornajane.net/posts/2023/add-openai-consequential-to-openapi#respond</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Tue, 28 Nov 2023 09:48:00 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[openai]]></category>
		<category><![CDATA[openapi]]></category>
		<category><![CDATA[overlayjs]]></category>
		<category><![CDATA[overlays]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4686</guid>

					<description><![CDATA[Use overlayjs to add x-openai-isConsequential flags for OpenAI to your existing OpenAPI description. This post explains the process and shows the commands to use. <a href="https://lornajane.net/posts/2023/add-openai-consequential-to-openapi">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>With <a href="https://openai.com/">OpenAI&#8217;s</a> new <a href="https://platform.openai.com/docs/actions">Actions feature</a> allowing you to get a GPT that uses your own API, many new doors are open. However giving an AI an access token the keys to your API and telling it to have fun may lead you to realise that one of the doors available leads to the empty lift shaft of overwritten data, or the bottomless well of cloud bill shock. To reduce the risks, OpenAI supports an extension <code>x-openai-isConsequential</code> that you can add to your OpenAPI description, to indicate which endpoints should not be called without a human confirmation step.</p>
<p>I&#8217;m not doing much with OpenAI right now, but I do plenty with OpenAPI and the question &#8220;how do I add this field to my existing API description?&#8221; is one that I can answer! What&#8217;s more, you can use the advice in this post to add other extensions or additions to your OpenAPI descriptions using <a href="https://github.com/OAI/Overlay-Specification">Overlays</a>, this advice isn&#8217;t OpenAI-specific, but it&#8217;s used in the examples.<span id="more-4686"></span></p>
<p><em>(is anyone else confused by the OpenAI vs OpenAPI similarity yet? I am &#8230;.)</em></p>
<h3>OpenAPI Overlays</h3>
<p>The OpenAPI Initiative has a group working on a feature called Overlays which solves exactly this problem, where the OpenAPI description exists, but needs some tweaks. Sadly, not very many tools support this yet &#8211; the ones I know of are <a href="https://github.com/lornajane/openapi-overlays-js">my overlays-js library</a> that I&#8217;ll use for the examples in this post, and <a href="https://github.com/speakeasy-api/speakeasy/blob/main/docs/overlay/README.md">Speakeasy CLI</a>.</p>
<h3>Overlay Example</h3>
<p>This example shows an Overlay that adds the <code>x-openai-isConsequential</code> field to all <code>POST</code> endpoints:</p>
<pre><code class="language-yaml">overlay: 1.0.0
info:
title: Add OpenAPI annotations
version: 1.0.0
actions:
- target: "$.paths.*.post"
update:
x-openai-isConsequential: true
</code></pre>
<p>The <code>target</code> field accepts JSONPath, so edit this expression as required to capture the endpoints you want to flag. Note also that you can add as many <code>action</code> steps as you need to, so if it&#8217;s simpler to add specific targets rather than trying to JSONPath to the right subset, that is an option! (there&#8217;s a bug with the overlays library that means structured overlays don&#8217;t work well at this moment, so use targeted overlays).</p>
<h3>Use <code>overlayjs</code> to update the API description</h3>
<p>Check the <a href="https://github.com/lornajane/openapi-overlays-js#installation">installation instructions</a> to get the tool installed if you don&#8217;t have it already.</p>
<p>Run the command and supply the API description as <code>--openapi</code> and the overlay as <code>--overlay</code>. For example, the following command applies <code>overlay.js</code> to <code>openapi.js</code>:</p>
<pre><code class="language-text">overlayjs --openapi openapi.yaml --overlay overlay.js &gt; new-openapi.yaml
</code></pre>
<p>The command writes to <code>stdout</code>, so you can direct the output wherever you would like it to go. In my case, I&#8217;ve directed it to a file called <code>new-openapi.yaml</code>.</p>
<p>Take a look at the updated OpenAPI description, or diff it against the original, and you should see that the post endpoints now have the OpenAI <code>x-openai-isConsequential: true</code> added.</p>
<p>By using OpenAPI Overlays, you get a standard format and a choice of tools to apply it with. You can prepare an OpenAPI file for use with OpenAI, even if you are an API consumer and have no input into the way that the OpenAPI is created &#8211; or if you just want to avoid cluttering other stages of your API lifecycle with the metadata specific to the OpenAI use case. Hopefully this helped you get your OpenAPI in shape for OpenAI (yes, still confusing to have such similar words!), I&#8217;d be happy to hear how you get on if you want to share in the comments.</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2023/add-openai-consequential-to-openapi/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4686</post-id>	</item>
		<item>
		<title>When to version bump your OpenAPI description</title>
		<link>https://lornajane.net/posts/2023/when-to-version-bump-your-openapi-description</link>
					<comments>https://lornajane.net/posts/2023/when-to-version-bump-your-openapi-description#respond</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Mon, 20 Nov 2023 13:10:10 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[apidesign]]></category>
		<category><![CDATA[asyncapi]]></category>
		<category><![CDATA[openapi]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4677</guid>

					<description><![CDATA[I&#8217;ve heard a variety of bad advice (and some untruths!) regarding how to version your OpenAPI description lately. Rather than dig into those, instead I&#8217;ll share my opinion on how I like to version API descriptions in my own projects. &#8230; <a href="https://lornajane.net/posts/2023/when-to-version-bump-your-openapi-description">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>I&#8217;ve heard a variety of bad advice (and some untruths!) regarding how to version your OpenAPI description lately. Rather than dig into those, instead I&#8217;ll share my opinion on how I like to version API descriptions in my own projects. Every API project is different, but perhaps there&#8217;s something here that can help your project too.<span id="more-4677"></span></p>
<h3>Version your API Descriptions</h3>
<p>Let&#8217;s start with: please, please do use the version field, and update it from time to time. In OpenAPI, the version of the description is in the <code>info.version</code> field and the <a href="https://spec.openapis.org/oas/latest.html#info-object">official documentation</a> describes it as:</p>
<blockquote><p>
  REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).
</p></blockquote>
<p>To break this down, the documentation describes what the version field is, and also two things that it is not:</p>
<ul>
<li>it <strong>is</strong> the version of the OpenAPI document.</li>
<li>it <strong>is not</strong> the version of OpenAPI specification being used (this is in the top-level <code>openapi</code> field).</li>
<li>it <strong>is not</strong> the version of the API that it relates to (many descriptions cover multiple API versions, and may also change without the API changing).</li>
</ul>
<p>So now we&#8217;ve cleared this up for OpenAPI, and pretty much everything here applies to AsyncAPI as well, let&#8217;s think about when the version should change.</p>
<h3>When to update the API description&#8217;s version field</h3>
<p><strong>TL;DR</strong> when the API description changes, update the version field.</p>
<p>The whole point of a version field is so that I can tell if I have the most recent version of your API description, or which version something used. So if the two things aren&#8217;t the same, then probably their versions shouldn&#8217;t be the same either.</p>
<p>Some things that should probably cause a version change:</p>
<ul>
<li>a new endpoint was added to the API, or something was marked as deprecated</li>
<li>the description was updated to include improved summaries, descriptions, tags or examples</li>
<li>the description was restructured</li>
</ul>
<p>Having a process that publishes a new OpenAPI description with an updated version is something you&#8217;ll want to be able to do easily and regularly, so make it painless to do.</p>
<p><strong>A note on version formats:</strong> OpenAPI only recommends a string. Many organisations do use a <a href="https://semver.org/">SemVer</a> approach, and this is well understood by technical audiences, but choose something that fits you. Take a leaf out of Stripe&#8217;s book and <a href="https://stripe.com/docs/api/versioning">use dates for versions</a>, for example. Whatever you choose, don&#8217;t get bogged down in what does or does not require a new release. Make new releases easy and aim for releasing too often rather than too infrequently!</p>
<p>This quick roundup on API versioning was the result of having this conversation several times over the last few weeks/months, with people all over the API ecosystem. We talk a lot about API versioning, but not nearly enough about API description versioning, so I wanted to share some thoughts and most of all encourage everyone to version their API descriptions (at all! With any sort of version!) and to update those version fields from time to time :)</p>
<p>Are there any organisations or APIs you&#8217;ve seen that do this particularly well (or badly, if you can be constructive about why it&#8217;s not working)? I&#8217;d be interested in seeing comments pointing to more examples of what you have spotted in the wild.</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2023/when-to-version-bump-your-openapi-description/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4677</post-id>	</item>
		<item>
		<title>API docs previews with Redoc and Netlify</title>
		<link>https://lornajane.net/posts/2023/api-docs-previews-with-redoc-and-netlify</link>
					<comments>https://lornajane.net/posts/2023/api-docs-previews-with-redoc-and-netlify#respond</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Wed, 08 Nov 2023 09:18:20 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[docs-as-code]]></category>
		<category><![CDATA[netlify]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4664</guid>

					<description><![CDATA[I talk to a lot of people about their API lifecycles and processes, and one thing that has value in almost every case is immediate documentation preview for all updates to an OpenAPI description. The time it takes to set &#8230; <a href="https://lornajane.net/posts/2023/api-docs-previews-with-redoc-and-netlify">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>I talk to a lot of people about their API lifecycles and processes, and one thing that has value in almost every case is immediate documentation preview for all updates to an <a href="https://openapis.org">OpenAPI</a> description. The time it takes to set it up (about ten minutes now I know what to do) is an investment that makes every future change easier to propose, review, and accept. Here&#8217;s my recipe for open source OpenAPI documentation using <a href="https://github.com/redocly/redoc">Redoc</a> (disclaimer: I work for Redocly, who publish Redoc) with the files pushed to <a href="https://www.netlify.com/">Netlify</a> for hosting (but it&#8217;s HTML, so really any hosting will do and you should feel free to adapt the instructions for your preferred platform, and then share them in the comments).<span id="more-4664"></span></p>
<h3>OpenAPI in a GitHub repo</h3>
<p>API documentation using OpenAPI assumes a docs-as-code workflow, and so does this post. You should have an OpenAPI description in a GitHub repository, so that when the description changes, the documentation can update. The big win here is that by adding preview builds for all pull requests, incoming changes can easily be shared and reviewed by all stakeholders, without any need to read YAML.</p>
<p><strong>Tip:</strong> there&#8217;s no need to bundle the OpenAPI description to a single file, Redoc will follow references across files as needed so this approach is ideal for the during-development-and-review phase of the process.</p>
<h3>Configure the Netlify project</h3>
<p>The basic process, for Netlify or any equivalent, is to link the GitHub project to a deployable project so that updates run every time the repository updates. Netlify needs to know how to build the project, which in this case is generating the documentation as HTML, and what to publish. There&#8217;s a setting for &#8220;do this for pull requests as well&#8221; which is what makes the whole thing seem like magic!</p>
<p>Get started with the &#8220;Add new site&#8221; option and choose &#8220;Deploy with GitHub&#8221;. You may need to link your Netlify account to your GitHub account and/or the project you want to use if you haven&#8217;t used these tools together before or if you grant access on a per-project basis. Once that&#8217;s done, pick the project to generate API documentation for.</p>
<p>The next screen sets the site configuration. My project has <code>openapi.yaml</code> in the root folder, and my settings are like this:<br />
* The <strong>build command</strong> is <code>npx @redocly/cli build-docs openapi.yaml -o build/index.html</code>.<br />
* And <strong>publish directory</strong> is set to <code>build/</code> since that&#8217;s where the previous command writes the files to.</p>
<p><a href="https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04.png"><img fetchpriority="high" decoding="async" src="https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04-1024x320.png" class="aligncenter size-large wp-image-4666" width="584" height="183" alt="Screenshot of the settings page, showing the build command and publish directory as described." srcset="https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04-1024x320.png 1024w, https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04-768x240.png 768w, https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04-500x156.png 500w, https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04-300x94.png 300w, https://lornajane.net/wp-content/uploads/2023/11/Screenshot-from-2023-11-04-21-34-04.png 1034w" sizes="(max-width: 584px) 100vw, 584px" /></a></p>
<p>Save the settings and the project will (hopefully) deploy successfully &#8211; don&#8217;t look away, it&#8217;s fast!</p>
<p>I&#8217;m not sure when Netlify started enabling preview deploys by default but that&#8217;s the behaviour in my most recent new site. Test your own setup by making a small but identifiable change to your API description, committing the change to a branch, and opening a pull request. After a few minutes the Netlify bot should comment with a link to the preview of the updated documentation.</p>
<p>All in all, the time investment to get a basic documentation rendering is definitely worth it (and if you need something more then I think I am contractually obliged to suggest you check out <a href="https://redocly.com">Redocly</a> for the rest of the products). Investing in every stage of your API pipeline, from linting, to enrichment, and to docs &#8211; delivers rewards. And delivers them every time you make an API description change!</p>
<p>Hopefully you found this useful, I&#8217;d love to hear if you set this up yourself, or if you can share equivalent setups for other platforms so that others can learn from your wisdom: add a comment!</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2023/api-docs-previews-with-redoc-and-netlify/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4664</post-id>	</item>
		<item>
		<title>Selective prose linting with Vale&#8217;s glob switch</title>
		<link>https://lornajane.net/posts/2023/selective-prose-linting-with-vales-glob-switch</link>
					<comments>https://lornajane.net/posts/2023/selective-prose-linting-with-vales-glob-switch#respond</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Wed, 23 Aug 2023 10:55:03 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[docs-as-code]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4638</guid>

					<description><![CDATA[Vale is an open source CLI tool for linting prose (if you&#8217;re not linting prose yet, why not? I never want to go back). I typically use it for everything, locally and in CI, and it&#8217;s especially valuable now I&#8217;m &#8230; <a href="https://lornajane.net/posts/2023/selective-prose-linting-with-vales-glob-switch">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'><a href="https://vale.sh/">Vale</a> is an open source CLI tool for linting prose (if you&#8217;re not linting prose yet, why not? I never want to go back). I typically use it for everything, locally and in CI, and it&#8217;s especially valuable now I&#8217;m working for a company that uses US English. You&#8217;d think that most of the challenges would be caused by the majority of non-native English language contributors? Nope, most of the chaos comes from the token Brit :)</p>
<p>I ran into one challenge though where I didn&#8217;t want to enable Vale for everything: a large internal documentation repo. This is the catch-all of things we should share with one another and like most internal company documentation sites, there is a lot going on. I assembled a very minimal set of Vale rules and still the first pass netted me over 10k errors. Luckily, Vale has a <code>--glob</code> option, but it took me a while to find how to exclude multiple files and directories using it, so here&#8217;s the example for future-me, and anyone else who needs to see it!<span id="more-4638"></span></p>
<p>Most of Vale&#8217;s configuration uses a <code>.vale.ini</code> file, but you specify the files and directories to check at the time you run the command, with something like:</p>
<pre><code>vale docs/
</code></pre>
<p>In my case, I needed to exclude a mix of folders (there&#8217;s little value in checking/fixing a meeting notes collection of a past project, and we can&#8217;t make changes to our legal docs. Also there&#8217;s a page of good restaurants near the office that is full of proper nouns!). To include just one section or another, I could run Vale multiple times to check each section, but to run everything <em>except</em> some problem areas, I used <code>--glob</code>. I ended up with a command like this:</p>
<pre><code>vale --glob='!{office/where-to-eat.md,legal/*,projects/codename/meetings/*}
</code></pre>
<p>Some of the skipped directories we will probably work on improving and then dropping the exception for &#8211; but this approach is useful when retrofitting a tool like Vale to an existing repository which can&#8217;t be made to align all at once. We&#8217;re also using a pretty reduced ruleset and may incrementally add to this over time.</p>
<h3>Glob in GitHub Actions</h3>
<p>Probably all the CI integrations have something similar but <a href="https://github.com/errata-ai/vale-action">Vale has a GitHub Action</a> and I could add the whole <code>--glob</code> expression to a <code>vale_flags</code> entry in the <code>with</code> step.</p>
<p>Ideally we&#8217;d be running identical commands and configuration both locally and in CI, but since the configuration for this doesn&#8217;t seem to be able to go in the Vale config file, I compromised on adding it as an npm script as well as a GitHub action. It&#8217;ll be annoying to maintain but I didn&#8217;t come up with any better ideas!</p>
<p>Hopefully this post will help me next time I&#8217;m wondering how to combine glob expressions for Vale, since I didn&#8217;t find many other examples. If it helps you do, then that&#8217;s even better! Share your tips in the comments :)</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2023/selective-prose-linting-with-vales-glob-switch/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4638</post-id>	</item>
		<item>
		<title>Visualise OpenAPI with Blockly</title>
		<link>https://lornajane.net/posts/2023/visualise-openapi-with-blockly</link>
					<comments>https://lornajane.net/posts/2023/visualise-openapi-with-blockly#respond</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Tue, 20 Jun 2023 11:57:12 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[openapi]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4623</guid>

					<description><![CDATA[Giving talks about OpenAPI often means lots and lots of slides of YAML. In fact, one of my talks even contains a &#8220;warning, contains yaml&#8221; slide! If you aren&#8217;t a professional yaml developer, it can be difficult to digest and &#8230; <a href="https://lornajane.net/posts/2023/visualise-openapi-with-blockly">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>Giving talks about OpenAPI often means lots and lots of slides of YAML. In fact, one of my talks even contains a &#8220;warning, contains yaml&#8221; slide! If you aren&#8217;t a professional yaml developer, it can be difficult to digest and learn from, and so I wanted to do better. The various elements are nested inside one another, and so I had this idea to build a representation of OpenAPI using <a href="https://developers.google.com/blockly/">Blockly</a> (the tooling also used for <a href="https://scratch.mit.edu/">Scratch</a>, if you&#8217;ve seen that).</p>
<p><a href="https://lornajane.net/wp-content/uploads/2023/06/openapi-tags-block.png"><img decoding="async" src="https://lornajane.net/wp-content/uploads/2023/06/openapi-tags-block-300x128.png" alt="Showing tags with descriptions" width="300" height="128" class="aligncenter size-medium wp-image-4624" srcset="https://lornajane.net/wp-content/uploads/2023/06/openapi-tags-block-300x128.png 300w, https://lornajane.net/wp-content/uploads/2023/06/openapi-tags-block-500x213.png 500w, https://lornajane.net/wp-content/uploads/2023/06/openapi-tags-block.png 596w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
<span id="more-4623"></span></p>
<p>The hardest part was (as always!) getting started with an unfamiliar toolchain, knowing what to edit, how to serve the file, and if there was an extra step needed to see changes. The developer documentation for Blockly is very good, and I tried to follow their guidelines as much as I could. I ended up writing a messy web page that had a textarea that I could use to import/export what I&#8217;m working on, and writing it all to local browser storage &#8211; because every time I changed the toolbox, I lost the data structure I had just built!</p>
<p>It&#8217;s not a complete library, but it did allow me to create the visuals I wanted for my talk &#8220;OpenAPI for Documentarians&#8221; at APItheDocs in Amsterdam, and I think it&#8217;s likely that I&#8217;ll expand and use this again. I got positive feedback from trusted audience members, and a few people told me they found it &#8220;approachable&#8221; &#8211; which is exactly what I was aiming for.</p>
<p><a href="https://lornajane.net/wp-content/uploads/2023/06/openapi-path-single-block.png"><img decoding="async" src="https://lornajane.net/wp-content/uploads/2023/06/openapi-path-single-block.png" alt="A single endpoint represented with blocks" width="883" height="488" class="aligncenter size-full wp-image-4626" srcset="https://lornajane.net/wp-content/uploads/2023/06/openapi-path-single-block.png 883w, https://lornajane.net/wp-content/uploads/2023/06/openapi-path-single-block-768x424.png 768w, https://lornajane.net/wp-content/uploads/2023/06/openapi-path-single-block-500x276.png 500w, https://lornajane.net/wp-content/uploads/2023/06/openapi-path-single-block-300x166.png 300w" sizes="(max-width: 883px) 100vw, 883px" /></a></p>
<p>I&#8217;ve published the whole project <a href="https://github.com/lornajane/openapi-blockly-representation">on GitHub</a>, and I&#8217;d be happy to have forks, contributions, suggestions or feedback on this. There are places where I think there&#8217;s probably better ways to represent some elements, for example. Also the idea of Blockly is that it&#8217;s a high level language that can then be compiled to something for the machines when the humans have finished with it. I&#8217;m not sure if it&#8217;s even possible to write the converters for it to output OpenAPI but that would be a really fun project if anyone is up for it :)</p>
<p>If you use it, I&#8217;d love to hear about it &#8211; drop me a comment!</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2023/visualise-openapi-with-blockly/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4623</post-id>	</item>
		<item>
		<title>Tips for better documentation with OpenAPI</title>
		<link>https://lornajane.net/posts/2023/tips-for-better-documentation-with-openapi</link>
					<comments>https://lornajane.net/posts/2023/tips-for-better-documentation-with-openapi#respond</comments>
		
		<dc:creator><![CDATA[<span class='p-author h-card'>lornajane</span>]]></dc:creator>
		<pubDate>Mon, 12 Jun 2023 12:30:29 +0000</pubDate>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[apithedocs]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[openapi]]></category>
		<guid isPermaLink="false">https://lornajane.net/?p=4621</guid>

					<description><![CDATA[Improve your API experience with better API descriptions using summary, description and externalDocs appropriately. Use markdown, and these simple writing structure tips to improve your OpenAPI files - and the resulting documentation. <a href="https://lornajane.net/posts/2023/tips-for-better-documentation-with-openapi">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<div class='e-content'>I love documentation, which is supposed to be rare for software engineers. I am pretty sure that loving documentation is actually very common, but not very cool and so few people admit to it! I love reading good docs, and so I love writing them too. Between hanging out in the <a href="https://www.writethedocs.org/">Write the Docs</a> community, and recently being at the <a href="https://apithedocs.org/amsterdam-2023">APItheDocs conference</a>, I&#8217;ve answered a bunch of questions about getting good documentation from an OpenAPI document, so I thought I&#8217;d round them up in case it&#8217;s useful.<span id="more-4621"></span></p>
<h3>Summary vs description</h3>
<p>OpenAPI supports both <code>summary</code> and <code>description</code> fields and they&#8217;re both strings that contain information about the thing they are attached to, such as a parameter, endpoint, schema, or response. So which do you use?</p>
<p>Summary is a plain text field, and should typically be shorter: just one or two sentences. It&#8217;s often used when listing elements, although different tools render different tools differently, so always check what your tools product and do whatever looks right there.</p>
<p>Description fields support markdown, so this presents an opportunity to link to additional information or documentation. Particularly in the top-level <code>info.description</code> field, this can be an opportunity to write multi-paragraph detailed overview documentation.</p>
<h3>Good description fields give context</h3>
<p>It&#8217;s very common to see a description for the <code>user_id</code> field which says something like &#8220;the ID of the user&#8221;. Um, thanks?</p>
<p>Everyone can do better than this &#8211; and if you&#8217;ve ever had to read API documentation from someone else, you know how much difference it makes. I advise people to ask themselves WHAT this field/endpoint/whatever does, and WHY it&#8217;s needed. Think about what the user is doing when they use this endpoint, and give a bit more context. Something like &#8220;the ID of the user placing the order. This value can be found in the order detail object or order status update object. Find the current user&#8217;s ID by going to /user/me`. You get the idea. Context is everything!</p>
<p>Taking pride in API documentation is a Developer Experience multiplier; just make sure that everyone working on your API documentation knows how much you value the extra effort in this area, and that it is something that collaborators should spend time on.</p>
<h3>Simplest styleguide</h3>
<p>Writing brilliantly is absolutely an art, but writing well enough is attainable for everyone. My advice is always to keep it simple and informative.<br />
* Use short sentences<br />
* Use present tense (the endpoint &#8220;does&#8221; something, rather than &#8220;will do&#8221; the thing)<br />
* If you can remove extra phrases, such as &#8220;in this case&#8221;, do so. It keeps things easier to read<br />
* Be kind. Keep things gender-neutral and inclusive, and avoid belittling words such as &#8220;simply&#8221; and &#8220;just&#8221;</p>
<p>With these in mind, you won&#8217;t go far wrong. Engineers can absolutely be brilliant at this without formal training.</p>
<h3>Markdown in YAML</h3>
<p>Description fields support markdown, which is brilliant, and allows expressive additions if you need them. If you use YAML for OpenAPI documents, there are a couple of additional operators that can make it much easier to work with.</p>
<p><strong>Folded block</strong> starts with <code>&gt;</code>. This is great if you just want to wrap your content to make it manageable, or compatible with the linters/formatters you use on the file. I quite like to use a one sentence per line format for markdown, because it makes diffs more readable, and this works nicely with that approach.</p>
<pre><code class="language-yaml">description: &gt;
  This is a folded block style in YAML.
  It preserves line breaks but ignores leading
  and trailing white spaces.
</code></pre>
<p><strong>Literal block</strong> starts with <code>|</code>. Use this approach if you have markdown that uses whitespace, such as titles or bullet points.</p>
<pre><code class="language-yaml">description: |
  # Title

  This is some Markdown content.
  It can include multiple paragraphs,
  lists, headers, and other Markdown syntax.
</code></pre>
<p>Using the appropriate markdown syntax can make things much easier and maintainable over time.</p>
<h3>Link to external documentation from API reference</h3>
<p>I don&#8217;t often see the <a href="https://spec.openapis.org/oas/v3.1.0#external-documentation-object"><code>externalDocs</code></a> used but it&#8217;s a top-level element in OpenAPI that is designed to make the main API documentation (landing pages, quickstarts, tutorials, etc) easily findable from the API reference documentation. Additionally, OpenAPI tags, schemas and operations all also support <code>externalDocs</code> properties, so you can link directly to detailed documentation for any of those elements too. Especially useful when there&#8217;s a lot of information to include, that can be unwieldy in the description fields.</p>
<p>What are you tips for getting the best documentation from OpenAPI? I&#8217;m working full time in this space now (at <a href="https://redocly.com">Redocly</a>, and really enjoying having lots of conversations about docs, APIs, and everything in between!</div>
]]></content:encoded>
					
					<wfw:commentRss>https://lornajane.net/posts/2023/tips-for-better-documentation-with-openapi/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4621</post-id>	</item>
	</channel>
</rss>
