0xPlaygrounds / 0xPlaygrounds/rig
feat: Better typing for JSON Schema
- 主要言語
- Rust
- スター
- 8.6k
- フォーク
- 959
- 平均マージ
- 4時間 32分
- マージ済み PR(30日)
- 117
説明
- [x] I have looked for existing issues (including closed) about this
## Feature Request
Right now the schemas are just serde_json::Value. I am wondering if it would be worth either building primitives to better type that or at least verify that this is a valid JSON Schema.
### Motivation
The JSON value is very barebone and doesn't offer a lot of security/guard rails for the user. It is even worse if you have to accept user provided data for tools.
That would also allow us to transform the schema if need be for each provider, though most of them seem to support part of the JSON Schema (at whatever draft version it is at right now).
### Proposal
1. We could start with a custom wrapper around the Value that would check with [jsonschema](https://docs.rs/jsonschema/latest/jsonschema/) that it is a valid JSON Schema
2. We could build/contribute to an existing crate a macro/builder for JSON Schema and a parser for it (similar to what [valico](https://github.com/s-panferov/valico) offers
### Alternatives
- The user needs to do it's own parsing
コントリビューションガイド
調査の方向性
Look at how JSON schemas are currently used in the codebase, likely as serde_json::Value. Examine the jsonschema crate for validation. Start by exploring the existing schema handling in the code, then design a wrapper type that validates schemas. Check if there are existing tests for schema-related functionality to understand the expected behavior.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- backend-api-design
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100