Schemas
Logical object models for Meshery
Install / Use
/learn @meshery/SchemasREADME
Meshery Schemas
Meshery follows schema-driven development. As a project, Meshery has different types of schemas. Some schemas are external facing, and some internal to Meshery itself. This repository serves as a central location for storing schemas from which all Meshery components can take reference.
Meshery schemas offer a powerful system designed for:
- Model-Driven Management: Meshery uses explicit models for describing infrastructure and applications.
- Dynamic Discovery: The ability to process different kinds of relationships and styles, enables a sophisticated system that can adapt to many configurations.
- Lifecycle Management: The schema properties track status and lifecycle of resources.
- Extensibility: Open-ended metadata and modular schema components enable expansion and customization.
- Visual Representation: The properties for styling of edges and nodes is for creating a user friendly visual representation.
- Automated Operations: The schemas can support validation and automated configuration of infrastructure and applications, and patching.
For an explanation of Meshery's terminology regarding schemas, definitions, declarations, and instances, please see Contributor's Guide to Models.
Contributing
--> For an explanation of the directory structure of this repository and how to contribute changes to Meshery's schemas, see Contributor's Guide to Schema-Driven Development.
<p style="clear:both;"> </p>Join the Meshery community!
<a name="contributing"></a><a name="community"></a> Our projects are community-built and welcome collaboration. 👍 Be sure to see the <a href="https://docs.meshery.io/project/contributing#not-sure-where-to-start">Contributor Welcome Guide</a> and <a href="https://meshery.io/community#handbook">Community Handbook</a> for a tour of resources available to you. Jump into community <a href="https://slack.meshery.io">Slack</a> or <a href="https://meshery.io/community#discussion-forums">discussion forum</a> to participate.
<p style="clear:both;"> <h3>Find your MeshMate</h3> <p>MeshMates are experienced community members, who will help you learn your way around, discover live projects, and expand your community network. Connect with a Meshmate today!</p>Find out more on the <a href="https://meshery.io/community#meshmates">Meshery community</a>. <br />
</p> <br /><br /> <div style="display: flex; justify-content: center; align-items:center;"> <div> <a href="https://meshery.io/community"><img alt="Meshery Cloud Native Community" src="https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/community.png" width="140px" style="margin-right:36px; margin-bottom:7px;" width="140px" align="left"/></a> </div> <div style="width:60%; padding-left: 16px; padding-right: 16px"> <p> ✔️ <em><strong>Join</strong></em> any or all of the weekly meetings on <a href="https://meshery.io/calendar">community calendar</a>.<br /> ✔️ <em><strong>Watch</strong></em> community <a href="https://www.youtube.com/@mesheryio?sub_confirmation=1">meeting recordings</a>.<br /> ✔️ <em><strong>Fill-in</strong></em> a <a href="https://meshery.io/newcomers">community member form</a> to gain access to community resources. <br /> ✔️ <em><strong>Discuss</strong></em> in the <a href="https://meshery.io/community#discussion-forums">Community Forum</a>.<br /> ✔️ <em><strong>Explore more</strong></em> in the <a href="https://meshery.io/community#handbook">Community Handbook</a>.<br /> </p> <p align="center"> <i>Not sure where to start?</i> Grab an open issue with the <a href="https://github.com/issues?q=is%3Aopen%20is%3Aissue%20archived%3Afalse%20(org%3Ameshery%20OR%20org%3Aservice-mesh-performance%20OR%20org%3Aservice-mesh-patterns%20OR%20org%3Ameshery-extensions)%20label%3A%22help%20wanted%22">help-wanted label</a>. </p> </div> <div> </div>Contributing
Please do! We're a warm and welcoming community of open source contributors. All types of contributions are welcome. Please read:
- General Contributor Guide - Overview of contribution processes
- Schema Contributor Guide - Schema-specific development workflows and guidelines
🧬 Schema-Driven Development Guide
Meshery follows a Schema-Driven Development (SDD) approach. This means that the structure of data used throughout the system is centrally defined using schemas. These schemas power consistency, validation, and code generation across the Meshery platform.
🧾 Schema Definition in Meshery
Meshery uses the OpenAPI v3 specification to define and manage schemas. Given the complexity of the platform, Meshery adopts a modular, versioned, and extensible schema strategy:
- ✅ Versioned schemas for backward compatibility.
- 🧩 Modular constructs for maintainability and reuse.
- 🧪 Schemas are used for validation, API documentation, and automatic code generation.
💡 TIP: When referencing models or other constructs in the schema, always add
x-go-typeandx-go-import-pathto avoid generating redundant Go structs. Refer to existing patterns in the codebase.
📁 Schema Directory Structure
All schemas are located in the schemas/ directory at the root of the Meshery repository:
schemas/
constructs/
<schema-version>/ # e.g., v1beta1
<construct>/ # e.g., model, component
api.yml # Index file: references all subschemas + defines API endpoints
<construct>.yaml # Subschema: data model definition for the construct
<other_subschema>.yaml # Additional subschemas (optional)
templates/ # Manually defined templates directory
<construct>_template.json # JSON template from schema
<construct>_template.yaml # YAML template from schema
<variant>_template.json # Additional variant templates (optional)
typescript/ # TypeScript source and generated files
index.ts # Manually maintained - public API surface
generated/ # Auto-generated (do NOT commit)
<schema-version>/
<construct>/
<Construct>.d.ts # TypeScript type definitions
<Construct>Schema.ts # OpenAPI schema as JS object
rtk/ # RTK Query client configurations
cloud.ts
meshery.ts
dist/ # Built distribution (do NOT commi
