-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Milestone
Description
Summary
Integrate JSON Schema v2 I/O with the existing import/export operators.
Background
Updated 2026-01-13: The approach has changed per #89 decision.
- Dataclass schemas are NOT required (pm.data + ParsedData suffices)
- Focus on converter/serializer using existing infrastructure
Current State
core/schema.py- SchemaProp, ParsedData for pm.data accessinfra/compat.py- PME1 → PME2 migration (fix_2_0_0,fix_json_2_0_0)api/validation.py- JSON validation API (stub, PR feat(api): enhance pme public API with types submodule and structured modules #99)
Tasks
Import Integration
- Modify
WM_OT_pm_importto useinfra/compat.pymigration - Add v1/v2 format auto-detection (see
validation.pyW301 warning) - Show conversion warnings to user
Export Integration
- Modify
WM_OT_pm_exportto support v2 format - Add export format selection UI (v1/v2)
- Implement PMItem → JSON v2 dict conversion
Validation API (PR #99)
- Implement full validation in
api/validation.py- Currently stub: only format detection and basic checks
- Need: field validation, reference checking per ERROR_CODES
Serializer Module
- Create
infra/serializer.pyfor high-level export/import -
export_v2()- Export menus to PME2 JSON dict -
import_json()- Import with auto-detection and migration
Related
- Schema v2: PME1 to PME2 converter #83 - PME1 converter (partial in
infra/compat.py) - Phase 9-X: Internal Implementation Strategy - pm.data as settings carrier #89 - pm.data strategy (CLOSED - decided: no dataclass schemas)
- feat(api): enhance pme public API with types submodule and structured modules #99 - API enhancements including validation.py stub
Files
| File | Purpose |
|---|---|
operators/io.py |
Import/export operators |
infra/io.py |
File I/O utilities |
infra/compat.py |
Migration functions |
api/validation.py |
JSON validation (stub) |
Notes
This is the main work remaining for 2.0.0 JSON Schema v2 support:
- Users can export in new v2 format
- Importing v1 files auto-converts to v2 internally
- Round-trip (export v2 → import) is fully supported
pme.validate_json()provides pre-import validation
Out of Scope (2.0.1+)
Per #89 decision:
- Dataclass schemas (
core/schemas/) - NOT needed - Complex WM_OT state machine redesign
Metadata
Metadata
Assignees
Labels
No labels