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§
- Project
Config - Project-level configuration from schema
- Property
Def - 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§
- Prop
Type - Property types supported by the schema
- Schema
Error - Errors that can occur when loading or validating schemas
- Value
- Generic property value (JSON-like but typed)
- Viewport
Display Mode - 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