Entity Validation logo

Backstage Entity Validation Plugin

Created by Spreadgroup

Entity Validation checks that your Backstage entity YAML follows the catalog schema before it ever reaches the catalog. It catches missing keys, wrong types, and other schema issues early. This saves review time and prevents broken pages in your portal. Under the hood it uses the same validation that the catalog exposes through its validate entity endpoint, so results match what Backstage expects.

The Entity Validation plugin adds a simple page inside Backstage where you paste or load entity YAML, then run a check with one click. It returns clear errors and warnings with context, so you can fix problems fast. You can keep a default snippet for your org, hide the file location input when not needed, and embed the validator inside other pages through a reusable content component. The goal is fast feedback right where engineers work.

Typical use cases include helping teams author new catalog files with confidence, reviewing pull requests that add or change entities, and migrating to new schema versions across many services. It is useful during onboarding since developers can explore what a valid descriptor looks like and see immediate results from small edits. Platform teams can link to the validator from docs or DevTools, so engineers do not need to switch tools while they work.

Installation Instructions

These instructions apply to self-hosted Backstage only.

Install the frontend package

Run this from your Backstage root

Copy
yarn --cwd packages/app add @backstage-community/plugin-entity-validation

Add the route

Open packages/app/src/App.tsx

Import the page and add a route

Copy
// packages/app/src/App.tsx
import React from 'react';
import { FlatRoutes, Route } from '@backstage/core-app-api';
import { EntityValidationPage } from '@backstage-community/plugin-entity-validation';

export const routes = (
  <FlatRoutes>
    {/* other routes */}
    <Route path="/entity-validation" element={<EntityValidationPage />} />
  </FlatRoutes>
);

You can pass options if you need them

Copy
<Route
  path="/entity-validation"
  element={
    <EntityValidationPage
      defaultYaml="apiVersion v1
kind Component"
      defaultLocation="url:https://example.com/catalog-info.yaml"
      hideFileLocationField
    />
  }
/>

Open packages/app/src/components/Root/Root.tsx

Add a menu item that points to the new route

Copy
// packages/app/src/components/Root/Root.tsx
import React, { PropsWithChildren } from 'react';
import { Sidebar, SidebarItem, SidebarDivider, SidebarGroup, SidebarPage } from '@backstage/core-components';
import MenuIcon from '@material-ui/icons/Menu';
import BuildIcon from '@material-ui/icons/Build';

export const Root = ({ children }: PropsWithChildren<{}>) => (
  <SidebarPage>
    <Sidebar>
      <SidebarGroup label="Menu" icon={<MenuIcon />}>
        {/* other sidebars */}
        <SidebarItem icon={BuildIcon} to="entity-validation" text="Validator" />
        <SidebarDivider />
      </SidebarGroup>
    </Sidebar>
    {children}
  </SidebarPage>
);

Embed inside DevTools optional

If you use the DevTools plugin you can embed the validator there

Import the content component and add a route inside your custom DevTools page

Copy
// packages/app/src/components/devtools/CustomDevToolsPage.tsx
import React from 'react';
import { DevToolsLayout } from '@backstage/plugin-devtools';
import { Typography } from '@material-ui/core';
import { EntityValidationContent } from '@backstage-community/plugin-entity-validation';

export const CustomDevToolsPage = () => (
  <DevToolsLayout>
    {/* other DevTools routes */}
    <DevToolsLayout.Route path="entity-validation" title="Entity Validation">
      <EntityValidationContent
        contentHead={<Typography variant="h6">Entity Validation</Typography>}
      />
    </DevToolsLayout.Route>
  </DevToolsLayout>
);

Changelog

This changelog is produced from commits made to the Entity Validation plugin since a year ago, and based on the code located here. It may not contain information about all commits. Releases and version bumps are intentionally omitted. This changelog is generated by AI.

Maintenance

  • Remove unused dev dependency canvas. #3565 merged 5 months ago
  • Update repo tools to reduce false positives in knip reports. #3018 merged 6 months ago

Set up Backstage in minutes with Roadie