9 releases (5 breaking)
| 0.6.0 | Feb 25, 2026 |
|---|---|
| 0.5.0 | Feb 3, 2026 |
| 0.4.0 | Jan 26, 2026 |
| 0.3.1 | Jan 20, 2026 |
| 0.1.6 | Dec 31, 2025 |
#1634 in Game dev
Used in 3 crates
140KB
3K
SLoC
bevy_map_schema
Schema validation for entity properties in the bevy_map_editor ecosystem.
Part of bevy_map_editor.
Features
- JSON-based schema definitions
- Type validation (String, Int, Float, Bool, Color, Enum)
- Required/optional properties with defaults
- Custom enum definitions
- Numeric constraints (min/max)
Property Types
| Type | Description |
|---|---|
string |
Text value |
int |
Integer number |
float |
Decimal number |
bool |
True/false |
color |
Hex color (#RRGGBB) |
enum |
Custom enum type |
Schema Format
Define entity types in your map project:
{
"schema": {
"data_types": {
"Enemy": {
"color": "#FF0000",
"placeable": true,
"marker_size": 16,
"properties": [
{ "name": "name", "type": "string", "required": true },
{ "name": "health", "type": "int", "default": 100 },
{ "name": "speed", "type": "float", "default": 1.0 },
{ "name": "aggressive", "type": "bool", "default": true }
]
}
},
"enums": {
"Direction": ["North", "South", "East", "West"]
}
}
}
Usage
use bevy_map_schema::{Schema, TypeDef, PropertyDef};
// Schemas are typically loaded from map project files
// The editor validates properties against the schema
Integration
The schema is embedded in .map.json files and used by:
- Editor: Shows appropriate UI controls for each property type
- Runtime: Validates entity properties when loading maps
License
MIT OR Apache-2.0
Dependencies
~25MB
~522K SLoC