xxxxプログラマのメモ

先人に感謝と敬意:自分の困ったこと調べたことのメモ

ASP.NET Core WebAPI

Swaggerドキュメントへの追記

docs.microsoft.comgithub.comThansk!

属性ルーティング

stackoverflow.comThanks!

Multipartsection to MemoryStream

await using (MemoryStream memoryStream = new MemoryStream()) { var fileMultipartSection = section.AsFileSection(); await fileMultipartSection.FileStream.CopyToAsync(memoryStream); memoryStream.Position = 0; } stackoverflow.comThanks!

System.Text.Json.JsonException: A possible object cycle was detected which is not supported. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32.

shuhelohelo.hatenablog.com services.AddControllers().AddNewtonsoftJson(settings => settings.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);Thanks!

ASP.NET Core Web Api BestPractice

docs.microsoft.comcode-maze.comASP.NET Core Web API のコントローラー アクションの戻り値の型 | Microsoft Docs Thansk!

Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Nullable`1[xxxx]'

.Net Core 3.x で作成していると以下のエラーが発生。 Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Nullable`1[xxxx]' Nullableの内容を含むApiのレスポンスがHas…

Upload Api #413 #Core3.0

Core 2.2 から3.0へ変更した際にUpload Api(multipart)で発生した対応諸々stackoverflow.com www.cnblogs.com stackoverflow.comThanks!

Actions require an explicit HttpMethod binding for Swagger 2.0 #属性のルーティング #FromRoute

属性ルーティング対応時に Actions require an explicit HttpMethod binding for Swagger 2.0 [Route("hoge/dog/{dog}/type/{type}")] [HttpGet] [Route("hoge")] [HttpGet("dog/{dog}/type/{type}")] はNG [HttpGet("hoge/dog/{dog}/type/{type}")] でOK!c#…

Api クライアントの自動生成

mvnrepository.com www.nuits.jp OpenAPI V3.0 への対応 http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/ openapi-generator.tech https://openapi-generator.tech/docs/generators/csharpgithub.comblog.shibayan.jpThanks!

turn off or handle camelCasing in JSON response ASP.NET Core #先頭大文字

stackoverflow.comThanks!

Response raw Json String #ASP.NET Core #WebAPI

stackoverflow.comThanks!