-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Set up the Rust package for OXA types using typify for code generation from JSON Schema. Create packages/oxa-types-rs/ with:
Cargo.toml
- Package name:
oxa-types - Dependencies:
serde,serde_json
src/lib.rs (generated)
- Rust types generated from JSON Schema using
typify - Proper serde attributes for JSON serialization
- Tagged enums for Block/Inline union types
Codegen integration
- Implement
scripts/lib/generate-rs.tsto invoke the generate-rs binary - The
scripts/lib/generate-rs.rsbinary uses typify to generate Rust code. Avoid having Rust as a hard dependency (skip if not available) - Register in
scripts/codegen.tsgenerators array - Add
pnpm codegen rscommand
Tasks
- Create
packages/oxa-types-rs/Cargo.toml - Create placeholder
packages/oxa-types-rs/src/lib.rs - Implement
scripts/lib/generate-rs.tsto invoke Rust binary - Complete
scripts/lib/generate-rs.rstypify implementation - Register Rust generator in
scripts/codegen.ts - Run
pnpm codegen rsand verify generated types - Verify
cargo buildsucceeds for the package
Metadata
Metadata
Assignees
Labels
No labels