Add support for $schema and jsonSchemaDialect
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- csharp, openapi
调研方向
首先跟踪 OpenAPISchema 的反序列化器和序列化器,并确定应用 2020-12 假设的位置。围绕方言注册、回退解析、未知 schema 的递归处理以及安全约束来定义 JSON Schema 服务;当 $schema 和 jsonSchemaDialect 能够选择正确的已知或已加载方言,且不破坏现有行为时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
In today's implementation (2.11.0, 3.9.0), the deserialization and serialization of JSON Schemas is effectively hard-coded to 2020-12.
However, starting with OpenAPI 3.1, people can set the $schema property of any given schema to a different dialect (default being documented here.
This entails a couple of things:
- parsing that keyword first if it exists, or falling back on the document dialect property, or falling back to the default value for the OpenAPI version.
- if that value is known (like
https://spec.openapis.org/oas/3.1/dialect/baseusing the parsing logic associated with that entry - if that value is unknown, we need to load the corresponding schema, and read its schema (recursively) until we find a known value. (note be careful of the security considerations here)
Note: ideally we'd make the OpenAPISchema type generic and allow the caller to provide new registrations of schemas uris with the corresponding parsing logic and data type, but that'd introduce major breaking changes, making the cost prohibitive.
That update will most likely require introducing a JSON Schema service of some kind in charge of mapping the known schemas with their deserialization logic, and having the OpenAPISchema deserializers call into that service.
- 主要语言
- C#
- 星标
- 1.6k
- 派生
- 286
- 平均合并
- 6 小时 38 分钟
- 30 天内合并 PR
- 35
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/OpenAPI.NET 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · 1 条评论 · 1 个 reaction · 已指派 2 人 ·
-
type:breaking-change
难度 4/5 3-5 天 新手友好度 52/100
microsoft/OpenAPI.NET#3014 · 2 条评论 ·
-
help wanted
难度 5/5 一周以上 新手友好度 35/100
microsoft/OpenAPI.NET#2989 · 3 条评论 ·
-
help wanted type:feature
难度 3/5 1-2 天 新手友好度 55/100
microsoft/OpenAPI.NET#2967 · 18 条评论 · 1 个 reaction ·
查看 microsoft/OpenAPI.NET 的全部 Issue
相似的 Issue
-
:watch: Not Triaged dotnet-fsharp/svc
难度 1/5 1 小时以内 新手友好度 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
难度 2/5 1-3 小时 新手友好度 76/100
Azure/azure-sdk-for-net#63292 · 3 条评论 · 1 个 reaction ·
-
Issue-Enhancement Needs-Triage
难度 1/5 1 小时以内 新手友好度 86/100
PowerShell/PowerShell#28061 · 2 个 reaction ·
-
dependencies needs-team-triage server-Azure.Mcp
难度 2/5 1-3 小时 新手友好度 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
难度 1/5 1 小时以内 新手友好度 88/100
dotnet/AspNetCore.Docs#37729 ·