Skip to main content

Crate bevy_map_schema

Crate bevy_map_schema 

Source
Expand description

Schema validation for bevy_map_editor

This crate provides schema definitions and validation for entity types used in bevy_map_editor. It allows defining data types with properties that can be validated at load time.

§Example

use bevy_map_schema::{Schema, load_schema, validate_instance};
use bevy_map_core::EntityInstance;

// Load schema from JSON
let schema = load_schema("schema.json")?;

// Validate an entity instance against the schema
let entity = EntityInstance::new("NPC".to_string(), [100.0, 200.0]);
schema.validate_entity(&entity)?;

Structs§

ProjectConfig
Project-level configuration from schema
PropertyDef
Definition of a property (from schema)
Schema
The schema loaded from schema.json - defines all types and enums
TypeDef
Definition of a type (from schema)

Enums§

PropType
Property types supported by the schema
SchemaError
Errors that can occur when loading or validating schemas
Value
Generic property value (JSON-like but typed)
ViewportDisplayMode
How an entity type should be displayed in the viewport

Functions§

load_schema
Load a schema from a JSON file
load_schema_from_bytes
Load a schema from bytes
parse_schema
Parse a schema from a JSON string
save_schema
Save a schema to a JSON file
validate_instance
Validate an entity instance against the schema
validate_schema
Validate that the schema is internally consistent