Refactor the whole project
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 重构
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- csharp
调研方向
未指定源文件或测试。首先跟踪 OData-to-OpenAPI 转换流程,并审查提议的 IOpenApiODataConverter、IODataPathProvider、path 和 operation 处理程序,以及 UseOpenApiOData 注册示例。完成条件是确定一个达成共识的服务边界和支持自定义转换的 dependency injection 设计。
由索引模型根据 Issue 内容生成。
描述
Short summary (3-5 sentences) describing the issue.
Recently, I got a lot of requirements, for example
- I don't want to expand on certain element
- I don't need this operation
- I need this ...
- etc..
Yes, we can meet all of these by modifying the codes, by adding settings, etc.
However, i'd think maybe it's time to refactor it in the next major release.
Design
I'd like to use the Dependency Injection to allow customer to customize the converting process.
We need figure out the working flow from OData to OpenAPI. The process steps are certain, at each step, we can create a service to work on it.
Services
We need figure out the services used during converting.
for example:
- we should have a OData path provider service
- we should have a OpenApi path generator service
- We should have a convert engine
Extension methods
I think we need
public static IServiceCollection UseOpenApiOData(IServiceCollection services)
{
services.AddSingleton<IOpenApiODataConverter>(); // converter or generator
services.AddSingleton<IODataPathProvider>();
services.AddSingleton<IODataOpenApiPathHandler>();
services.AddSingleton<IODataOpenApiOperationHandler>();
.....
service.AddSingleton<ODataOpenApiOptions>();
return services;
}
Usage
- you can create the OpenApiODataConverter instance (normal way)
- you can retrieve it from service provider.
IServiceCollection services= new ServiceCollection();
services.UserOpenApiOData();
IServiceProvider sp = services.CreateServiceProvider();
IOpenApiODataConverter converter = sp.GetService<IOpenApiODataConverter>();
...
Advantage
-
It can be used in the ASP.NET Core pipeline, for example we can create a middleware to generate the OpenAPI description for a OData service.
-
It can support to customize the converting. For example, we can replace a certain service using customized service.
- 主要语言
- C#
- 星标
- 240
- 派生
- 70
- 平均合并
- 7 小时 59 分钟
- 30 天内合并 PR
- 13
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/OpenAPI.NET.OData 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/OpenAPI.NET.OData#661 ·
-
难度 3/5 1-2 天 新手友好度 58/100
microsoft/OpenAPI.NET.OData#852 ·
-
难度 4/5 3-5 天 新手友好度 45/100
microsoft/OpenAPI.NET.OData#833 ·
-
status:needs-more-information
难度 4/5 3-5 天 新手友好度 42/100
microsoft/OpenAPI.NET.OData#723 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
microsoft/OpenAPI.NET.OData#720 ·
查看 microsoft/OpenAPI.NET.OData 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
难度 2/5 1-3 小时 新手友好度 72/100
azurenoops/spin_agent#975 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
难度 2/5 1-3 小时 新手友好度 92/100
dotnet/AspNetCore.Docs#37699 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
SubtitleEdit/subtitleedit#15108 · 1 条评论 ·