{"id":355790,"date":"2024-05-20T23:16:12","date_gmt":"2024-05-20T23:16:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=355790"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T23:16:12","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=355790","title":{"rendered":"<span>Design API First. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f Roslyn<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, Habr! \u0421 \u0432\u0430\u043c\u0438 \u0410\u043d\u0442\u043e\u043d, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 SimbirSoft. \u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Design API First \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u043c\u0443, \u043d\u0430\u043f\u043e\u043c\u043d\u044e \u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/742954\/\"><u>\u043e\u0431\u0449\u0438\u0439 \u0432\u0437\u0433\u043b\u044f\u0434<\/u><\/a> \u043d\u0430 Design API First, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/744062\/\"><u>\u0440\u0430\u0437\u0431\u043e\u0440<\/u><\/a> \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/746020\/\"><u>\u043d\u0430\u0448 \u043e\u043f\u044b\u0442<\/u><\/a> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Design API First \u0432 \u043d\u0430\u0448 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/751406\/\"><u>\u2018how-to\u2019<\/u><\/a> \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 frontend \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 OpenAPI \u0434\u043b\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 backend.<\/p>\n<blockquote>\n<p><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: <\/em><\/p>\n<p><em>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443\u044e\u0449\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Design API First \u0441 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4f6\/075\/1d5\/4f60751d5759c030fcd0584f8d269ad0.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f6\/075\/1d5\/4f60751d5759c030fcd0584f8d269ad0.png\"\/><\/figure>\n<h3>\u0421 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. Backend \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 .Net Core 6. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f REST API \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 backend \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 (Code First). \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u0430\u043a \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 c Code First \u043d\u0430 Design First. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/746020\/\"><u>\u00ab\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Design API First \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e: \u043d\u0430\u0448 \u043e\u043f\u044b\u0442\u00bb<\/u><\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Design API First \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 backend:<\/p>\n<ol>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438<a href=\"https:\/\/learn.microsoft.com\/ru-ru\/dotnet\/csharp\/roslyn-sdk\/source-generators-overview\"> <u>\u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Roslyn<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d<a href=\"https:\/\/www.nuget.org\/packages\/NSwag.AspNetCore\"> <u>NSwag<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430<a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/roslyn-sdk\/source-generators-overview\"> <u>Source Generators<\/u><\/a> \u0438 NSwag.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430<a href=\"https:\/\/github.com\/dotnet\/roslyn\/blob\/main\/docs\/features\/incremental-generators.md\"> <u>Incremental Generators<\/u><\/a> \u0438 NSwag.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Incremental Generators \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f REST API Backend.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u043e\u0446\u0435\u043d\u043a\u0443 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 Roslyn \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u00ab\u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a\u00bb \u043a\u043e\u0434\u0430 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI. \u041d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Roslyn<\/h3>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 .Net 6 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Roslyn \u0438 \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0442\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 NSwag \u2014 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0438 \u043d\u0430\u0448\u0438\u0445 backend-\u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Source Generators \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u043c. \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cs\">[Generator] public class Generator : ISourceGenerator {     \/\/\/ &lt;inheritdoc \/>     public void Execute(GeneratorExecutionContext context)     {         var openApiContext = OpenApiContext.CreateFromExecutionContext(context);           foreach (var openApiFileContext in openApiContext.Context)         {             var generatorStrategy = GeneratorStrategyFactory.GetStrategy(openApiFileContext);             var result = generatorStrategy.GenerateCode(openApiFileContext).Result;               if (result.IsSuccess)             {                 context.AddSource(openApiFileContext.FileName, result.GeneratedCode);             }             else             {                 context.ReportDiagnostic(Diagnostic.Create(result.Diagnostic.DiagnosticDescriptor, null, result.Diagnostic.Message));             }                     }       }       \/\/\/ &lt;inheritdoc \/>     public void Initialize(GeneratorInitializationContext context)     { \/\/#if DEBUG \/\/        if (!Debugger.IsAttached) \/\/        { \/\/            Debugger.Launch(); \/\/        } \/\/#endif            } }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442. \u041f\u043e\u0434 \u00ab\u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 NSwag.Core: OpenApiDocument.FromFileAsync(filePath).<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 NSwag \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438:<\/p>\n<pre><code class=\"cs\">new CSharpControllerGeneratorSettings     {         ClassName = className,         CSharpGeneratorSettings =         {             Namespace = classesNamespace,             SchemaType = NJsonSchema.SchemaType.OpenApi3,             GenerateDefaultValues = true,             GenerateDataAnnotations = false         },         ControllerStyle = NSwag.CodeGeneration.CSharp.Models.CSharpControllerStyle.Abstract,         ControllerTarget = NSwag.CodeGeneration.CSharp.Models.CSharpControllerTarget.AspNetCore,         GenerateOptionalParameters = true,         GenerateModelValidationAttributes = true,         RouteNamingStrategy = NSwag.CodeGeneration.CSharp.Models.CSharpControllerRouteNamingStrategy.None,         UseActionResultType = true     };<\/code><\/pre>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 <em>GeneratorExecutionContext context<\/em> \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <em>ISourceGenerator<\/em>.<em>Execute<\/em> \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 OpenAPI \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 NSwag. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c OpenAPI.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0438\u0434\u0435\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0439. \u041d\u043e \u0431\u044b\u043b\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b&#8230; \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Roslyn.<\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0442\u0435, \u043a\u0442\u043e \u0441 \u043d\u0438\u043c\u0438 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c, \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442, \u043e \u0447\u0435\u043c \u0440\u0435\u0447\u044c. \u0412\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438): \u0443 Source Generators \u043d\u0430 Roslyn \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI). \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e \u0444\u0430\u043a\u0442\u0443, \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438 IDE \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442 Microsoft<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043c\u044b \u043f\u043e\u0448\u043b\u0438 \u043d\u0430 \u043f\u043e\u0432\u043e\u0434\u0443 \u0443 \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u0439 \u00ab\u043c\u0435\u043b\u043a\u043e\u043c\u044f\u0433\u043a\u0438\u0445\u00bb \u0438 \u0443\u0432\u0435\u0440\u043e\u0432\u0430\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 Incremental Generators.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c. \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Roslyn \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438.<\/p>\n<p>\u041d\u043e \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0422\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448 IncrementalGenerator:\u00a0<\/p>\n<pre><code class=\"cs\">[Generator] public class OpenApiGenerator : IIncrementalGenerator {     static IncrementalValueProvider&lt;Compilation> _compilationlValueProvider; static IncrementalValueProvider&lt;AnalyzerConfigOptionsProvider> _analyzerConfigOptionsProvider; ... public void Initialize(IncrementalGeneratorInitializationContext context) { \/\/#if DEBUG \/\/    if (!Debugger.IsAttached) \/\/    { \/\/        Debugger.Launch(); \/\/    } \/\/#endif     _compilationlValueProvider = context.CompilationProvider;     _analyzerConfigOptionsProvider =  context.AnalyzerConfigOptionsProvider;     context.AdditionalTextsProvider         .Where(static text => IsOpenApiSchemeExtension(text.Path))         .Combine(context.AnalyzerConfigOptionsProvider             .Select(static (x, _) => bool.Parse(x.GetGlobalOption(\"UseCache\", prefix: Name) ?? bool.FalseString)))         .SelectAndReportExceptions(GetCacheValue, context, Id)         .Combine(context.CompilationProvider.Select(static (x, _) => x.AssemblyName))         .SelectAndReportExceptions(GetSourceCode, context, Id)         .AddSource(context); } ... }<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <em>.<\/em><a href=\"https:\/\/www.nuget.org\/packages\/H.Generators.Extensions\"><em><u>SelectAndReportExceptions<\/u><\/em><\/a><em>(GetSourceCode, context, Id) <\/em>\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0437\u043e\u0432<em>\u00a0 .Combine(context.CompilationProvider.Select(static (x, _) => x.AssemblyName)) <\/em>\u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u0435\u0442 namespaces \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5fb\/af6\/6c7\/5fbaf66c73633fc6c0dc24cdf6d224e7.png\" width=\"650\" height=\"948\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5fb\/af6\/6c7\/5fbaf66c73633fc6c0dc24cdf6d224e7.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenApi \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">openapi: 3.0.3 info:   title: File REST API \u0434\u043b\u044f Samples   version: 0.3.0   description: REST API \u0434\u043b\u044f File Storage Template \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 OpenAPI v3   servers:   - url: http:\/\/localhost:8080 description: Dev Server     paths:   \/api\/v3\/process: post:   summary: \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435   description: \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435   operationId: uploadFile   tags:     - Upload      requestBody:     content:       multipart\/form-data:         schema:           $ref: \"#\/components\/schemas\/File.Request.UploadData\"         encoding:           file:             style: form   responses:     '201': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d       $ref: \"#\/components\/responses\/File.Response.SuccessUploadFile\"     \"500\":       $ref: \"#\/components\/responses\/App.Response.Error5XX\"         \/api\/v3\/download\/{bucket}\/{docId}.{ext}: get:   description: \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430   operationId: downloadFileFromBucket   tags:     - Download   parameters:     - $ref: \"#\/components\/parameters\/File.Download.docId\"     - $ref: \"#\/components\/parameters\/File.Download.bucket\"     - $ref: \"#\/components\/parameters\/File.Download.ext\"   responses:     '200': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043a\u0430\u0447\u0435\u043d       $ref: \"#\/components\/responses\/File.Response.SuccessDownloadFile\"     \"500\":       $ref: \"#\/components\/responses\/App.Response.Error5XX\"          \/api\/v3\/download\/{docId}.{ext}: get:   description: \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430   operationId: downloadFile   tags:     - Download   parameters:     - $ref: \"#\/components\/parameters\/File.Download.docId\"     - $ref: \"#\/components\/parameters\/File.Download.ext\"     - $ref: \"#\/components\/parameters\/File.Download.bucketQuery\"   responses:     '200': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043a\u0430\u0447\u0435\u043d       $ref: \"#\/components\/responses\/File.Response.SuccessDownloadFile\"     \"500\":       $ref: \"#\/components\/responses\/App.Response.Error5XX\"          \/api\/v3\/download\/doc:   get:     tags:       - Download     summary: \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430     parameters:       - $ref: \"#\/components\/parameters\/File.Download.docIdQuery\"       - $ref: \"#\/components\/parameters\/File.Download.bucketQuery\"       - $ref: \"#\/components\/parameters\/File.Download.extQuery\"     responses:       '200': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043a\u0430\u0447\u0435\u043d         $ref: \"#\/components\/responses\/File.Response.SuccessDownloadFile\"       \"500\":         $ref: \"#\/components\/responses\/App.Response.Error5XX\"   \/api\/v3\/file\/list:   get:     tags:       - FileManage     summary: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0445 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435     parameters:       - $ref: \"#\/components\/parameters\/File.Manage.page\"       - $ref: \"#\/components\/parameters\/File.Manage.pageLength\"       - $ref: \"#\/components\/parameters\/File.Manage.isMine\"     responses:       '200':         $ref: \"#\/components\/responses\/File.Response.FilesList\"       '500':         $ref: \"#\/components\/responses\/App.Response.Error5XX\"        components:   parameters: File.Download.docId:   name: docId   in: path   description: \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430   required: true   schema:     type: string     default: '' File.Download.docIdQuery:   name: docId   in: query   description: \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430   required: true   schema:     type: string     default: '' File.Download.bucket:   name: bucket   in: path   required: true   schema:     type: string     default: '' File.Download.bucketQuery:   name: bucket   in: query   required: false   schema:     type: string     default: '' File.Download.ext:   name: ext   in: path   required: true   schema:     type: string     default: '' File.Download.extQuery:   name: ext   in: query   required: true   schema:     type: string     default: '' File.Manage.page:   name: page   in: query   schema:     type: integer     format: int32     default: 0 File.Manage.pageLength:   name: pageLength   in: query   schema:     type: integer     format: int32     default: 10 File.Manage.isMine:   name: isMine   in: query   schema:     type: boolean     default: false     schemas: File.Manage.FileItem:     required:       - createdTimestamp       - donwloadsCount       - fileType       - guid       - id       - name       - ownerId       - sizeKb     type: object     properties:       id:         type: integer         format: int32       ownerId:         type: string       guid:         type: string       fileType:         type: string       name:         type: string       createdTimestamp:         type: integer         format: int64       donwloadsCount:         type: integer         format: int32       sizeKb:         type: integer         format: int32         readOnly: true     additionalProperties: false   App.Response.Model.Error: # RFC 7807 (Problem Details for HTTP APIs)     type: object     required:       - title       - detail       - request       - time       - errorTraceId     properties:       title:         description: \u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443         type: string         example: \"Entity not found\"       detail:         description: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443         type: string         example: \"Entity [User] with id = [123456] not found. You MUST use PUT to add entity instead of GET\"       request:         description: \u041c\u0435\u0442\u043e\u0434 \u0438 URL \u0437\u0430\u043f\u0440\u043e\u0441\u0430         type: string         example: \"PUT \/users\/123456\"       time:         description: \u0412\u0440\u0435\u043c\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434         type: string         format: date-time         example: \"2023-01-01T12:00:00.000+02:00\"       errorTraceId:         description: \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438         type: string         example: \"5add1be1-90ab5d42-02fa8b1f-672503f2\" File.Request.UploadData:   type: object   properties:     file:       type: string       format: binary          securitySchemes: Bearer:   type: http   description: Enter JWT Bearer token   scheme: bearer   bearerFormat: JWT   responses: File.Response.SuccessUploadFile:   description: \u0424\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430   content:         text\/plain:           schema:             type: string         application\/json:           schema:             type: string         text\/json:           schema:             type: string File.Response.SuccessDownloadFile:   description: \u0424\u0430\u0439\u043b c\u043a\u0430\u0447\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445   content:         text\/plain:           schema:             type: string             format: binary         application\/json:           schema:             type: string             format: binary         text\/json:           schema:             type: string             format: binary File.Response.FilesList:   description: Success   content:       text\/plain:         schema:           type: array           items:             $ref: '#\/components\/schemas\/File.Manage.FileItem'       application\/json:         schema:           type: array           items:             $ref: '#\/components\/schemas\/File.Manage.FileItem'       text\/json:         schema:           type: array           items:             $ref: '#\/components\/schemas\/File.Manage.FileItem' App.Response.Error5XX:   description: \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430   content:     application\/problem+json:       schema:         $ref: \"#\/components\/schemas\/App.Response.Model.Error\" security:   - Bearer: []<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 FileApi:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">[System.CodeDom.Compiler.GeneratedCode(\"NSwag\", \"13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))\")] public abstract class FileApiControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase {     \/\/\/ &lt;summary>     \/\/\/ \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435     \/\/\/ &lt;\/summary>     \/\/\/ &lt;remarks>     \/\/\/ \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435     \/\/\/ &lt;\/remarks>     \/\/\/ &lt;returns>\u0424\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430&lt;\/returns>     [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route(\"api\/v3\/process\")]     public abstract System.Threading.Tasks.Task&lt;Microsoft.AspNetCore.Mvc.ActionResult&lt;string>> UploadFile(Microsoft.AspNetCore.Http.IFormFile body = null);     \/\/\/ &lt;remarks>     \/\/\/ \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430     \/\/\/ &lt;\/remarks>     \/\/\/ &lt;param name = \"docId\">\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430&lt;\/param>     \/\/\/ &lt;returns>\u0424\u0430\u0439\u043b c\u043a\u0430\u0447\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&lt;\/returns>     [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route(\"api\/v3\/download\/{bucket}\/{docId}.{ext}\")]     public abstract System.Threading.Tasks.Task&lt;Microsoft.AspNetCore.Mvc.IActionResult> DownloadFileFromBucket([Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string docId, [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string bucket, [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string ext);     \/\/\/ &lt;remarks>     \/\/\/ \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430     \/\/\/ &lt;\/remarks>     \/\/\/ &lt;param name = \"docId\">\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430&lt;\/param>     \/\/\/ &lt;returns>\u0424\u0430\u0439\u043b \u0441\u043a\u0430\u0447\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&lt;\/returns>     [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route(\"api\/v3\/download\/{docId}.{ext}\")]     public abstract System.Threading.Tasks.Task&lt;Microsoft.AspNetCore.Mvc.IActionResult> DownloadFile([Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string docId, [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string ext, [Microsoft.AspNetCore.Mvc.FromQuery] string bucket = \"\");     \/\/\/ &lt;summary>     \/\/\/ \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430     \/\/\/ &lt;\/summary>     \/\/\/ &lt;param name = \"docId\">\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430&lt;\/param>     \/\/\/ &lt;returns>\u0424\u0430\u0439\u043b \u0441\u043a\u0430\u0447\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&lt;\/returns>     [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route(\"api\/v3\/download\/doc\")]     public abstract System.Threading.Tasks.Task&lt;Microsoft.AspNetCore.Mvc.IActionResult> Doc([Microsoft.AspNetCore.Mvc.FromQuery][Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string docId, [Microsoft.AspNetCore.Mvc.FromQuery][Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string ext, [Microsoft.AspNetCore.Mvc.FromQuery] string bucket = \"\");     \/\/\/ &lt;summary>     \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0445 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435     \/\/\/ &lt;\/summary>     \/\/\/ &lt;returns>Success&lt;\/returns>     [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route(\"api\/v3\/file\/list\")]     public abstract System.Threading.Tasks.Task&lt;Microsoft.AspNetCore.Mvc.ActionResult&lt;System.Collections.Generic.ICollection&lt;FileItem>>> List([Microsoft.AspNetCore.Mvc.FromQuery] int? page = 0, [Microsoft.AspNetCore.Mvc.FromQuery] int? pageLength = 10, [Microsoft.AspNetCore.Mvc.FromQuery] bool? isMine = false); }   [System.CodeDom.Compiler.GeneratedCode(\"NJsonSchema\", \"13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))\")] public partial class FileItem {     [Newtonsoft.Json.JsonProperty(\"id\", Required = Newtonsoft.Json.Required.Always)]     public int Id { get; set; }       [Newtonsoft.Json.JsonProperty(\"ownerId\", Required = Newtonsoft.Json.Required.Always)]     public string OwnerId { get; set; }       [Newtonsoft.Json.JsonProperty(\"guid\", Required = Newtonsoft.Json.Required.Always)]     public string Guid { get; set; }       [Newtonsoft.Json.JsonProperty(\"fileType\", Required = Newtonsoft.Json.Required.Always)]     public string FileType { get; set; }       [Newtonsoft.Json.JsonProperty(\"name\", Required = Newtonsoft.Json.Required.Always)]     public string Name { get; set; }       [Newtonsoft.Json.JsonProperty(\"createdTimestamp\", Required = Newtonsoft.Json.Required.Always)]     public long CreatedTimestamp { get; set; }       [Newtonsoft.Json.JsonProperty(\"donwloadsCount\", Required = Newtonsoft.Json.Required.Always)]     public int DonwloadsCount { get; set; }       [Newtonsoft.Json.JsonProperty(\"sizeKb\", Required = Newtonsoft.Json.Required.Always)]     public int SizeKb { get; set; } }   [System.CodeDom.Compiler.GeneratedCode(\"NJsonSchema\", \"13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))\")] public partial class Error {     \/\/\/ &lt;summary>     \/\/\/ \u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443     \/\/\/ &lt;\/summary>     [Newtonsoft.Json.JsonProperty(\"title\", Required = Newtonsoft.Json.Required.Always)]     public string Title { get; set; }       \/\/\/ &lt;summary>     \/\/\/ \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443     \/\/\/ &lt;\/summary>     [Newtonsoft.Json.JsonProperty(\"detail\", Required = Newtonsoft.Json.Required.Always)]     public string Detail { get; set; }       \/\/\/ &lt;summary>     \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0438 URL \u0437\u0430\u043f\u0440\u043e\u0441\u0430     \/\/\/ &lt;\/summary>     [Newtonsoft.Json.JsonProperty(\"request\", Required = Newtonsoft.Json.Required.Always)]     public string Request { get; set; }       \/\/\/ &lt;summary>     \/\/\/ \u0412\u0440\u0435\u043c\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434     \/\/\/ &lt;\/summary>     [Newtonsoft.Json.JsonProperty(\"time\", Required = Newtonsoft.Json.Required.Always)]     public System.DateTimeOffset Time { get; set; }       \/\/\/ &lt;summary>     \/\/\/ \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438     \/\/\/ &lt;\/summary>     [Newtonsoft.Json.JsonProperty(\"errorTraceId\", Required = Newtonsoft.Json.Required.Always)]     public string ErrorTraceId { get; set; }       private System.Collections.Generic.IDictionary&lt;string, object> _additionalProperties;     [Newtonsoft.Json.JsonExtensionData]     public System.Collections.Generic.IDictionary&lt;string, object> AdditionalProperties     {         get         {             return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary&lt;string, object>());         }           set         {             _additionalProperties = value;         }     } }   [System.CodeDom.Compiler.GeneratedCode(\"NJsonSchema\", \"13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))\")] public partial class UploadData {     [Newtonsoft.Json.JsonProperty(\"file\", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]     public byte[] File { get; set; }       private System.Collections.Generic.IDictionary&lt;string, object> _additionalProperties;     [Newtonsoft.Json.JsonExtensionData]     public System.Collections.Generic.IDictionary&lt;string, object> AdditionalProperties     {         get         {             return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary&lt;string, object>());         }           set         {             _additionalProperties = value;         }     } }   [System.CodeDom.Compiler.GeneratedCode(\"NSwag\", \"13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))\")] public partial class FileResponse : System.IDisposable {     private System.IDisposable _client;     private System.IDisposable _response;     public int StatusCode { get; private set; }     public System.Collections.Generic.IReadOnlyDictionary&lt;string, System.Collections.Generic.IEnumerable&lt;string>> Headers { get; private set; }     public System.IO.Stream Stream { get; private set; }       public bool IsPartial     {         get         {             return StatusCode == 206;         }     }       public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary&lt;string, System.Collections.Generic.IEnumerable&lt;string>> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response)     {         StatusCode = statusCode;         Headers = headers;         Stream = stream;         _client = client;         _response = response;     }       public void Dispose()     {         Stream.Dispose();         if (_response != null)             _response.Dispose();         if (_client != null)             _client.Dispose();     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 IncrementalGenerators, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u0438\u0441\u0447\u0435\u0437\u043b\u0438, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0417\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u044f IDE \u043d\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u043e\u0441\u044c, \u043e\u0434\u043d\u0430\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI \u0432\u0441\u0435 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0438\u0441\u044c \u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u0434\u0430\u0445 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 IDE. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 Roslyn. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u043d netstandard2.0. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u044b \u043d\u0435 \u043f\u0440\u0438\u0434\u0430\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u043c\u0443 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C# \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c OpenAPI.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 (\u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435) \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 (projects) \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 API. \u0427\u0442\u043e\u0431\u044b \u0432\u0430\u043c \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0445\u0435\u043c\u0443 backend \u0432 \u0447\u0430\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d0d\/434\/a39\/d0d434a39180e153d4d301f0054dbcae.png\" width=\"3312\" height=\"1256\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d0d\/434\/a39\/d0d434a39180e153d4d301f0054dbcae.png\"\/><\/figure>\n<h2>\u0421 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c\u00a0<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u044f\u0434 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 Roslyn:<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h3>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 OpenAPI spec Project \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u00ab\u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f\u00bb \u043f\u0440\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 FileUploadAPI, FileDownloadAPI, FileManageAPI. \u041f\u0440\u0438\u0447\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0430 (error CS0246: The type or namespace name \u2018&#8230;\u2019 could not be found) \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0431\u043e\u0440\u043a\u0438. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0437 OpenAPI specs Project \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 IDE \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 nuget-\u043f\u0430\u043a\u0435\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 API \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u041c\u044b \u0431\u044b\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043a\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u0430<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u043b\u0433 \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a \u0434\u043b\u044f \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0423\u0445\u0443\u0434\u0448\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439. \u042d\u0442\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e OpenAPI, \u0442.\u043a. \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0443\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043e\u043a\u00a0<\/h3>\n<p>\u0420\u044f\u0434 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438\u0437 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041a\u0430\u043a \u043c\u044b \u0440\u0435\u0448\u0430\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u00a0<\/h2>\n<p>\u041d\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0439. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f:<\/p>\n<h4>1. \u0423\u043f\u0430\u043a\u043e\u0432\u043a\u0430 OpenAPI spec Project \u0432 nuget-\u043f\u0430\u043a\u0435\u0442<\/h4>\n<p>\u041d\u041e! \u0422\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<h4>2. \u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 (\u043f\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e)<\/h4>\n<p>\u041d\u041e! \u042d\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u0415\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430\u0440\u0435\u0437\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<h4>3. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438\u043b\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 NSwag<\/h4>\n<p>\u041d\u041e! \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435<a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/704902\/\"> <u>\u043e\u043f\u044b\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u041c\u0422\u0421<\/u><\/a>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f (\u0444\u0443\u0445!) \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c:<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<a href=\"https:\/\/www.nuget.org\/packages\/swashbuckle.aspnetcore.swagger\/\"> <u>Swagger<\/u><\/a> \u0432\u043c\u0435\u0441\u0442\u043e NSwag \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c Roslyn (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0432\u0438\u0434\u0435<a href=\"https:\/\/learn.microsoft.com\/ru-ru\/visualstudio\/modeling\/code-generation-and-t4-text-templates?view=vs-2022\"> <u>\u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 T4<\/u><\/a>).<\/p>\n<\/li>\n<\/ol>\n<p>\u041a \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u043a\u0443 Roslyn+Swagger, \u0430 \u0432\u043e\u0442 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 T4 \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438. \u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p><strong>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/strong><\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u0440\u0441\u043a\u0438\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u043e\u0446\u0441\u0435\u0442\u044f\u0445 \u2013 <\/strong><a href=\"https:\/\/vk.com\/simbirsoft\"><strong><u>\u0412\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435<\/u><\/strong><\/a><strong> \u0438 <\/strong><a href=\"https:\/\/t.me\/+pK7Kj9d-JfNjZjA6\"><strong><u>Telegram<\/u><\/strong><\/a><strong>.<\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/763288\/\"> https:\/\/habr.com\/ru\/articles\/763288\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, Habr! \u0421 \u0432\u0430\u043c\u0438 \u0410\u043d\u0442\u043e\u043d, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 SimbirSoft. \u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Design API First \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u043c\u0443, \u043d\u0430\u043f\u043e\u043c\u043d\u044e \u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/742954\/\"><u>\u043e\u0431\u0449\u0438\u0439 \u0432\u0437\u0433\u043b\u044f\u0434<\/u><\/a> \u043d\u0430 Design API First, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/744062\/\"><u>\u0440\u0430\u0437\u0431\u043e\u0440<\/u><\/a> \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/746020\/\"><u>\u043d\u0430\u0448 \u043e\u043f\u044b\u0442<\/u><\/a> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Design API First \u0432 \u043d\u0430\u0448 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/751406\/\"><u>\u2018how-to\u2019<\/u><\/a> \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 frontend \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 OpenAPI \u0434\u043b\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 backend.<\/p>\n<blockquote>\n<p><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: <\/em><\/p>\n<p><em>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443\u044e\u0449\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Design API First \u0441 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0421 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. Backend \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 .Net Core 6. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f REST API \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 backend \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 (Code First). \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u0430\u043a \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 c Code First \u043d\u0430 Design First. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/simbirsoft\/articles\/746020\/\"><u>\u00ab\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Design API First \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u041f\u041e: \u043d\u0430\u0448 \u043e\u043f\u044b\u0442\u00bb<\/u><\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Design API First \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 backend:<\/p>\n<ol>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438<a href=\"https:\/\/learn.microsoft.com\/ru-ru\/dotnet\/csharp\/roslyn-sdk\/source-generators-overview\"> <u>\u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Roslyn<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d<a href=\"https:\/\/www.nuget.org\/packages\/NSwag.AspNetCore\"> <u>NSwag<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430<a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/roslyn-sdk\/source-generators-overview\"> <u>Source Generators<\/u><\/a> \u0438 NSwag.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430<a href=\"https:\/\/github.com\/dotnet\/roslyn\/blob\/main\/docs\/features\/incremental-generators.md\"> <u>Incremental Generators<\/u><\/a> \u0438 NSwag.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Incremental Generators \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f REST API Backend.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u043e\u0446\u0435\u043d\u043a\u0443 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 Roslyn \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u00ab\u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a\u00bb \u043a\u043e\u0434\u0430 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI. \u041d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Roslyn<\/h3>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 .Net 6 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Roslyn \u0438 \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0442\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 NSwag \u2014 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0438 \u043d\u0430\u0448\u0438\u0445 backend-\u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Source Generators \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u043c. \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cs\">[Generator] public class Generator : ISourceGenerator {     \/\/\/ &lt;inheritdoc \/>     public void Execute(GeneratorExecutionContext context)     {         var openApiContext = OpenApiContext.CreateFromExecutionContext(context);           foreach (var openApiFileContext in openApiContext.Context)         {             var generatorStrategy = GeneratorStrategyFactory.GetStrategy(openApiFileContext);             var result = generatorStrategy.GenerateCode(openApiFileContext).Result;               if (result.IsSuccess)             {                 context.AddSource(openApiFileContext.FileName, result.GeneratedCode);             }             else             {                 context.ReportDiagnostic(Diagnostic.Create(result.Diagnostic.DiagnosticDescriptor, null, result.Diagnostic.Message));             }                     }       }       \/\/\/ &lt;inheritdoc \/>     public void Initialize(GeneratorInitializationContext context)     { \/\/#if DEBUG \/\/        if (!Debugger.IsAttached) \/\/        { \/\/            Debugger.Launch(); \/\/        } \/\/#endif            } }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442. \u041f\u043e\u0434 \u00ab\u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 NSwag.Core: OpenApiDocument.FromFileAsync(filePath).<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 NSwag \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438:<\/p>\n<pre><code class=\"cs\">new CSharpControllerGeneratorSettings     {         ClassName = className,         CSharpGeneratorSettings =         {             Namespace = classesNamespace,             SchemaType = NJsonSchema.SchemaType.OpenApi3,             GenerateDefaultValues = true,             GenerateDataAnnotations = false         },         ControllerStyle = NSwag.CodeGeneration.CSharp.Models.CSharpControllerStyle.Abstract,         ControllerTarget = NSwag.CodeGeneration.CSharp.Models.CSharpControllerTarget.AspNetCore,         GenerateOptionalParameters = true,         GenerateModelValidationAttributes = true,         RouteNamingStrategy = NSwag.CodeGeneration.CSharp.Models.CSharpControllerRouteNamingStrategy.None,         UseActionResultType = true     };<\/code><\/pre>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 <em>GeneratorExecutionContext context<\/em> \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <em>ISourceGenerator<\/em>.<em>Execute<\/em> \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 OpenAPI \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 NSwag. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c OpenAPI.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0438\u0434\u0435\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0439. \u041d\u043e \u0431\u044b\u043b\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b&#8230; \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Roslyn.<\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0442\u0435, \u043a\u0442\u043e \u0441 \u043d\u0438\u043c\u0438 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c, \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442, \u043e \u0447\u0435\u043c \u0440\u0435\u0447\u044c. \u0412\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438): \u0443 Source Generators \u043d\u0430 Roslyn \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI). \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e \u0444\u0430\u043a\u0442\u0443, \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438 IDE \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442 Microsoft<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043c\u044b \u043f\u043e\u0448\u043b\u0438 \u043d\u0430 \u043f\u043e\u0432\u043e\u0434\u0443 \u0443 \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u0439 \u00ab\u043c\u0435\u043b\u043a\u043e\u043c\u044f\u0433\u043a\u0438\u0445\u00bb \u0438 \u0443\u0432\u0435\u0440\u043e\u0432\u0430\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 Incremental Generators.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c. \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Roslyn \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438.<\/p>\n<p>\u041d\u043e \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0422\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448 IncrementalGenerator:\u00a0<\/p>\n<pre><code class=\"cs\">[Generator] public class OpenApiGenerator : IIncrementalGenerator {     static IncrementalValueProvider&lt;Compilation> _compilationlValueProvider; static IncrementalValueProvider&lt;AnalyzerConfigOptionsProvider> _analyzerConfigOptionsProvider; ... public void Initialize(IncrementalGeneratorInitializationContext context) { \/\/#if DEBUG \/\/    if (!Debugger.IsAttached) \/\/    { \/\/        Debugger.Launch(); \/\/    } \/\/#endif     _compilationlValueProvider = context.CompilationProvider;     _analyzerConfigOptionsProvider =  context.AnalyzerConfigOptionsProvider;     context.AdditionalTextsProvider         .Where(static text => IsOpenApiSchemeExtension(text.Path))         .Combine(context.AnalyzerConfigOptionsProvider             .Select(static (x, _) => bool.Parse(x.GetGlobalOption(\"UseCache\", prefix: Name) ?? bool.FalseString)))         .SelectAndReportExceptions(GetCacheValue, context, Id)         .Combine(context.CompilationProvider.Select(static (x, _) => x.AssemblyName))         .SelectAndReportExceptions(GetSourceCode, context, Id)         .AddSource(context); } ... }<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <em>.<\/em><a href=\"https:\/\/www.nuget.org\/packages\/H.Generators.Extensions\"><em><u>SelectAndReportExceptions<\/u><\/em><\/a><em>(GetSourceCode, context, Id) <\/em>\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0437\u043e\u0432<em>\u00a0 .Combine(context.CompilationProvider.Select(static (x, _) => x.AssemblyName)) <\/em>\u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u0435\u0442 namespaces \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAPI.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenApi \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">openapi: 3.0.3 info:   title: File REST API \u0434\u043b\u044f Samples   version: 0.3.0   description: REST API \u0434\u043b\u044f File Storage Template \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 OpenAPI v3   servers:   - url: http:\/\/localhost:8080 description: Dev Server     paths:   \/api\/v3\/process: post:   summary: \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435   description: \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435   operationId: uploadFile   tags:     - Upload      requestBody:     content:       multipart\/form-data:         schema:           $ref: \"#\/components\/schemas\/File.Request.UploadData\"         encoding:           file:             style: form   responses:     '201': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d       $ref: \"#\/components\/responses\/File.Response.SuccessUploadFile\"     \"500\":       $ref: \"#\/components\/responses\/App.Response.Error5XX\"         \/api\/v3\/download\/{bucket}\/{docId}.{ext}: get:   description: \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430   operationId: downloadFileFromBucket   tags:     - Download   parameters:     - $ref: \"#\/components\/parameters\/File.Download.docId\"     - $ref: \"#\/components\/parameters\/File.Download.bucket\"     - $ref: \"#\/components\/parameters\/File.Download.ext\"   responses:     '200': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043a\u0430\u0447\u0435\u043d       $ref: \"#\/components\/responses\/File.Response.SuccessDownloadFile\"     \"500\":       $ref: \"#\/components\/responses\/App.Response.Error5XX\"          \/api\/v3\/download\/{docId}.{ext}: get:   description: \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430   operationId: downloadFile   tags:     - Download   parameters:     - $ref: \"#\/components\/parameters\/File.Download.docId\"     - $ref: \"#\/components\/parameters\/File.Download.ext\"     - $ref: \"#\/components\/parameters\/File.Download.bucketQuery\"   responses:     '200': # \u0444\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043a\u0430\u0447\u0435\u043d       $ref: \"#\/components\/responses\/File.Response.SuccessDownloadFile\"     \"500\":       $ref:<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-355790","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=355790"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355790\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=355790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=355790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=355790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}