<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ schema - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ schema - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 20 Jul 2026 22:34:37 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/schema/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ What is a JSON Schema? ]]>
                </title>
                <description>
                    <![CDATA[ If you're a developer, you likely work with JSON a lot. But how do you define and validate JSON and prevent problems from malformed JSON data? This article explores what a JSON schema is, some example ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-a-json-schema/</link>
                <guid isPermaLink="false">6a453cdd6f1c5cf654025328</guid>
                
                    <category>
                        <![CDATA[ json ]]>
                    </category>
                
                    <category>
                        <![CDATA[ schema ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Chidiadi Anyanwu ]]>
                </dc:creator>
                <pubDate>Wed, 01 Jul 2026 16:14:21 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/cc9499a2-35ff-4aac-b5cb-5f5e6a7a415b.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you're a developer, you likely work with JSON a lot. But how do you define and validate JSON and prevent problems from malformed JSON data?</p>
<p>This article explores what a JSON schema is, some examples of JSON schemas, and who decides what one should look like.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>To understand this article, you need to <a href="https://thenetworkbits.com/an-overview-of-json/">know some JSON basics</a> and have a <a href="https://www.freecodecamp.org/news/how-apis-work/">general understanding of APIs</a> and how they work.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a href="#heading-whats-the-deal-with-json">What's the Deal with JSON</a>?</p>
</li>
<li><p><a href="#heading-what-is-validation">What is Validation</a>?</p>
</li>
<li><p><a href="#heading-the-structure-of-a-json-schema">The Structure of a JSON Schema</a></p>
</li>
<li><p><a href="#heading-how-to-create-a-json-schema">How to Create a JSON Schema</a></p>
</li>
<li><p><a href="#heading-json-schema-use-cases">JSON Schema Use Cases</a></p>
<ul>
<li><p><a href="#heading-openapi">OpenAPI</a></p>
</li>
<li><p><a href="#heading-azure-resource-manager-arm-templates">Azure Resource Manager (ARM) Templates</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-the-json-schema-project">The JSON Schema Project</a></p>
</li>
</ul>
<h2 id="heading-whats-the-deal-with-json">What's the Deal with JSON?</h2>
<p><a href="https://thenetworkbits.com/an-overview-of-json/">JSON</a> is a popular document format typically used for the interchange of data through APIs. It's lightweight, easily readable by both humans and machines, and is supported by a lot of programming languages.</p>
<p>But JSON objects aren't rigid, and can be built to represent different types of data. This means that it's flexible, but it doesn't enforce a data model or constraints. This can introduce problems between the communicating parties.</p>
<p>For example, if a server expects cart items, and it receives an object with payment transaction data, it could get confused and not parse it correctly. Maybe even crash.</p>
<p>Or if a server handles messaging between users of an app and expects a certain structure of payload, but the client sent something different, it could break the app during parsing or lead to security compromises.</p>
<p>That’s why there's validation.</p>
<h2 id="heading-what-is-validation">What is Validation?</h2>
<p>It's always a good practice to validate your forms before any data is sent. Validation happens when data that's entered into the form gets checked against the expected structure and data types.</p>
<p>If the data entered has another format, structure, or data type from what's expected and acceptable, the form is rejected and isn't sent to the server. This protects the server from parsing the wrong type of data, and also from potential security issues.</p>
<p>A JSON schema is a JSON document that describes the expected format of other JSON documents. It basically restricts the type of JSON data the server can receive and accept, and ensures that only the right type of data is parsed by the server.</p>
<p>Configuration files like package.json in node.js, and even the Azure ARM template use JSON. These have to be validated against a schema to ensure that the files are written with the correct syntax and structure so they can be understood by the system. Validators do this, and they help prevent any problems that might arise from improper parsing.</p>
<h2 id="heading-the-structure-of-a-json-schema">The Structure of a JSON Schema</h2>
<p>A normal JSON file contains data, while a JSON schema contains rules about the data. The schema is declarative.</p>
<p>Let's look at an example of a regular JSON file with data:</p>
<pre><code class="language-json"> {
  "username": "chidiadi",
  "followers": 2200
}
</code></pre>
<p>Now here's the schema representing the structure and constraints of the JSON data:</p>
<pre><code class="language-json">{
  "type": "object",
  "properties": {
    "username": {
      "type": "string"
    },
    "followers": {
      "type": "integer"
    }
  }
}
</code></pre>
<p>The JSON schema consists of JSON objects too, but these objects represent the constraints and syntax of the data.</p>
<p>For example, this schema expects a JSON object that has two properties: username and followers. For the username property, it should be a string (which is a data type supported by JSON). For the followers property, it should be an integer. The parent object itself is an “object” type.</p>
<p>This is the basic structure of a JSON schema. You can then build on this for a more complex and comprehensive schema based on your use case.</p>
<h2 id="heading-how-to-create-a-json-schema">How to Create a JSON Schema</h2>
<p>To create a basic schema, you need to:</p>
<ol>
<li><p>Define the schema keyword, <code>$schema</code></p>
</li>
<li><p>Define the schema keyword, <code>$id</code></p>
</li>
<li><p>Then define the <code>title</code> and <code>description</code> keywords (which are schema annotations)</p>
</li>
<li><p>Define the <code>type</code> and <code>properties</code> validation keywords</p>
</li>
</ol>
<p>The <code>$schema</code> keyword is used to declare what version of the JSON schema specification your schema adheres to. Example:</p>
<pre><code class="language-json">{ 
    "$schema": "https://json-schema.org/draft/2020-12/schema" }
</code></pre>
<p>The <code>$id</code> keyword is used to give that schema a unique identifier (URI) so you can reference it from another schema. This allows you to reuse and organize your schemas. Example:</p>
<pre><code class="language-json">{ 
    "$id": "http://yourdomain.com/schemas/followers.json" 
}
</code></pre>
<p>They can then be referenced with the <code>$ref</code> keyword from another schema.</p>
<pre><code class="language-json">{ 
    "$ref": "http://yourdomain.com/schemas/followers.json" 
}
</code></pre>
<p>The <code>title</code> and <code>description</code> keywords are annotations. They're used to describe what the schema is for.</p>
<pre><code class="language-json">{ 
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://yourdomain.com/schemas/followers.json"   
  "title": "Followers Schema",
  "description": "Number of followers per person",
 }
</code></pre>
<p>So far, all the keywords we've mentioned don't affect the output of the validation. They haven't said anything about what the expected JSON document should be like, or what to validate against. That is what <code>type</code> and <code>properties</code> keywords do. They are <em>validation keywords</em>.</p>
<p>The type keyword determines the type of instance being validated by the schema. That could be a <code>string</code>, an <code>object</code>, an <code>array</code>, a <code>number</code>, <code>boolean</code> or <code>null</code>.</p>
<pre><code class="language-json">{ 
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://yourdomain.com/schemas/followers.json"   
  "title": "Followers Schema",
  "description": "Number of followers per person",
  "type":"object"
 }
</code></pre>
<p>Now, if you send some JSON that consists of an array as the parent in the file, it will be rejected. But what should the object contain? That's where the <code>properties</code> keyword comes in.</p>
<pre><code class="language-json">{ 
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://yourdomain.com/schemas/followers.json"   
  "title": "Followers Schema",
  "description": "Number of followers per person",
  "type":"object",
  "properties":{
    "username": {
      "description":"The username of the user",
      "type": "string"
    },
    "followers": {
      "description":"The number of followers user has",
      "type": "integer"
    }
  }
}
</code></pre>
<p>Here, we've added keys that are expected in the JSON file: <code>username</code> and <code>followers</code>. So, files containing other keys than that will fail validation.</p>
<p>This will pass:</p>
<pre><code class="language-json">{
  "username": "chidiadi",
  "followers": 2200
}
</code></pre>
<p>And this will fail:</p>
<pre><code class="language-json">{
  "username": "chidiadi",
  "name":"Chidiadi Anyanwu",
  "followers": 2200,
}
</code></pre>
<p>It will fail because that extra <code>name</code> key in the JSON file wasn't included in the schema. The <code>description</code> keyword in those keys are just annotations to tell the developer or whoever is going through the schema file what those keys are all about.</p>
<p>There's also a <code>required</code> keyword that can be used to specify what keys in the JSON file <em>have to</em> be there to be accepted. For example, if we want to reject any JSON file sent without populating the <code>username</code> field, we could make it required.</p>
<pre><code class="language-json">{ 
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://yourdomain.com/schemas/followers.json"   
  "title": "Followers Schema",
  "description": "Number of followers per person",
  "type":"object",
  "properties":{
    "username": {
      "description":"The username of the user",
      "type": "string"
    },
    "followers": {
      "description":"The number of followers user has",
      "type": "integer"
    }
  },
  "required":["username"]
}
</code></pre>
<p>The <code>required</code> keyword is a validation keyword for objects, and the value of this keyword must be an array. Not including the keyword is akin to an empty array. You can add multiple keys to that array. For example, if we want both the username and follower count to be compulsory keys in the JSON file, we can put both of them there:</p>
<pre><code class="language-json">{ 
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://yourdomain.com/schemas/followers.json"   
  "title": "Followers Schema",
  "description": "Number of followers per person",
  "type":"object",
  "properties":{
    "username": {
      "description":"The username of the user",
      "type": "string"
    },
    "followers": {
      "description":"The number of followers user has",
      "type": "integer"
    }
  },
  "required":["username","followers"]
}
</code></pre>
<h2 id="heading-json-schema-use-cases">JSON Schema Use Cases</h2>
<h3 id="heading-openapi">OpenAPI</h3>
<p>According to the OpenAPI Initiative,</p>
<blockquote>
<p>“The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic.”</p>
</blockquote>
<p>Basically, it gives developers a way to document their API design in a way that's easy for them to understand and track their development. It also allows others who need to consume the API to understand what they need to know to use it.</p>
<p>OAS is a specification for describing APIs. It uses schema definitions (based on a JSON schema) to describe the structure of requests and responses. OpenAPI documents, also known as OpenAI Descriptions (OAD), can be written in JSON or YAML.</p>
<p>Here's an example in JSON format:</p>
<pre><code class="language-json">{
  "openapi": "3.2.0",
  "info": {
    "title": "Counter API",
    "version": "1.0.0",
    "description": "A simple API that stores and increments a counter."
  },
  "servers": [
    {
      "url": "https://api.example.com"
    }
  ],
  "paths": {
    "/counter": {
      "get": {
        "summary": "Get the current counter value",
        "operationId": "getCounter",
        "responses": {
          "200": {
            "description": "Current counter value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Counter"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Increment the counter",
        "operationId": "incrementCounter",
        "responses": {
          "200": {
            "description": "Updated counter value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Counter"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Counter": {
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "example": 42
          }
        },
        "required": ["value"]
      }
    }
  }
}
</code></pre>
<p>For YAML:</p>
<pre><code class="language-yaml">openapi: 3.2.0

info:
  title: Counter API
  version: 1.0.0
  description: A simple API that stores and increments a counter.

servers:
  - url: https://api.example.com

paths:
  /counter:
    get:
      summary: Get the current counter value
      operationId: getCounter
      responses:
        "200":
          description: Current counter value
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Counter"

    post:
      summary: Increment the counter
      operationId: incrementCounter
      responses:
        "200":
          description: Updated counter value
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Counter"

components:
  schemas:
    Counter:
      type: object
      properties:
        value:
          type: integer
          example: 42
      required:
        - value
</code></pre>
<p>Here, we have one schema object, a counter. This schema object describes the structure of the request and response the API should receive and send, respectively.</p>
<p>The OAD describes an API for a simple counter application with URL, “<code>https://api.example.com/counter</code>”, that accepts two HTTP methods: POST for increasing the counter, and GET for retrieving the current number in the counter.</p>
<h3 id="heading-azure-resource-manager-arm-templates">Azure Resource Manager (ARM) Templates</h3>
<p>The Azure Resource Manager (ARM) is responsible for creating, deleting, and updating resources in an Azure account. The Azure portal, REST clients, Azure Powershell, and Azure CLI all depend on it to provision resources. You can also define templates for the provisioning of infrastructure using the ARM template.</p>
<p>The ARM template is a JSON file that declaratively defines the infrastructure and configuration of a project. It defines the resources to be deployed to a tenant, resource group, subscription, or management group.</p>
<p>Here’s an example of an ARM template. This is an example from the documentation:</p>
<pre><code class="language-json">
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]"
    }
  },
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2025-06-01",
      "name": "mystorageaccount",
      "location": "[parameters('location')]",
      "sku": {
        "name": "Standard_LRS"
      },
      "kind": "StorageV2"
    }
  ]
}
</code></pre>
<p>This template creates a storage account of name <code>mystorageaccount</code>, using the location of the resource group as the location for the storage account.</p>
<p>As you can see, it has a schema keyword that links to the JSON schema created by the Azure team for the validation of the ARM templates. So, when a template is to be deployed, it's validated against that schema.</p>
<h2 id="heading-the-json-schema-project">The JSON Schema Project</h2>
<p>It's easy to confuse a JSON schema as a concept with the JSON Schema Project. But JSON Schema is an open source project that works closely with the Internet Engineering Task Force (IETF). Its aim is to harmonize the specifications for building JSON schemas.</p>
<p>The point is that anyone building JSON schemas all over the world can use the same templates, assumptions, formats, and structure, which will increase the interoperability of systems that use JSON. And this is what JSON is all about as a file interchange format.</p>
<p>As you can see in the screenshot below, the Azure ARM template schema was built on top of a version of a JSON schema from the JSON Schema project:</p>
<img src="https://cdn.hashnode.com/uploads/covers/66d08331fe16681b64d858db/49cbf0f6-7dbe-4dfb-bf2b-f8d6204a44c4.png" alt="49cbf0f6-7dbe-4dfb-bf2b-f8d6204a44c4" style="display:block;margin:0 auto" width="887" height="610" loading="lazy">

