{"id":358381,"date":"2024-05-21T00:10:38","date_gmt":"2024-05-21T00:10:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=358381"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=358381","title":{"rendered":"<span>\u0413\u043e\u0442\u043e\u0432 \u043b\u0438 Swift OpenAPI Generator \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430?<\/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! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0434\u0440\u0435\u0439, \u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u00ab\u041f\u0443\u043d\u043a\u0442 Ozon\u00bb. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0432\u044b\u0434\u0430\u0447\u0438 Ozon \u0432\u044b\u0434\u0430\u044e\u0442 \u043f\u043e\u0441\u044b\u043b\u043a\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b, \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0438\u0437\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/83d\/2e2\/2e0\/83d2e22e0881bc45a35bac00a772685e.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/83d\/2e2\/2e0\/83d2e22e0881bc45a35bac00a772685e.png\"\/><\/figure>\n<p>\u041c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438, \u0432\u043d\u0435\u0434\u0440\u0438\u0432 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Swift \u0438\u0437 YAML- \u0438\u043b\u0438 JSON-\u0444\u0430\u0439\u043b\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 DTO, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u043c\u0435\u0442\u043e\u0434\u044b API, \u043d\u0430\u0431\u043e\u0440\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0442.\u0434.<\/p>\n<p>\u041d\u0430 WWDC `23 Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u0441\u0432\u043e\u0439 Open Source-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\">Swift OpenAPI Generator<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u043e\u0442\u043e\u0432 \u043b\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0432\u0438\u0434\u0435 Swift OpenAPI Generator \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<h2>\u041a\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0445\u043e\u0442\u0438\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0441 OpenAPI Generator \u0432 \u0446\u0435\u043b\u043e\u043c?<\/h2>\n<p>DTO, \u043e\u043d \u0436\u0435 Data Transfer Object, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0431\u044b\u0447\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0442\u0430\u043a\u043e\u0439:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 Swagger \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u043c\u0435\u0442\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c DTO, \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0435\u043c\u0443 \u0438\u043c\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Input \u2014 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0435\u043c\u0443 \u0438\u043c\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Output \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0435\u043c\u0443 \u0438\u043c\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"swift\">enum ChatsDTO {   struct Input: Encodable {     let startDate: Date     let endDate: Date   }    struct Output: Decodable {     struct Chat: Decodable {       let id: Int       let unreadCount: Int       let lastMessage: String     }      @LossyArray     private(set) var chats: [Chat]   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445<\/p>\n<ul>\n<li>\n<p>\u0420\u0443\u0442\u0438\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435. \u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0412 \u043d\u0430\u0448\u0435\u043c \u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 DTO;<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0440\u0430\u0437\u0443 \u043d\u0443\u0436\u043d\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 DTO, \u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c DTO \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0448\u0438 DTO \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 Swagger \u0441\u0440\u0435\u0434\u0438 \u043d\u0430\u0448\u0438\u0445 DTO, \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u0430, \u0447\u0442\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043e\u0442\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u043f\u043b\u044e\u0441:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 DTO \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0432\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a API \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c Swift OpenAPI Generator. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0437\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0435\u0440\u0451\u0442 Swift-\u043a\u043e\u0434, \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043d\u0430\u043c. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u0435\u0434\u0438\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0427\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Apple Swift OpenAPI Generator<\/h2>\n<p>Swift OpenAPI Generator \u2014 \u044d\u0442\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API, \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Swift \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Vapor. \u041f\u0440\u043e\u0435\u043a\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432: <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/tree\/3b128349cb337b7f3dc5ca01277208160283a6f2\"><u>\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440<\/u><\/a> \u0438 <a href=\"https:\/\/github.com\/apple\/swift-openapi-runtime\/tree\/4312caf57504e6b9111e6fa5474c9a7454a03e9b\"><u>runtime<\/u><\/a>. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0443\u0434\u043d\u0430, \u043d\u043e \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0445\u0432\u0430\u0442\u0430\u0435\u0442. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e Swift OpenAPI Generator \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b iOS 15.0 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e \u0437\u0430\u0442\u0435\u043c \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f iOS \u0431\u044b\u043b\u0430 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0430 \u0434\u043e 13.0. \u042d\u0442\u043e \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0447\u0430\u0439 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 Apple, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0441 async\/await.\u00a0<\/p>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 mustache-\u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u2014 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 lossy. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0435 \u0431\u044b\u043b \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u0431\u0440\u043e\u0441\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0443, \u0432\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d;<\/p>\n<\/li>\n<li>\n<p>Client \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0442\u0438\u043b\u0435 async\/await, \u043d\u0435\u043b\u044c\u0437\u044f \u0435\u0433\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0438\u043b\u0435 \u00ab\u0434\u043e async\/await\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/tree\/b59b8a32f3c9fb8b9df1ec95a8e1b35741a963bb\/Sources\/_OpenAPIGeneratorCore\/Translator\/CommonTranslations\"><u>\u0448\u0430\u0431\u043b\u043e\u043d\u044b<\/u><\/a> \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u044b. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0435\u0435 \u0440\u0430\u0437\u043c\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/issues\/25\"><u>\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f<\/u><\/a> \u0441\u0445\u0435\u043c\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 JSON-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0412\u043d\u0435\u0434\u0440\u0438\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>Swift OpenAPI Generator \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a SPM Plugin;<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 target.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u00ab\u043e\u0434\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u2014 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c\u00bb. \u041a\u0430\u043a\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u044e\u0441\u044b?<\/p>\n<ul>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d;<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u00ab\u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a SPM plugin, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c API: <a href=\"https:\/\/petstore.swagger.io\/\"><u>https:\/\/petstore.swagger.io\/<\/u><\/a>. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Swagger-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c Xcode 14.3.1, \u0430 OpenAPI Generator \u0432\u0435\u0440\u0441\u0438\u0438 0.1.10.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"yaml\">openapi: 3.0.1 info:   title: Swagger Petstore   description: 'This is a sample server Petstore server.  You can find out more about     Swagger at [http:\/\/swagger.io](http:\/\/swagger.io) or on [irc.freenode.net, #swagger](http:\/\/swagger.io\/irc\/).  For     this sample, you can use the api key `special-key` to test the authorization filters.'   termsOfService: http:\/\/swagger.io\/terms\/   contact:     email: apiteam@swagger.io   license:     name: Apache 2.0     url: http:\/\/www.apache.org\/licenses\/LICENSE-2.0.html   version: 1.0.6 externalDocs:   description: Find out more about Swagger   url: http:\/\/swagger.io servers: - url: https:\/\/petstore.swagger.io\/v2 - url: http:\/\/petstore.swagger.io\/v2 tags: - name: pet   description: Everything about your Pets   externalDocs:     description: Find out more     url: http:\/\/swagger.io - name: store   description: Access to Petstore orders - name: user   description: Operations about user   externalDocs:     description: Find out more about our store     url: http:\/\/swagger.io paths:   \/pet\/{petId}\/uploadImage:     post:       tags:       - pet       summary: uploads an image       operationId: uploadFile       parameters:       - name: petId         in: path         description: ID of pet to update         required: true         schema:           type: integer           format: int64       requestBody:         content:           multipart\/form-data:             schema:               properties:                 additionalMetadata:                   type: string                   description: Additional data to pass to server                 file:                   type: string                   description: file to upload                   format: binary       responses:         200:           description: successful operation           content:             application\/json:               schema:                 $ref: '#\/components\/schemas\/ApiResponse'       security:       - petstore_auth:         - write:pets         - read:pets   \/pet:     put:       tags:       - pet       summary: Update an existing pet       operationId: updatePet       requestBody:         description: Pet object that needs to be added to the store         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/Pet'           application\/xml:             schema:               $ref: '#\/components\/schemas\/Pet'         required: true       responses:         400:           description: Invalid ID supplied           content: {}         404:           description: Pet not found           content: {}         405:           description: Validation exception           content: {}       security:       - petstore_auth:         - write:pets         - read:pets       x-codegen-request-body-name: body     post:       tags:       - pet       summary: Add a new pet to the store       operationId: addPet       requestBody:         description: Pet object that needs to be added to the store         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/Pet'           application\/xml:             schema:               $ref: '#\/components\/schemas\/Pet'         required: true       responses:         405:           description: Invalid input           content: {}       security:       - petstore_auth:         - write:pets         - read:pets       x-codegen-request-body-name: body   \/pet\/findByStatus:     get:       tags:       - pet       summary: Finds Pets by status       description: Multiple status values can be provided with comma separated strings       operationId: findPetsByStatus       parameters:       - name: status         in: query         description: Status values that need to be considered for filter         required: true         style: form         explode: true         schema:           type: array           items:             type: string             default: available             enum:             - available             - pending             - sold       responses:         200:           description: successful operation           content:             application\/json:               schema:                 type: array                 items:                   $ref: '#\/components\/schemas\/Pet'             application\/xml:               schema:                 type: array                 items:                   $ref: '#\/components\/schemas\/Pet'         400:           description: Invalid status value           content: {}       security:       - petstore_auth:         - write:pets         - read:pets   \/pet\/findByTags:     get:       tags:       - pet       summary: Finds Pets by tags       description: Multiple tags can be provided with comma separated strings. Use         tag1, tag2, tag3 for testing.       operationId: findPetsByTags       parameters:       - name: tags         in: query         description: Tags to filter by         required: true         style: form         explode: true         schema:           type: array           items:             type: string       responses:         200:           description: successful operation           content:             application\/json:               schema:                 type: array                 items:                   $ref: '#\/components\/schemas\/Pet'             application\/xml:               schema:                 type: array                 items:                   $ref: '#\/components\/schemas\/Pet'         400:           description: Invalid tag value           content: {}       deprecated: true       security:       - petstore_auth:         - write:pets         - read:pets   \/pet\/{petId}:     get:       tags:       - pet       summary: Find pet by ID       description: Returns a single pet       operationId: getPetById       parameters:       - name: petId         in: path         description: ID of pet to return         required: true         schema:           type: integer           format: int64       responses:         200:           description: successful operation           content:             application\/json:               schema:                 $ref: '#\/components\/schemas\/Pet'             application\/xml:               schema:                 $ref: '#\/components\/schemas\/Pet'         400:           description: Invalid ID supplied           content: {}         404:           description: Pet not found           content: {}       security:       - api_key: []     post:       tags:       - pet       summary: Updates a pet in the store with form data       operationId: updatePetWithForm       parameters:       - name: petId         in: path         description: ID of pet that needs to be updated         required: true         schema:           type: integer           format: int64       requestBody:         content:           application\/x-www-form-urlencoded:             schema:               properties:                 name:                   type: string                   description: Updated name of the pet                 status:                   type: string                   description: Updated status of the pet       responses:         405:           description: Invalid input           content: {}       security:       - petstore_auth:         - write:pets         - read:pets     delete:       tags:       - pet       summary: Deletes a pet       operationId: deletePet       parameters:       - name: api_key         in: header         schema:           type: string       - name: petId         in: path         description: Pet id to delete         required: true         schema:           type: integer           format: int64       responses:         400:           description: Invalid ID supplied           content: {}         404:           description: Pet not found           content: {}       security:       - petstore_auth:         - write:pets         - read:pets   \/store\/order:     post:       tags:       - store       summary: Place an order for a pet       operationId: placeOrder       requestBody:         description: order placed for purchasing the pet         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/Order'         required: true       responses:         200:           description: successful operation           content:             application\/json:               schema:                 $ref: '#\/components\/schemas\/Order'             application\/xml:               schema:                 $ref: '#\/components\/schemas\/Order'         400:           description: Invalid Order           content: {}       x-codegen-request-body-name: body   \/store\/order\/{orderId}:     get:       tags:       - store       summary: Find purchase order by ID       description: For valid response try integer IDs with value >= 1 and &lt;= 10. Other         values will generated exceptions       operationId: getOrderById       parameters:       - name: orderId         in: path         description: ID of pet that needs to be fetched         required: true         schema:           maximum: 10           minimum: 1           type: integer           format: int64       responses:         200:           description: successful operation           content:             application\/json:               schema:                 $ref: '#\/components\/schemas\/Order'             application\/xml:               schema:                 $ref: '#\/components\/schemas\/Order'         400:           description: Invalid ID supplied           content: {}         404:           description: Order not found           content: {}     delete:       tags:       - store       summary: Delete purchase order by ID       description: For valid response try integer IDs with positive integer value.         Negative or non-integer values will generate API errors       operationId: deleteOrder       parameters:       - name: orderId         in: path         description: ID of the order that needs to be deleted         required: true         schema:           minimum: 1           type: integer           format: int64       responses:         400:           description: Invalid ID supplied           content: {}         404:           description: Order not found           content: {}   \/store\/inventory:     get:       tags:       - store       summary: Returns pet inventories by status       description: Returns a map of status codes to quantities       operationId: getInventory       responses:         200:           description: successful operation           content:             application\/json:               schema:                 type: object                 additionalProperties:                   type: integer                   format: int32       security:       - api_key: []   \/user\/createWithArray:     post:       tags:       - user       summary: Creates list of users with given input array       operationId: createUsersWithArrayInput       requestBody:         description: List of user object         content:           application\/json:             schema:               type: array               items:                 $ref: '#\/components\/schemas\/User'         required: true       responses:         default:           description: successful operation           content: {}       x-codegen-request-body-name: body   \/user\/createWithList:     post:       tags:       - user       summary: Creates list of users with given input array       operationId: createUsersWithListInput       requestBody:         description: List of user object         content:           application\/json:             schema:               type: array               items:                 $ref: '#\/components\/schemas\/User'         required: true       responses:         default:           description: successful operation           content: {}       x-codegen-request-body-name: body   \/user\/{username}:     get:       tags:       - user       summary: Get user by user name       operationId: getUserByName       parameters:       - name: username         in: path         description: 'The name that needs to be fetched. Use user1 for testing. '         required: true         schema:           type: string       responses:         200:           description: successful operation           content:             application\/json:               schema:                 $ref: '#\/components\/schemas\/User'             application\/xml:               schema:                 $ref: '#\/components\/schemas\/User'         400:           description: Invalid username supplied           content: {}         404:           description: User not found           content: {}     put:       tags:       - user       summary: Updated user       description: This can only be done by the logged in user.       operationId: updateUser       parameters:       - name: username         in: path         description: name that need to be updated         required: true         schema:           type: string       requestBody:         description: Updated user object         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/User'         required: true       responses:         400:           description: Invalid user supplied           content: {}         404:           description: User not found           content: {}       x-codegen-request-body-name: body     delete:       tags:       - user       summary: Delete user       description: This can only be done by the logged in user.       operationId: deleteUser       parameters:       - name: username         in: path         description: The name that needs to be deleted         required: true         schema:           type: string       responses:         400:           description: Invalid username supplied           content: {}         404:           description: User not found           content: {}   \/user\/login:     get:       tags:       - user       summary: Logs user into the system       operationId: loginUser       parameters:       - name: username         in: query         description: The user name for login         required: true         schema:           type: string       - name: password         in: query         description: The password for login in clear text         required: true         schema:           type: string       responses:         200:           description: successful operation           headers:             X-Rate-Limit:               description: calls per hour allowed by the user               schema:                 type: integer                 format: int32             X-Expires-After:               description: date in UTC when token expires               schema:                 type: string                 format: date-time           content:             application\/json:               schema:                 type: string             application\/xml:               schema:                 type: string         400:           description: Invalid username\/password supplied           content: {}   \/user\/logout:     get:       tags:       - user       summary: Logs out current logged in user session       operationId: logoutUser       responses:         default:           description: successful operation           content: {}   \/user:     post:       tags:       - user       summary: Create user       description: This can only be done by the logged in user.       operationId: createUser       requestBody:         description: Created user object         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/User'         required: true       responses:         default:           description: successful operation           content: {}       x-codegen-request-body-name: body components:   schemas:     ApiResponse:       type: object       properties:         code:           type: integer           format: int32         type:           type: string         message:           type: string     Category:       type: object       properties:         id:           type: integer           format: int64         name:           type: string       xml:         name: Category     Pet:       required:       - photoUrls       type: object       properties:         id:           type: integer           format: int64         category:           $ref: '#\/components\/schemas\/Category'         name:           type: string           example: doggie         photoUrls:           type: array           xml:             wrapped: true           items:             type: string             xml:               name: photoUrl         tags:           type: array           xml:             wrapped: true           items:             $ref: '#\/components\/schemas\/Tag'         status:           type: string           description: pet status in the store           enum:           - available           - pending           - sold       xml:         name: Pet     Tag:       type: object       properties:         id:           type: integer           format: int64         name:           type: string       xml:         name: Tag     Order:       type: object       properties:         id:           type: integer           format: int64         petId:           type: integer           format: int64         quantity:           type: integer           format: int32         shipDate:           type: string           format: date-time         status:           type: string           description: Order Status           enum:           - placed           - approved           - delivered         complete:           type: boolean       xml:         name: Order     User:       type: object       properties:         id:           type: integer           format: int64         username:           type: string         firstName:           type: string         lastName:           type: string         email:           type: string         password:           type: string         phone:           type: string         userStatus:           type: integer           description: User Status           format: int32       xml:         name: User   securitySchemes:     api_key:       type: apiKey       name: api_key       in: header     petstore_auth:       type: oauth2       flows:         implicit:           authorizationUrl: https:\/\/petstore.swagger.io\/oauth\/authorize           scopes:             read:pets: read your pets             write:pets: modify pets in your account <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u043d\u0430\u0448 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c SPM-\u043f\u0430\u043a\u0435\u0442 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043b\u0435\u0434\u0443\u044f <a href=\"https:\/\/swiftpackageindex.com\/apple\/swift-openapi-generator\/0.1.9\/tutorials\/swift-openapi-generator\/clientxcode\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a>:<\/p>\n<pre><code class=\"swift\">\/\/ swift-tools-version: 5.8 \/\/ The swift-tools-version declares the minimum version of Swift required to build this package.  import PackageDescription  let package = Package(   name: \"PetsModule\",   platforms:[     .iOS(.v14),   ],   products:[     .library(name: \"PetsModule\", targets: [\"PetsModule\"]),   ],   dependencies:[     .package(url: \"https:\/\/github.com\/apple\/swift-openapi-generator\", .upToNextMinor(from: \"0.1.0\")),     .package(url: \"https:\/\/github.com\/apple\/swift-openapi-runtime\", .upToNextMinor(from: \"0.1.0\")),   ],   targets: [     .target(       name: \"PetsModule\",       dependencies:[         .product(name: \"OpenAPIRuntime\", package: \"swift-openapi-runtime\"),       ],       plugins:[         .plugin(name: \"OpenAPIGenerator\", package: \"swift-openapi-generator\"),       ]     ),   ] )<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>OpenAPIRuntime. \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f Core-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>OpenAPIGenerator. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u0430\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e.plugin, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430.\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043b\u0430\u0433\u0438\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0432\u0430 YAML-\u0444\u0430\u0439\u043b\u0430: \u0444\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f <code>openapi.yaml<\/code>, \u0438 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f <code>openapi-generator-config<\/code>. \u0424\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432\u044b\u0448\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0424\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"yaml\">generate:  - types  - client<\/code><\/pre>\n<p>\u0412 \u043d\u0451\u043c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>Types \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e DTO;<\/p>\n<\/li>\n<li>\n<p>Client \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 DTO;<\/p>\n<\/li>\n<li>\n<p>Server \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 API.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e types \u0438 client.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c41\/da9\/0c0\/c41da90c0ba35a942bf1f562a3f9f51d.png\" width=\"510\" height=\"314\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c41\/da9\/0c0\/c41da90c0ba35a942bf1f562a3f9f51d.png\"\/><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043d\u0430\u0448 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d PetsModule. \u0421\u0431\u043e\u0440\u043a\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0437\u0430\u043d\u044f\u043b\u0430 105 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 MacBook Pro M1, Xcode 14.3.1. \u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u2014 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0451\u043d \u0442\u0430\u0439\u043c\u043b\u0430\u0439\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438. \u0418\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e:<\/p>\n<ul>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u00ab\u0441 \u043d\u0443\u043b\u044f\u00bb \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 1.5 \u043c\u0438\u043d\u0443\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 5,7 \u0441\u0435\u043a\u0443\u043d\u0434\u044b;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043c\u0435\u043d\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0412\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ea4\/971\/a75\/ea4971a75c8cd1a549b02a67d353c04c.png\" width=\"1600\" height=\"398\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ea4\/971\/a75\/ea4971a75c8cd1a549b02a67d353c04c.png\"\/><\/figure>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u043e YAML \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 18 \u041a\u0411 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 5 \u0441\u0435\u043a\u0443\u043d\u0434, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 3 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0430\u0442\u044c \u043d\u0430 \u0432\u0445\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 109 \u041a\u0411, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0439\u043c\u0435\u0442 \u0443\u0436\u0435 \u043e\u043a\u043e\u043b\u043e 26 \u0441\u0435\u043a\u0443\u043d\u0434, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 20 \u0441\u0435\u043a\u0443\u043d\u0434 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/issues\/36\"><u>\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442<\/u><\/a> \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 content type, \u0438 \u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c:<\/p>\n<blockquote>\n<p><code>warning: Feature \"Multiple content types\" is not supported<\/code><\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e <code>multipart\/form-data<\/code> \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438? \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b:<\/p>\n<ul>\n<li>\n<p>Client.swift. \u0412 \u043d\u0451\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API;<\/p>\n<\/li>\n<li>\n<p>Server.swift. \u0412 \u043d\u0451\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 API. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043f\u0443\u0441\u0442, \u0442.\u043a. Server \u043c\u044b \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>Types.swift. \u0412 \u043d\u0451\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 Derived Data \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u043f\u0443\u0442\u0438:<\/p>\n<blockquote>\n<p><code>\/Users\/{username}\/Library\/Developer\/Xcode\/DerivedData\/{projectName}\/SourcePackages\/plugins\/petsmodule.output\/PetsModule\/OpenAPIGenerator\/GeneratedSources\/<\/code><\/p>\n<\/blockquote>\n<p>\u042d\u0442\u043e \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0438\u043c \u0438\u0437 Xcode \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0442.\u043a. \u043f\u043e \u2318+\u21e7+O \u043a \u043d\u0438\u043c \u043d\u0435 \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0430 \u043f\u043e \u2318+\u043a\u043b\u0438\u043a Xcode \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u043d\u0430\u0439\u0442\u0438. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 merge conflict.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0430\u0439\u043b Types.swift. \u041a\u0430\u043a\u043e\u0432\u0430 \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/84f\/d2c\/a76\/84fd2ca76dcc8ef8123595667d31cef4.png\" width=\"531\" height=\"1131\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/84f\/d2c\/a76\/84fd2ca76dcc8ef8123595667d31cef4.png\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0412 APIProtocol \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b API-\u043c\u0435\u0442\u043e\u0434\u044b, \u0438\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435. \u0417\u0430\u0442\u0435\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Servers \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Components \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u0441\u0435 \u043c\u043e\u0434\u0435\u043b\u0438-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0412 Operations \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0435\u043c\u0443 Input \u0438 Output.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Client.swift.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 Client, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u043c HTTP-\u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 URLSession. \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 Middleware \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d. \u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Middleware \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c Mock-\u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0447\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0438\u043f\u043e\u0432\u0430\u044f \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"swift\">  \/\/\/ Find pet by ID   \/\/\/   \/\/\/ Returns a single pet   \/\/\/   \/\/\/ - Remark: HTTP `GET \/pet\/{petId}`.   \/\/\/ - Remark: Generated from `#\/paths\/\/pet\/{petId}\/get(getPetById)`.   public func getPetById(_ input: Operations.getPetById.Input) async throws     -> Operations.getPetById.Output   {     try await client.send(       input: input,       forOperation: Operations.getPetById.id,       serializer: { input in         let path = try converter.renderedRequestPath(           template: \"\/pet\/{}\",           parameters: [input.path.petId]         )         var request: OpenAPIRuntime.Request = .init(path: path, method: .get)         suppressMutabilityWarning(&amp;request)         try converter.setHeaderFieldAsText(           in: &amp;request.headerFields,           name: \"accept\",           value: \"application\/json\"         )         return request       },       deserializer: { response in         switch response.statusCode {         case 200:           let headers: Operations.getPetById.Output.Ok.Headers = .init()           let contentType = converter.extractContentTypeIfPresent(             in: response.headerFields           )           let body: Operations.getPetById.Output.Ok.Body           if try contentType == nil             || converter.isMatchingContentType(               received: contentType,               expectedRaw: \"application\/json\"             )           {             body = try converter.getResponseBodyAsJSON(               Components.Schemas.Pet.self,               from: response.body,               transforming: { value in .json(value) }             )           } else {             throw converter.makeUnexpectedContentTypeError(contentType: contentType)           }           return .ok(.init(headers: headers, body: body))         case 400:           let headers: Operations.getPetById.Output.BadRequest.Headers = .init()           return .badRequest(.init(headers: headers, body: nil))         case 404:           let headers: Operations.getPetById.Output.NotFound.Headers = .init()           return .notFound(.init(headers: headers, body: nil))         default: return .undocumented(statusCode: response.statusCode, .init())         }       }     )   } <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e async\/await.<\/p>\n<h2>\u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445:<\/p>\n<pre><code class=\"swift\">import Foundation import OpenAPIRuntime import PetsModule  final class NetworkClientFactory {   private init() { }   static func makePetsClient() -> PetsModule.Client {     PetsModule.Client(       serverURL: try! PetsModule.Servers.server1(),       configuration: Configuration(dateTranscoder: .iso8601),       transport: NetworkClientTransport(),       middlewares: [NetworkClientMiddleware()]     )   } }  private final class NetworkClientTransport: ClientTransport {   private let session = URLSession.shared   func send(_ request: OpenAPIRuntime.Request, baseURL: URL, operationID: String) async throws -> OpenAPIRuntime.Response {     var urlString = baseURL.absoluteString + request.path     if let query = request.query {       urlString += \"?\\(query)\"     }     let newUrl = URL(string: urlString)!     var urlRequest = URLRequest(url: newUrl)     urlRequest.httpMethod = request.method.rawValue     urlRequest.httpBody = request.body     urlRequest.allHTTPHeaderFields = Dictionary(uniqueKeysWithValues: request.headerFields.map { (key: $0.name, value: $0.value) })     let (bodyData, urlResponse) = try await session.data(for: urlRequest)     let code = (urlResponse as? HTTPURLResponse)?.statusCode ?? 0     let headers = (urlResponse as? HTTPURLResponse)?.allHeaderFields.map { HeaderField(name: $0.key as! String, value: $0.value as! String)} ?? []     return OpenAPIRuntime.Response(statusCode: code, headerFields: headers, body: bodyData)   } }  private final class NetworkClientMiddleware: ClientMiddleware {   func intercept(_ request: OpenAPIRuntime.Request, baseURL: URL, operationID: String, next: @Sendable (OpenAPIRuntime.Request, URL) async throws -> OpenAPIRuntime.Response) async throws -> OpenAPIRuntime.Response {     print(\"Intercepting: \\(request), baseURL: \\(baseURL)\")     return try await next(request, baseURL)   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Middleware. \u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u0446\u0435\u043b\u043e\u043c.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6537f51d72e08276d7b7c32f\" data-style=\"\" id=\"6537f51d72e08276d7b7c32f\" width=\"\"><\/div>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0435\u0435, \u0442\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c Input, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 query, body, headers \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c Output \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u043a\u0438\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0430 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<h2>\u0412\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0442\u043e\u0433\u0438<\/h2>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 API \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442 \u0440\u044f\u0434\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u043e\u0448\u0438\u0431\u043e\u043a. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0443\u0442\u0438\u043d\u044b \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e \u0435\u0434\u0438\u043d\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 DTO \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f, \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a API;<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b ClientMiddleware);<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442 (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b DateTranscoder);<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0438 \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Lossy Array. \u0414\u043b\u044f \u043d\u0430\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Lossy Array \u2014 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 multipart\/form-data. \u0414\u043b\u044f \u043d\u0430\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 content-type, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0443\u0441\u043e\u043c;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 (JSON). \u042d\u0442\u043e \u0442\u043e\u0436\u0435 \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0442.\u043a. \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041c\u044b \u0431\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c property wrapper, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 Lossy Decoding, \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438, \u043d\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0435\u0433\u043e \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>\u041e\u0442\u0432\u0435\u0447\u0430\u044f \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0433\u043e\u0442\u043e\u0432 \u043b\u0438 OpenAPI Generator \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430?\u00bb, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043d\u0435\u0442, \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0435\u0449\u0435 \u0441\u044b\u0440\u043e\u0432\u0430\u0442 \u0438 \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u044b\u0445 API, \u0432\u044b \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u044f\u0432\u0438\u0442 \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c MVP \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u043b\u0438\u0431\u043e \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u043b\u0438\u0431\u043e \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0442\u0435\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 \u2014 <a href=\"https:\/\/openapi-generator.tech\/\"><u>https:\/\/openapi-generator.tech\/<\/u><\/a>. \u042d\u0442\u043e\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439, \u043c\u0435\u043d\u0435\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043d \u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041c\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0442\u043e\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442.<\/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\/769624\/\"> https:\/\/habr.com\/ru\/articles\/769624\/<\/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! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0434\u0440\u0435\u0439, \u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u00ab\u041f\u0443\u043d\u043a\u0442 Ozon\u00bb. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0432\u044b\u0434\u0430\u0447\u0438 Ozon \u0432\u044b\u0434\u0430\u044e\u0442 \u043f\u043e\u0441\u044b\u043b\u043a\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b, \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0438\u0437\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438, \u0432\u043d\u0435\u0434\u0440\u0438\u0432 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Swift \u0438\u0437 YAML- \u0438\u043b\u0438 JSON-\u0444\u0430\u0439\u043b\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 DTO, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u043c\u0435\u0442\u043e\u0434\u044b API, \u043d\u0430\u0431\u043e\u0440\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0442.\u0434.<\/p>\n<p>\u041d\u0430 WWDC `23 Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u0441\u0432\u043e\u0439 Open Source-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\">Swift OpenAPI Generator<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u043e\u0442\u043e\u0432 \u043b\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0432\u0438\u0434\u0435 Swift OpenAPI Generator \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<h2>\u041a\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0445\u043e\u0442\u0438\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0441 OpenAPI Generator \u0432 \u0446\u0435\u043b\u043e\u043c?<\/h2>\n<p>DTO, \u043e\u043d \u0436\u0435 Data Transfer Object, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0431\u044b\u0447\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0442\u0430\u043a\u043e\u0439:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 Swagger \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u043c\u0435\u0442\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c DTO, \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0435\u043c\u0443 \u0438\u043c\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Input \u2014 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0435\u043c\u0443 \u0438\u043c\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Output \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0435\u043c\u0443 \u0438\u043c\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"swift\">enum ChatsDTO {   struct Input: Encodable {     let startDate: Date     let endDate: Date   }    struct Output: Decodable {     struct Chat: Decodable {       let id: Int       let unreadCount: Int       let lastMessage: String     }      @LossyArray     private(set) var chats: [Chat]   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445<\/p>\n<ul>\n<li>\n<p>\u0420\u0443\u0442\u0438\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435. \u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0412 \u043d\u0430\u0448\u0435\u043c \u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 DTO;<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0440\u0430\u0437\u0443 \u043d\u0443\u0436\u043d\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 DTO, \u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c DTO \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0448\u0438 DTO \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 Swagger \u0441\u0440\u0435\u0434\u0438 \u043d\u0430\u0448\u0438\u0445 DTO, \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u0430, \u0447\u0442\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043e\u0442\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u043f\u043b\u044e\u0441:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 DTO \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0432\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a API \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c Swift OpenAPI Generator. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0437\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0435\u0440\u0451\u0442 Swift-\u043a\u043e\u0434, \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043d\u0430\u043c. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u0435\u0434\u0438\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0427\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Apple Swift OpenAPI Generator<\/h2>\n<p>Swift OpenAPI Generator \u2014 \u044d\u0442\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API, \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Swift \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Vapor. \u041f\u0440\u043e\u0435\u043a\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432: <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/tree\/3b128349cb337b7f3dc5ca01277208160283a6f2\"><u>\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440<\/u><\/a> \u0438 <a href=\"https:\/\/github.com\/apple\/swift-openapi-runtime\/tree\/4312caf57504e6b9111e6fa5474c9a7454a03e9b\"><u>runtime<\/u><\/a>. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0443\u0434\u043d\u0430, \u043d\u043e \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0445\u0432\u0430\u0442\u0430\u0435\u0442. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e Swift OpenAPI Generator \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b iOS 15.0 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e \u0437\u0430\u0442\u0435\u043c \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f iOS \u0431\u044b\u043b\u0430 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0430 \u0434\u043e 13.0. \u042d\u0442\u043e \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0447\u0430\u0439 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 Apple, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0441 async\/await.\u00a0<\/p>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 mustache-\u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u2014 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 lossy. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0435 \u0431\u044b\u043b \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u0431\u0440\u043e\u0441\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0443, \u0432\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d;<\/p>\n<\/li>\n<li>\n<p>Client \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0442\u0438\u043b\u0435 async\/await, \u043d\u0435\u043b\u044c\u0437\u044f \u0435\u0433\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0438\u043b\u0435 \u00ab\u0434\u043e async\/await\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/tree\/b59b8a32f3c9fb8b9df1ec95a8e1b35741a963bb\/Sources\/_OpenAPIGeneratorCore\/Translator\/CommonTranslations\"><u>\u0448\u0430\u0431\u043b\u043e\u043d\u044b<\/u><\/a> \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u044b. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0435\u0435 \u0440\u0430\u0437\u043c\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/apple\/swift-openapi-generator\/issues\/25\"><u>\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f<\/u><\/a> \u0441\u0445\u0435\u043c\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 JSON-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0412\u043d\u0435\u0434\u0440\u0438\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>Swift OpenAPI Generator \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a SPM Plugin;<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 target.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u00ab\u043e\u0434\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u2014 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c\u00bb. \u041a\u0430\u043a\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u044e\u0441\u044b?<\/p>\n<ul>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d;<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u00ab\u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a SPM plugin, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c API: <a href=\"https:\/\/petstore.swagger.io\/\"><u>https:\/\/petstore.swagger.io\/<\/u><\/a>. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Swagger-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 OpenAPI-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c Xcode 14.3.1, \u0430 OpenAPI Generator \u0432\u0435\u0440\u0441\u0438\u0438 0.1.10.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"yaml\">openapi: 3.0.1 info:   title: Swagger Petstore   description: 'This is a sample server Petstore server.  You can find out more about     Swagger at [http:\/\/swagger.io](http:\/\/swagger.io) or on [irc.freenode.net, #swagger](http:\/\/swagger.io\/irc\/).  For     this sample, you can use the api key `special-key` to test the authorization filters.'   termsOfService: http:\/\/swagger.io\/terms\/   contact:     email: apiteam@swagger.io   license:     name: Apache 2.0     url: http:\/\/www.apache.org\/licenses\/LICENSE-2.0.html   version: 1.0.6 externalDocs:   description: Find out more about Swagger   url: http:\/\/swagger.io servers: - url: https:\/\/petstore.swagger.io\/v2 - url: http:\/\/petstore.swagger.io\/v2 tags: - name: pet   description: Everything about your Pets   externalDocs:     description: Find out more     url: http:\/\/swagger.io - name: store   description: Access to Petstore orders - name: user   description: Operations about user   externalDocs:     description: Find out more about our store     url: http:\/\/swagger.io paths:   \/pet\/{petId}\/uploadImage:     post:       tags:       - pet       summary: uploads an image       operationId: uploadFile       parameters:       - name: petId         in: path         description: ID of pet to update         required: true         schema:           type: integer           format: int64       requestBody:         content:           multipart\/form-data:             schema:               properties:                 additionalMetadata:                   type: string                   description: Additional data to pass to server                 file:                   type: string                   description: file to upload                   format: binary       responses:         200:           description: successful operation           content:             application\/json:               schema:                 $ref: '#\/components\/schemas\/ApiResponse'       security:       - petstore_auth:         - write:pets         - read:pets   \/pet:     put:       tags:       - pet       summary: Update an existing pet       operationId: updatePet       requestBody:         description: Pet object that needs to be added to the store         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/Pet'           application\/xml:             schema:               $ref: '#\/components\/schemas\/Pet'         required: true       responses:         400:           description: Invalid ID supplied           content: {}         404:           description: Pet not found           content: {}         405:           description: Validation exception           content: {}       security:       - petstore_auth:         - write:pets         - read:pets       x-codegen-request-body-name: body     post:       tags:       - pet       summary: Add a new pet to the store       operationId: addPet       requestBody:         description: Pet object that needs to be added to the store         content:           application\/json:             schema:               $ref: '#\/components\/schemas\/Pet'           application\/xml:             schema:               $ref: '#\/components\/schemas\/Pet'         required: true       responses:         405:           description: Invalid input           content: {}       security:       - petstore_auth:         - write:pets         - read:pets       x-codegen-request-body-name: body   \/pet\/findByStatus:     get:       tags:       - pet       summary: Finds Pets by status       description: Multiple status values can be provided with comma separated strings       operationId: findPetsByStatus       parameters:       - name: status         in: query         description: Status values that need to be considered for filter         required: true         style: form         explode: true         schema:           type: array           items:             type: string             default: available             enum:             - available             - pending             - sold       responses:         200:           description: successful operation           content:             application\/json:               schema:                 type: array                 items:                   $ref: '#\/components\/schemas\/Pet'             application\/xml:               schema:                 type: array                 items:                   $ref: '#\/components\/schemas\/Pet'         400:           description: Invalid status value           content: {}       security:       -<\/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-358381","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358381","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=358381"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358381\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}