Allow custom Dtos for endpoints
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
調査の方向性
MapInstantAPIs の構成エントリポイントから開始し、エンティティ型がエンドポイントのリクエストモデルになるまでを追跡します。要求された AddFoodDto/UseCustomDto の insert フローと、生成された Swagger の body を比較します。完了条件は、呼び出し元がエンドポイントにカスタム DTO を渡し、それが要求どおりエンティティにマッピングされることです。
索引モデルが issue の本文から書いたものです。
説明
Suppose I have this class
`
public class Food : Record
{
public string Name { get; set; }
public decimal Portion { get; set; }
public decimal Calories { get; set; }
public decimal Carbohydrates { get; set; }
public decimal Lipids { get; set; }
public decimal Proteins { get; set; }
public decimal Fiber { get; set; }
public Guid SourceId { get; set; }
public Source Source { get; set; }
public Classification Classification { get; set; }
public NewClassification NewClassification { get; set; }
public ICollection<FoodRecipes> FoodRecipes { get; set; }
}
`
When using InstantAPIs, the following swagger body model is created
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"registration": "2023-09-04T02:26:10.760Z",
"update": "2023-09-04T02:26:10.760Z",
"deletion": "2023-09-04T02:26:10.760Z",
"name": "string",
"portion": 0,
"calories": 0,
"carbohydrates": 0,
"lipids": 0,
"proteins": 0,
"fiber": 0,
"sourceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"registration": "2023-09-04T02:26:10.760Z",
"update": "2023-09-04T02:26:10.760Z",
"deletion": "2023-09-04T02:26:10.760Z",
"name": "string"
},
"classification": 0,
"newClassification": 0,
"foodRecipes": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"registration": "2023-09-04T02:26:10.760Z",
"update": "2023-09-04T02:26:10.760Z",
"deletion": "2023-09-04T02:26:10.760Z",
"recipeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"recipe": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"registration": "2023-09-04T02:26:10.760Z",
"update": "2023-09-04T02:26:10.760Z",
"deletion": "2023-09-04T02:26:10.760Z",
"name": "string",
"foodRecipes": [
"string"
]
},
"foodId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"food": "string"
}
]
}
I wish there would be a way to provide custom DTOs and maybe using AutoMapper to transforming to entity class, like
app.MapInstantAPIs<EuNutroContext>(config =>
{
config.ExcludeTable(db => db.AnyTable);
config.UseCustomDto(db => db.Food, typeof(AddFoodDto), ApiMethodsToGenerate.Insert); // like this
});
- 主要言語
- C#
- スター
- 453
- フォーク
- 58
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
csharpfritz/InstantAPIs のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
csharpfritz/InstantAPIs#74 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
csharpfritz/InstantAPIs#68 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
csharpfritz/InstantAPIs#65 · コメント 8 件 ·
-
Validation layer オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
csharpfritz/InstantAPIs#61 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
csharpfritz/InstantAPIs#60 · コメント 3 件 ·
csharpfritz/InstantAPIs の issue をすべて見る
似ている issue
-
bug frontend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/arrow-adbc#4809 ·