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
-
priority-0
難度 2/5 1-3 小時 新手友好度 68/100
-
難度 1/5 1 小時以內 新手友好度 78/100
StackExchange/StackExchange.Redis#3249 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
-
type/automation type/tech-debt
難度 2/5 1-3 小時 新手友好度 78/100
-
bug
難度 2/5 1-3 小時 新手友好度 88/100