chore(config): externalize entity schema#56
Conversation
Co-authored-by: Copilot <copilot@github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughTwo JSON Schema files were added for API key and model configurations, and two Rust modules were updated to parse those schemas at compile time via Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/config/entities/models.rs`:
- Around line 20-21: The SCHEMA static currently wraps the file text as a JSON
string via json!(include_str!("models-schema.json")), which yields a
Value::String and breaks jsonschema::validator_for(); change SCHEMA's
initializer to parse the file text with
serde_json::from_str(include_str!("models-schema.json")) and unwrap/expect on
parse errors so SCHEMA is a proper serde_json::Value (object/boolean) usable by
the validator (refer to SCHEMA and LazyLock in models.rs and the
models-schema.json asset).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0d5de95f-bf11-42ad-b8a2-aa3cefa6255b
📒 Files selected for processing (4)
src/config/entities/apikeys-schema.jsonsrc/config/entities/apikeys.rssrc/config/entities/models-schema.jsonsrc/config/entities/models.rs
Summary by CodeRabbit