<p>To learn more about the JSON Schema project, you can visit their <a href="https://json-schema.org/">website</a>.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>JSON schemas are used all around the world, but they're often not well-understood or talked about. Schemas are a foundational technology relied on by APIs and projects like OpenAPI, AsyncAPI, HL7 FHIR and SDFormat, so they're worth learning about as a dev. Share this article if you enjoyed it. You can also reach out to me on <a href="https://linkedin.com/in/chidiadi-anyanwu">LinkedIn</a> or <a href="https://x.com/chidiadi01">X</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Handle Breaking Changes for API and Event Schemas ]]>
                </title>
                <description>
                    <![CDATA[ Several years ago while designing APIs for an ecommerce company, I discovered the importance of API versioning. So I wrote about it in a freeCodeCamp article entitled How to Version a REST API.  Now I find myself designing event schemas for sending m... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-handle-breaking-changes/</link>
                <guid isPermaLink="false">66bccb69ec0f48126680c59a</guid>
                
                    <category>
                        <![CDATA[ api ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Microservices ]]>
                    </category>
                
                    <category>
                        <![CDATA[ schema ]]>
                    </category>
                
                    <category>
                        <![CDATA[ versioning ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tim Kleier ]]>
                </dc:creator>
                <pubDate>Thu, 19 Oct 2023 14:18:25 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/10/7115374283_30d07f11c3_c-2.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Several years ago while designing APIs for an ecommerce company, I discovered the importance of API versioning. So I wrote about it in a <a target="_blank" href="https://www.freecodecamp.org/news">freeCodeCamp</a> article entitled <a target="_blank" href="https://www.freecodecamp.org/news/how-to-version-a-rest-api/">How to Version a REST API</a>. </p>
<p>Now I find myself designing event schemas for sending messages across a distributed system. It's a very similar problem with similar pain points and solutions. Adhering to data contracts is critical to ensure we don't frustrate event subscribers or bring down systems.</p>
<p>Versioning APIs is translatable to versioning event schemas, but if you can effectively evolve schemas, you don't actually need versioning. Effective evolution of schemas comes down to avoiding breaking changes. </p>
<p>Though I covered that briefly in the article above, here I want to thoroughly address breaking changes and propose more solutions to avoiding them.</p>
<h2 id="heading-what-are-breaking-changes">What are Breaking Changes?</h2>
<p>Essentially, a breaking change to a schema (in an API or event context) is anything that requires a consumer to make an update on their end. It's a change that forces change. Schemas will evolve, but once a schema is in use in production, you have to be very careful not to break the data contract. </p>
<p>Removing an event format or changing an event's basic structure constitutes a breaking change. But the nuts and bolts are at the attribute (the field or property) level. </p>
<h3 id="heading-structural-breaking-changes">Structural breaking changes</h3>
<p>Here's a list of structural breaking changes for schema attributes:</p>
<ul>
<li><strong>Renaming Attributes</strong> – Changes to an attribute's name, even if it's just changing the case (for example, from camelCase to TitleCase), is a breaking change.</li>
<li><strong>Removing Attributes</strong> – Taking an attribute out of a schema.</li>
<li><strong>Data Types Changes</strong> – Changing data types, even if the change seems compatible.</li>
<li><strong>Making Attributes Required</strong> – Anytime you mark an attribute (even a new one) as required when it wasn't before, it's a breaking change.</li>
</ul>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Example</td></tr>
</thead>
<tbody>
<tr>
<td>Renaming Attributes</td><td><code>name</code> to <code>firstName</code></td></tr>
<tr>
<td>Removing Attributes</td><td>Introducing <code>firstName</code> but removing <code>name</code></td></tr>
<tr>
<td>Data Type Changes</td><td>Changing <code>productSKU</code> from <code>integer</code> to <code>string</code></td></tr>
<tr>
<td>Making Attributes Required</td><td>Now requiring a <code>customerID</code></td></tr>
</tbody>
</table>
</div><h3 id="heading-semantic-breaking-changes">Semantic breaking changes</h3>
<p>The other primary category of attribute-level breaking changes has to do with changes in what the data means, or semantic changes. They force consumers to re-interpret the data they're getting. </p>
<p>They are as follows:</p>
<ul>
<li><strong>Format Changes</strong> – Any change to the format of an attribute. </li>
<li><strong>Meaning Changes</strong> – When the declared or implied meaning of data changes.</li>
<li><strong>Stricter Constraints</strong> – When attribute requirements are added or made more restrictive.</li>
</ul>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Example</td></tr>
</thead>
<tbody>
<tr>
<td>Format Changes</td><td>Date from <code>mm/dd/yyyy</code> to <code>yyyy-mm-dd</code></td></tr>
<tr>
<td>Meaning Changes</td><td>Changing an enum, changing <code>providerCost</code> from dollars to cents</td></tr>
<tr>
<td>Stricter Constraints</td><td>Adding <code>percentage</code> maximum of 100 </td></tr>
</tbody>
</table>
</div><p>It's important to note that what counts as a "breaking change" might be more nuanced. Changing an <code>amount</code> from dollars to cents still forces a change by event subscribers, in interpreting the <em>meaning</em> of the data being sent. Be careful of those, as they are not always obvious.</p>
<h2 id="heading-what-are-non-breaking-changes">What are Non-Breaking Changes?</h2>
<p>We can generally describe non-breaking changes as additive or permissive ones. These are changes that don't require change for consumers. </p>
<p>Here is a list of non-breaking attribute changes: </p>
<ul>
<li><strong>Adding New Attribute</strong> – In all schema contexts, the addition of a new attribute is a non-breaking change, so long as it's not required (for example, for a POST request). </li>
<li><strong>Making Attribute Not Required</strong> – When an attribute was required but newer schema versions do not require it.</li>
<li><strong>Looser Constraints</strong> – Things like more permissive integer ranges (min and max) or allowing for greater decimal precision. Be cautious and communicate with consumers, though, as they may rely on stricter constraints.</li>
</ul>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Example</td></tr>
</thead>
<tbody>
<tr>
<td>Adding New Attribute</td><td>Adding <code>firstName</code> alongside <code>name</code></td></tr>
<tr>
<td>Making Attribute Not Required</td><td><code>customerID</code> is no longer required</td></tr>
<tr>
<td>Looser Constraints</td><td>Percentage max increased from 100 to 200</td></tr>
</tbody>
</table>
</div><p>Non-breaking changes can often be avoided. But evolving schemas effectively can be challenging and require a lot of thought so as not to break schemas and consumers' trust.</p>
<h2 id="heading-how-to-evolve-schemas">How to Evolve Schemas</h2>
<p>Sadly, the list of breaking changes is longer than the non-breaking ones. But there are some strategies for evolving schemas in a non-breaking way.</p>
<ol>
<li><strong>Domain Knowledge</strong> – Understanding the domain will help ensure you don't end up with poorly named attributes, attributes on the wrong object, or incorrect data types.</li>
<li><strong>Specific Attribute Names</strong> – Rather than changing an attribute's name, data type, or format, introduce a new attribute with a more specific name and correct the data type or format.</li>
<li><strong>Attribute Names With Intent</strong> – Leverage attribute names that reflect their format or intent. For example, consumers might not know whether <code>providerCost</code> would be in dollars or cents, so specify with <code>providerCostInDollars</code> or <code>providerCostInCents</code>. This will also prevent a breaking change if you're having calculation precision issues with dollars and decide to deliver the cost in cents. </li>
<li><strong>Drafted Schemas &amp; Attributes</strong> – Utilize "draft mode" extensively at the schema level, getting feedback on attributes in simulated environments before they are live in production. For schemas that are in use in production, you could introduce a <code>draftedAttributes</code> object and dump experimental (non-production ready) attributes into it. Communicate with consumers that they attributes are being refined – so they should expect breaking changes – and will be moved to the main schema when ready.</li>
<li><strong>Support Existing Attributes</strong> – Leave old attributes in the schema. Don't remove old attributes unless you've been able to coordinate a deprecation/sunsetting strategy with consumers.</li>
<li><strong>Versioning</strong> – If necessary, version your schemas. Although it can become quite difficult to maintain, versioning your schemas is a way to allow for backwards compatibility but move forward with a new schema. You can do high-level versioning (for example, v1 and v2) or more granular semantic versioning (for example, v1.0.1). It's best to version each schema independently, so you don't have to, for example, copy all API v1 endpoints to v2. </li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Breaking changes are a quick way to break trust for any API consumers or event subscribers. I hope that the guidelines above will provide more insight what constitutes a breaking versus non-breaking change, and how to evolve schemas effectively.</p>
<p>If you can't avoid breaking changes, <strong>make sure to coordinate with any and all consumers.</strong> You can actually earn more trust with your consumers if you effectively evolve schemas and communicate breaking changes when they are necessary. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Why Using Structured Data Helps Your Website’s SEO ]]>
                </title>
                <description>
                    <![CDATA[ Few things are as exciting for a new developer as getting their first customers. The idea of putting one’s new coding knowledge to work can be exhilarating. There’s an important thing to remember though, especially if your customer is some type of sm... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/using-structured-data-helps-your-websites-seo/</link>
                <guid isPermaLink="false">66d4601dffe6b1f641b5fa28</guid>
                
                    <category>
                        <![CDATA[ schema ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SEO ]]>
                    </category>
                
                    <category>
                        <![CDATA[ structured data ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Luke Ciciliano ]]>
                </dc:creator>
                <pubDate>Wed, 28 Aug 2019 18:21:57 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2019/08/seo-and-ipad-1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Few things are as exciting for a new developer as getting their first customers. The idea of putting one’s new coding knowledge to work can be exhilarating.</p>
<p>There’s an important thing to remember though, especially if your customer is some type of small business which deals with the public (such as a restaurant, a bakery, and so on). That thing to remember is that the customer probably doesn’t care about HTML, CSS, or JavaScript. They care about whether the website performs well in search and whether customers come into their business as a result.</p>
<p>This means that you need to build the website with search engine optimization (SEO) in mind. One of the bigger developments recently in the area of SEO is Google’s increasing use of “structured data” in its analysis of websites. This trend made me decide to write this article on the use of structured data in your various web projects.</p>
<p>I’m going to divide this discussion up into four sections. The areas I’m going to delve into include:</p>
<ol>
<li><p>What is structured data and why does Google care about it?</p>
</li>
<li><p>How to use structured data in a website.</p>
</li>
<li><p>How to test your structured data and monitor for errors after the site launches.</p>
</li>
<li><p>The need to keep your structured data up to date after the website launches.</p>
</li>
</ol>
<p>This is an important discussion to have. I find that many, many, many, many……(many) people who hold themselves out as web developers don’t actually know much (if anything) about SEO.</p>
<p>I also find that many people who hold themselves out as assisting with SEO don’t actually know anything about web development (and often can barely code at all).</p>
<p>Someone who can actually code, and who understands what the search engines are looking for, can provide a great deal of value to their customers. This value, in turn, helps you to make more money as a developer. In other words, pairing an understanding of SEO with your newly learned web development skills can help you go from looking like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Computer-with-help-sign.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>To looking like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/computer-and-money.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>So let’s get to it and discuss why structured data is important to a website’s SEO.</p>
<h3 id="heading-what-is-structured-data-and-why-does-google-care-about-it">What is structured data and why does Google care about it?</h3>
<p>Structured data is form of markup you can apply to your website’s content. This markup allows you to provide information to search engines about your web pages and the information they contain.</p>
<p>This markup is important because search engines, while getting better at understanding natural language, can struggle with understanding the wording or other content contained within a web page.</p>
<p>For example, if someone is searching for “professional to help with investing,” search engines may struggle to distinguish between sites which belong to investment managers and sites which discuss how to pick an investment manager in general (this is a very generalized example).</p>
<p>By using structured data, you can help Google know that your website actually belongs to an investment manager.</p>
<p>Another purpose of structured data is that it helps search engines identify who is who on the web. Suppose, for example, you're doing a website for a political candidate. The candidate, in addition to an official campaign website, has an official Facebook page for the campaign.</p>
<p>For obvious reasons, there may be people who start false Facebook pages about the candidate. By including certain structured data in the website, you can create a relational link between the official Facebook page and the campaign’s website. This helps the search engines to know which Facebook page is legit and which one is bogus.</p>
<p>Google has been working to identify who is who on the web for roughly a decade. This started with their now defunct social network, Google+ (you know…..that social network that you may have tried but none of your friends were on).</p>
<p>Back in the early part of this decade, if a website included a link to a Google+ profile, and the link included the “rel=author” attribute, the link informed Google that the website belonged to the holder of the Google+ profile. This was something Google intended to ratchet up in search, as one of their executives explained in this 2013 video:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/3QlY8ba0jYI" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<p>Google abandoned this approach, mainly due to the struggles of Google+, in August of 2014. Since that time, Google has been increasing its emphasis on structured data as a way of annotating information in search results and identifying who is who on the web.</p>
<p>So, in short, structured data is something you should be including to add value to any website you build for your clients.</p>
<h3 id="heading-how-to-use-structured-data-in-a-website">How to use structured data in a website</h3>
<p>Structured data can be used in a number of ways. In addition to using it to help identify the individual or entity operating the site, you can use it to help Google better understand a page’s content.</p>
<p>If, for example, you’ve built a website for a bakery, then there are types of markup you can use to highlight the business’ good reviews, to highlight upcoming events, and so on. This markup can lead to highlights in search results which, in turn, will make your customer (the bakery owner) happy.</p>
<p>Let’s look at a few examples of what this looks like in real life, using a <a target="_blank" href="https://www.dayton-real-estate-agent.com/">real estate agent website</a> which I recently built (I'm including the link in case you want to take a look at the code).</p>
<p>The realtor I built the website for focuses her business on dealing with investors. The website includes structured data which informs Google that the site belongs to an actual real estate agent. When I perform a Google search for “Dayton realtor for investors,” the top three organic results I receive are as shown in this photo:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Investor-search.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The first result is the website I built. The latter two are websites which do not belong to actual real estate agents, even though that is what I was clearly looking for with my search term. In fact, only one other realtor website even appears on the first page of the search results. Now, I’m not saying that this is entirely due to the structured data, but it certainly helps.</p>
<p>The markup used for structured data is generated/governed by <a target="_blank" href="https://schema.org/">Schema.org</a>. When you’re marking up a site, an individual page, an event, or a product, it’s important to use as much markup as is <em>reasonably</em> possible in order to provide the search engines with relevant information.</p>
<p>Schema.org's website often provides examples of what your markup should look like. The start of the markup that I used for the realtor site involved informing Google that the site belonged to a real estate agent by placing the following inside of a</p>
<p>:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">itemscope</span> <span class="hljs-attr">itemtype</span>=<span class="hljs-string">http://schema.org/RealEstateAgent</span>&gt;</span>
</code></pre>
<p>This tells the search engines that I am relying on schema’s markup to identify and describe the site and that the site belongs to a real estate agent, as defined by schema <a target="_blank" href="https://schema.org/RealEstateAgent">here</a>.</p>
<p>I was also able to use structured data to tell Google that this realtor has good online reviews and that they work on commission. This, in turn, is now showing up in search results.</p>
<p>For example, the page at the following link is on the first page of search when I look for <a target="_blank" href="https://www.dayton-real-estate-agent.com/apartments-multi-family-homes-for-sale/">Dayton apartments for sale</a>. (Again, I'm including this link in case you want to look at the site's source code).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/multifamily-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Notice that the search results include the fact that this is a five-star rated realtor and that the professional works on commission? In other words, the use of structured data helps the site to stand out more in the search results. This information was added to the site with the following markup:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">itemprop</span>=<span class="hljs-string">"aggregateRating"</span> <span class="hljs-attr">itemscope</span> <span class="hljs-attr">itemtype</span>=<span class="hljs-string">"http://schema.org/AggregateRating"</span>&gt;</span>
Rated <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">itemprop</span>=<span class="hljs-string">"ratingValue"</span>&gt;</span>Actual Rating of Realtor<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span> out of <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">itemprop</span>=<span class="hljs-string">"bestRating"</span>&gt;</span>Highest Possible Rating of Realtor<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span> by <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">itemprop</span>=<span class="hljs-string">"ratingCount"</span>&gt;</span>Number of Total Reviews<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span> clients at <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"URL of Website Where Reviews Are Located"</span> <span class="hljs-attr">target</span>=<span class="hljs-string">"_blank"</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"noopener"</span>&gt;</span>Name of Website Where Reviews Are Located<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
Fee Structure: <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">itemprop</span>=<span class="hljs-string">"priceRange"</span>&gt;</span>Commission<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>Figuring out what structured data to use in a site, or on a particular page, can be difficult. Fortunately, Google gives a few tools that help with this. Let’s look at those tools in the following section of this article.</p>
<h3 id="heading-testing-your-structured-data-and-monitoring-it-after-your-site-launches">Testing your structured data and monitoring it after your site launches</h3>
<p>The first step in adding structured data to your content is to figure out the category it falls into. You can do this by researching the Schema.org website, looking at the data from other websites, or a combination of both. Once you find the category you fall into, the rest is pretty easy. Let’s stick with the real estate agent example from above.</p>
<p>The first step is to add the realtor markup, from Schema, the site. Then enter your url into <a target="_blank" href="https://search.google.com/structured-data/testing-tool">Google’s structured data testing tool</a>. The tool will tell you what structured data has been found on your site, what errors you may have, and what structured data is “suggested” for the category you’ve selected. Once you start using this tool, you’ll find that making sure you have the right information in the website becomes fairly simple and straightforward.</p>
<p>Also, I heavily rely on the examples which Schema provides for various categories and data types. Using Google’s testing tool can help you to make sure that you have the correct data in your site from the get go.</p>
<p>Another important tool, in monitoring for errors, is <a target="_blank" href="https://search.google.com/search-console/about">Google Search Console</a>. This is another developer tool, from Google, that will let you know when structured data errors appear on your website after launch. This is an incredibly useful tool and if you’re supporting your client’s website on an ongoing basis, after launch, then you need to be using it to monitor things.</p>
<h3 id="heading-the-need-to-keep-your-structured-data-up-to-date-after-a-website-launches">The need to keep your structured data up to date after a website launches</h3>
<p>It is important to understand that you may need to go back and edit a site’s older structured data after a site launches. This is because, like many other things, the standards for structured data change over time. As an example, I build and maintain websites for law firms as part of my primary business. Under the prior structured data standards, these websites were marked up with the following:</p>
<p>In later revisions to the structured data standards, however, the “Attorney” classification was deprecated and changed to “LegalService” – as such, I had to change the markup on each website I manage. I tell you this because it’s important to realize that these standards change somewhat often. It’s important that you keep up with the changes.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Web results are becoming increasingly rich in that they provide more information than just a link to a website. It’s important for your clients that you markup your pages accordingly. Doing so is important to your SEO efforts and to providing value to your customers. This is why it’s important to include structured data in your projects.</p>
<h3 id="heading-about-me">About Me</h3>
<p>I am a web developer who primarily provides various types of services to law firms. I am also a co-founder of <a target="_blank" href="https://www.modern-website.design/">Modern Website Design</a>. I enjoy writing on issues which help freelance developers and small businesses to grow their revenue.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
