bevy_map_schema

Crates.iobevy_map_schema
lib.rsbevy_map_schema
version0.3.1
created_at2025-12-22 10:34:57.22199+00
updated_at2026-01-20 11:17:53.442986+00
descriptionSchema validation for bevy_map_editor entity types
homepage
repositoryhttps://github.com/jbuehler23/bevy_map_editor
max_upload_size
id1999495
size165,061
Joe Buehler (jbuehler23)

documentation

README

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

Commit count: 75

cargo fmt