ag-ui-protocol / ag-ui-protocol/ag-ui

[Feature]: [rust-sdk] Support optional feature flags for core crate to derive protocol types with utoipa + schemars

未關閉
#1,407 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
Python
星號
15.9k
分支
1.4k
平均合併
1 天 17 小時
30 天內合併 PR
163

描述

### Pre-flight Checklist

- [x] I have searched existing issues and this hasn't been requested yet.

### Problem or Motivation

Currently the protocol types in the `ag-ui-core` crate in the Rust SDK are serializable but do not interoperate in presentation layers that depend on utilities like utoipa or schemars. This means those types can not be used directly in those layers, requiring developers to redefine the exact same shapes in their own structs instead of simply reusing the core crate.

### Proposed Solution

It would be ideal if the core crate supported two optional feature flags, `utoipa` and `schemars` that conditionally adds the derives for `utoipa::ToSchema` and `schemars::JsonSchema` to all of the serializable types.

### Alternatives Considered

The only possible workaround is to redefine the exact same types manually in your own project, requiring maintenance time when the protocol changes.

### Additional Context

I am willing to open a PR with these changes as they are very small.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。