{"id":347861,"date":"2023-05-25T09:01:54","date_gmt":"2023-05-25T09:01:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347861"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347861","title":{"rendered":"<span>\u041a\u0430\u043a \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u0432 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 OpenAPI<\/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<p>\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0440\u043e\u0439 \u0434\u043e \u043d\u0435\u043c\u044b\u0441\u043b\u0438\u043c\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041c\u044b \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u0440\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u043d\u0430 \u0441\u0435\u0431\u0435 \u0432\u0441\u0435 \u00ab\u043f\u0440\u0435\u043b\u0435\u0441\u0442\u0438\u00bb \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0437\u043e\u0440 \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041f\u043e\u0438\u0441\u043a\u0438 \u0443\u0432\u0435\u043d\u0447\u0430\u043b\u0438\u0441\u044c \u0443\u0441\u043f\u0435\u0445\u043e\u043c, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u044b \u043d\u0435 \u043f\u0438\u0448\u0435\u043c \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u0430\u043c\u0438.<\/p>\n<p>\u042f \u0421\u0435\u0440\u0433\u0435\u0439 \u0428\u0435\u0432\u0446\u043e\u0432, Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 KODE. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0432 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0447\u0430\u0441\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/085\/1a6\/67e\/0851a667e55a01950c7505f360d6d929.png\" width=\"2560\" height=\"1440\"><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<a href=\"https:\/\/developers.themoviedb.org\/3\/getting-started\/introduction\" rel=\"noopener noreferrer nofollow\"> <u>TMDB API<\/u><\/a>.<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435:<\/p>\n<ol>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u043d\u0430 retrofit2, \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u0445 \u0438 kotlin-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u2014 \u0437\u0430\u043f\u0443\u0441\u043a gradle-\u0442\u0430\u0441\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\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 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u043f\u043e\u0434 \u043d\u0443\u0436\u0434\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ol>\n<li>\n<p>\u0424\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 OpenApi.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0424\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h2>\n<p>OpenApi-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 json\/yaml \u0444\u0430\u0439\u043b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435, \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f. \u041f\u0438\u0441\u0430\u0442\u044c \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u043c. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b.<\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438 \u043c\u044b \u2014<a href=\"https:\/\/stoplight.io\/\" rel=\"noopener noreferrer nofollow\"> <u>Stoplight<\/u><\/a>. TMDB API, \u043a\u0441\u0442\u0430\u0442\u0438, \u0442\u043e\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Stoplight. \u041f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u043f\u0438\u0448\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c<a href=\"https:\/\/drive.google.com\/file\/d\/1OnONoFebXD6nTVfmPfSPYAwhRvmcnxkY\/view?usp=sharing\" rel=\"noopener noreferrer nofollow\"><u> \u043e\u0442\u0441\u044e\u0434\u0430<\/u><\/a>.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e Stoplight \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e.<\/p>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/448\/8bb\/96b\/4488bb96b62b22bb2a0f916c255a317a.png\" width=\"1852\" height=\"885\"><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2bf\/69c\/a40\/2bf69ca40aa6b58a1ed8a41de0180768.png\" width=\"1831\" height=\"920\"><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c8e\/a7f\/88c\/c8ea7f88cbf33137f611cffa6b28b65b.png\" width=\"1867\" height=\"895\"><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/184\/7a9\/cd0\/1847a9cd00f5e10f9654d7ed7fbd4aa6.png\" width=\"1857\" height=\"892\"><\/figure>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c0\/5d9\/822\/1c05d982217b4226a28c050d4caae142.png\" width=\"1825\" height=\"911\"><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/504\/f85\/39d\/504f8539d4ae50c746c02a6912cac324.png\" width=\"1858\" height=\"909\"><\/figure>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0435\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/333\/95d\/a44\/33395da44ffaae14eed6f1d9db74b05b.png\" width=\"1780\" height=\"879\"><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71c\/b9f\/d5b\/71cb9fd5b6fbe12f93a9936224070724.png\" width=\"1668\" height=\"869\"><\/figure>\n<p>\u0424\u0430\u0439\u043b \u043a\u043b\u0430\u0434\u0435\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u042f \u043f\u043e\u043b\u043e\u0436\u0443 \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043c\u043e\u0434\u0443\u043b\u044f app \u0440\u044f\u0434\u043e\u043c \u0441 build.gradle.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d35\/33a\/e45\/d3533ae4560058809669d8171ff72570.png\" width=\"2398\" height=\"1322\"><\/figure>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/h2>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438<a href=\"https:\/\/github.com\/OpenAPITools\/openapi-generator\/tree\/master\/modules\/openapi-generator-gradle-plugin\" rel=\"noopener noreferrer nofollow\"> <u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0433\u043e. \u0418\u0434\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 build.gradle \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code>\/\/ ... plugins {   \/\/ ...   id \"org.openapi.generator\" version \"6.3.0\" apply false }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e:<\/p>\n<pre><code>plugins {   \/\/ ...   id \"org.openapi.generator\" }<\/code><\/pre>\n<p>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0423\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e extension&#8217;\u0430 openApiGenerate.<\/p>\n<ul>\n<li>\n<p>generatorName \u2014 \u044f\u0437\u044b\u043a, \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\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>inputSpec \u2014 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>additionalProperties \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c. \u041f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 okHttp3 \u0438 moshi, \u043d\u0430\u043c \u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0443, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/openapi-generator.tech\/docs\/generators\/kotlin\/\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<pre><code>openApiGenerate {   generatorName = \"kotlin\"   inputSpec = \"${projectDir.path}\/movie-db-api.yaml\"   additionalProperties = [     \"library\": \"jvm-retrofit2\",     \"serializationLibrary\": \"kotlinx_serialization\",     \"useCoroutines\": \"true\"   ] }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u041c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u0441\u043a openApiGenerate \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 build\/generate-resources.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f59\/0fd\/246\/f590fd246647a7aac3e95d4972b174b1.png\" width=\"1315\" height=\"793\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 MovieServiceApi, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 retrofit2:<\/p>\n<pre><code class=\"kotlin\">interface MovieServiceApi {   \/\/ \u2026    @GET(\"3\/movie\/{movie_id}\")    suspend fun getMovieDetails(@Path(\"movie_id\") movieId: kotlin.Long, @Query(\"language\") language: kotlin.String? = \"en-US\"): Response&lt;MovieDetails&gt;     \/\/ \u2026    @GET(\"3\/movie\/popular\")    suspend fun getPopularMovies(@Query(\"language\") language: kotlin.String? = \"en-US\", @Query(\"page\") page: kotlin.Int? = 1, @Query(\"region\") region: kotlin.String? = null): Response&lt;PopularMovies&gt;  }<\/code><\/pre>\n<p>\u0423\u0436\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0437\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0432 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u043e \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u0431\u0438\u043b\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043d\u0435\u0441\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>import org.openapitools.generator.gradle.plugin.tasks.GenerateTask \/\/ 1  android {   \/\/ ...   sourceSets.main.kotlin.srcDirs += \"${buildDir.path}\/openapi\" \/\/ 2   tasks.preBuild {     dependsOn(tasks.withType(GenerateTask))   } \/\/ 3 }  openApiGenerate {   \/\/ ...   outputDir = \"${buildDir.path}\/openapi\" \/\/ 4   \/\/ ... }<\/code><\/pre>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0442\u0430\u0441\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f.3.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 sourceSet&#8217;\u0430 \u043f\u0430\u043f\u043a\u0438 build\/openapi. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b IDE \u0432\u0438\u0434\u0435\u043b\u0430 \u044d\u0442\u043e\u0442 sourceSet, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c preBuild \u0442\u0430\u0441\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u043e\u0442 \u0442\u0430\u0441\u043a\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u0431\u0438\u043b\u0434\u0435. (\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043d\u043e \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c. \u0418\u043c\u0435\u0439\u0442\u0435 \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0443. \u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0430\u0441\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/93b\/fc6\/4e5\/93bfc64e581f1c961f8bf909056efa13.png\" width=\"1344\" height=\"825\"><\/figure>\n<p>\u0412\u0441\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (build.gradle, gradlew.bat \u0438 \u043f\u0440.) \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0443\u0442 \u0442\u0435, \u0447\u0442\u043e \u043b\u0435\u0436\u0430\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443 \u043d\u0430\u0441 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u043d\u043e\u0440\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b openapi-generator-ignore, \u0433\u0434\u0435 \u0443\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0443 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<pre><code>\/**\/docs\/ \/**\/gradle\/wrapper\/ \/**\/org\/openapitools\/client\/infrastructure\/ \/**\/.openapi-generator-ignore \/**\/build.gradle \/**\/gradlew \/**\/gradlew.bat \/**\/README.md \/**\/settings.gradle<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0442\u0443\u0434\u0430 \u0436\u0435, \u0433\u0434\u0435 \u0441\u043f\u0435\u043a\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef7\/f95\/1b7\/ef7f951b75d1e39aeaf2c845428c1171.png\" width=\"1468\" height=\"843\"><\/figure>\n<p>\u041d\u0443 \u0438, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u0441\u043a\u0430 \u0432 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 ignoreFileOverride. \u0417\u0430\u043e\u0434\u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u043c\u0435\u043d\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0437\u0430\u0434\u0430\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b apiPackage \u0438 modelPackage.<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   ignoreFileOverride = \"${projectDir.path}\/openapi-generator-ignore\"   apiPackage = \"com.example.popularmovies.schema.api\"   modelPackage = \"com.example.popularmovies.schema.model\"   \/\/ ... }<\/code><\/pre>\n<p>\u041a\u0430\u0440\u0442\u0438\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0430\u043a\u0430\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/394\/f84\/c2d\/394f84c2d354abef2680a3b61baa4792.png\" width=\"1378\" height=\"777\"><\/figure>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MovieServiceApi \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u044e\u0434\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 infrastructure, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0438\u0433\u043d\u043e\u0440-\u043b\u0438\u0441\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a7\/974\/d6e\/5a7974d6e16a66874fa31490bddac8ee.png\" width=\"3092\" height=\"1652\"><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb, \u043c\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043f\u043b\u0430\u0433\u0438\u043d \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 mustache. \u0412\u043e\u0442 <a href=\"https:\/\/github.com\/OpenAPITools\/openapi-generator\/tree\/master\/modules\/openapi-generator\/src\/main\/resources\/kotlin-client\" rel=\"noopener noreferrer nofollow\"><u>\u0442\u0443\u0442<\/u><\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 kotlin. \u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 data-\u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code>\u2026  \/**  * {{{description}}}  * {{#allVars}}  * @param {{{name}}} {{{description}}} {{\/allVars}}  *\/ {{#parcelizeModels}} @Parcelize {{\/parcelizeModels}} {{#multiplatform}}{{^discriminator}}@Serializable{{\/discriminator}}{{\/multiplatform}}{{#kotlinx_serialization}}{{#serializableModel}}@KSerializable{{\/serializableModel}}{{^serializableModel}}@Serializable{{\/serializableModel}}{{\/kotlinx_serialization}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{\/moshiCodeGen}}{{\/moshi}}{{#jackson}}{{#discriminator}}{{&gt;typeInfoAnnotation}}{{\/discriminator}}{{\/jackson}} {{#isDeprecated}} @Deprecated(message = \"This schema is deprecated.\") {{\/isDeprecated}} {{&gt;additionalModelTypeAnnotations}} {{#nonPublicApi}}internal {{\/nonPublicApi}}{{#discriminator}}interface{{\/discriminator}}{{^discriminator}}data class{{\/discriminator}} {{classname}}{{^discriminator}} (  {{#allVars}} {{#required}}{{&gt;data_class_req_var}}{{\/required}}{{^required}}{{&gt;data_class_opt_var}}{{\/required}}{{^-last}},{{\/-last}}  {{\/allVars}}  \u2026<\/code><\/pre>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439: \u0431\u0435\u0440\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u043f\u0440\u0430\u0432\u0438\u043c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c. \u042d\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f. \u0412\u0441\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0430\u043d\u0443\u0430\u043b\u044b \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/mustache.github.io\/\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. \u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0441 mustache \u0432 \u0434\u0435\u043c\u043a\u0435.<\/p>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code>{{#\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}\u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438{{\/\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}} \/\/ 1  {{^\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}\u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438{{\/\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}} \/\/ 2  {{#\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}{{{\u0438\u043c\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}}{{\/\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}} \/\/ 3<\/code><\/pre>\n<p>\u0417\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f, \u043b\u0438\u0431\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0435\u0441\u0442\u044c, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/p>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/github.com\/appKODE\/OpenApiGeneratorSample\/tree\/master\/app\/templates\" rel=\"noopener noreferrer nofollow\"><u>\u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c<\/u><\/a> \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c retrofit2, \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0438 kotlin-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 templates \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0442\u0443\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c7\/416\/b78\/2c7416b789f752c66c0573aabdfe84bc.png\" width=\"2726\" height=\"1538\"><\/figure>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c:<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   templateDir = \"${projectDir.path}\/templates\"   \/\/ additionalProperties \u0443\u0431\u0438\u0440\u0430\u0435\u043c, \u0442.\u043a. \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0439\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MovieServiceApi \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87f\/969\/031\/87f9690319819b95475488e7369f7a20.png\" width=\"1486\" height=\"775\"><\/figure>\n<p>\u0417\u0430\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0439\u0442\u0438 \u0432 MovieDetails, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 release_date.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/999\/299\/512\/999299512a69c430cbaeca61224d899f.png\" width=\"1432\" height=\"844\"><\/figure>\n<p>\u0421\u0432\u044f\u0437\u0430\u043d\u043e \u044d\u0442\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f string+date \u0432 \u0444\u0430\u0439\u043b\u0435 movie-db-api.yaml:<\/p>\n<pre><code class=\"yaml\">#\u2026 components:   schemas: # \u2026   MovieDetails: #    \u2026      release_date:        type: string        format: date #     \u2026<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0432 LocalDateTime. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043f\u0443\u0442\u0438, \u043a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 String \u0432\u043c\u0435\u0441\u0442\u043e LocalDateTime \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e typeMappings. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   typeMappings = [     \"string+date\": \"kotlin.String\"   ] }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u0431\u044d\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0434\u0430\u0442\u044b \u043a\u0430\u043a \u043f\u043e\u043f\u0430\u043b\u043e, \u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 LocalDateTime \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 LocalDateTime \u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 LocalDateSerializer \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u0432 \u043f\u0430\u043a\u0435\u0442 com.example.popularmovies.data.serializers:<\/p>\n<pre><code class=\"kotlin\">import java.time.LocalDate import java.time.format.DateTimeFormatter import kotlinx.serialization.KSerializer import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder  object LocalDateSerializer : KSerializer&lt;LocalDate&gt; {  override val descriptor: SerialDescriptor =    PrimitiveSerialDescriptor(\"LocalDate\", PrimitiveKind.STRING)   override fun deserialize(decoder: Decoder): LocalDate {    return LocalDate.parse(decoder.decodeString(), DateTimeFormatter.ISO_LOCAL_DATE)  }   override fun serialize(encoder: Encoder, value: LocalDate) {    encoder.encodeString(value.format(DateTimeFormatter.ISO_LOCAL_DATE))  } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c additionalProperties, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0443\u0434\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e serializersPackage.<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   additionalProperties = [     \"serializersPackage\": \"com.example.popularmovies.data.serializers\"   ] }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445:<\/p>\n<pre><code>import kotlinx.serialization.* {{#serializersPackage}}import {{serializersPackage}}.*{{\/serializersPackage}}  \/\/ \u2026<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442:<\/p>\n<pre><code class=\"kotlin\">import com.example.popularmovies.schema.model.Genre  import kotlinx.serialization.* import com.example.popularmovies.data.serializers.*  \/\/ ...  @Serializable public data class MovieDetails (     \/\/ \u2026     @Serializable(with = LocalDateSerializer::class)    @SerialName(value = \"release_date\") val releaseDate: java.time.LocalDate?,     \/\/ \u2026 )<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 budget \u0438 revenue \u2014 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f Int, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0434\u0440\u0443\u0433\u0438\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f Long.<\/p>\n<pre><code class=\"kotlin\">@Serializable public data class MovieDetails (     \/\/ \u2026     @SerialName(value = \"budget\") val budget: kotlin.Int?,     @SerialName(value = \"revenue\") val revenue: kotlin.Int?,     @SerialName(value = \"runtime\") val runtime: kotlin.Long?,    \/\/ \u2026 )<\/code><\/pre>\n<p>\u0411\u044e\u0434\u0436\u0435\u0442 \u0438 \u0441\u0431\u043e\u0440\u044b \u0444\u0438\u043b\u044c\u043c\u0430 \u044f\u0432\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Int (2 147 483 647). \u0412 \u0447\u0435\u043c \u0436\u0435 \u0442\u0443\u0442 \u0434\u0435\u043b\u043e? \u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0444\u0430\u0439\u043b movie-db-api.yaml, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e budget \u0438 revenue \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f integer+usd, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a runtime, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f integer+int64.<\/p>\n<pre><code class=\"yaml\">\u2026 components:   schemas: # ...   MovieDetails: #    \u2026      budget:        type: integer        format: usd      revenue:        type: integer        format: usd      runtime:        type: integer        format: int64 #   \u2026<\/code><\/pre>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 runtime \u0441 \u0442\u0438\u043f\u043e\u043c integer+int64 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0438\u043f Long, \u0430 \u0432\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 integer+usd \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439, \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0441 \u043d\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u043b\u044f integer &#8212; Int. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e typeMappings.<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   typeMappings = [     \"integer\": \"kotlin.Long\"   ] }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0438\u043f Long.<\/p>\n<pre><code class=\"kotlin\">@Serializable public data class MovieDetails (     \/\/ \u2026     @SerialName(value = \"budget\") val budget: kotlin.Long?,     @SerialName(value = \"revenue\") val revenue: kotlin.Long?,     \/\/ \u2026 )<\/code><\/pre>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u043c\u0435\u0441\u0442\u043e Long \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c Usd. Usd \u2014 \u044d\u0442\u043e value \u043a\u043b\u0430\u0441\u0441, \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\u044f \u0434\u043b\u044f \u0434\u0435\u043d\u0435\u0433. \u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u0432 \u043f\u0430\u043a\u0435\u0442 com.example.popularmovies.domain.entity.<\/p>\n<pre><code class=\"kotlin\">import kotlinx.serialization.Serializable  @Serializable @JvmInline value class Usd(val amount: Long)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0438\u043f.<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   typeMappings = [     \"integer\": \"kotlin.Long\",     \"integer+usd\": \"Usd\" \/\/ 1   ]   importMappings = [     \"Usd\": \"com.example.popularmovies.domain.entity.Usd\" \/\/ 2   ] }<\/code><\/pre>\n<ol>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0442\u0438\u043f integer+usd \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043f\u043f\u0438\u0442\u044c\u0441\u044f \u0432 Usd<\/p>\n<\/li>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u043a\u043b\u0430\u0441\u0441\u0443 \u0434\u043b\u044f \u0442\u0438\u043f\u0430 Usd<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>openApiGenerate {  generatorName = \"kotlin\"  inputSpec = \"${projectDir.path}\/movie-db-api.yaml\"  outputDir = \"${buildDir.path}\/openapi\"  ignoreFileOverride = \"${projectDir.path}\/openapi-generator-ignore\"  apiPackage = \"com.example.popularmovies.schema.api\"  modelPackage = \"com.example.popularmovies.schema.model\"  templateDir = \"${projectDir.path}\/templates\"  additionalProperties = [    \"serializersPackage\": \"com.example.popularmovies.data.serializers\"  ]  typeMappings = [    \"integer\": \"kotlin.Long\",    \"integer+usd\": \"Usd\"  ]  importMappings = [    \"Usd\": \"com.example.popularmovies.domain.entity.Usd\"  ] }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 budget \u0438 revenue \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f Usd. \u041a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u0431\u044b\u043b\u043e \u043d\u0443\u0436\u043d\u043e.<\/p>\n<pre><code class=\"kotlin\">@Serializable public data class MovieDetails (    \/\/ \u2026     @SerialName(value = \"budget\") val budget: com.example.popularmovies.domain.entity.Usd?,     @SerialName(value = \"revenue\") val revenue: com.example.popularmovies.domain.entity.Usd?,    \/\/ \u2026 )<\/code><\/pre>\n<p>\u041c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0432\u0441\u0435, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0443\u0436\u043d\u043e, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041c\u043e\u0436\u0435\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u043c\u044b \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p><iframe id=\"646cad0cd2201800a1bc4237\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/646cad0cd2201800a1bc4237\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h2>\u041b\u0430\u0439\u0444\u0445\u0430\u043a \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 mustache-\u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0430 <code>{{{this}}}<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e. \u0412 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 \u0441\u043f\u0435\u043a\u0438, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0435.<\/p>\n<h3>\u041a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443 \u043d\u0430\u0441<\/h3>\n<ol>\n<li>\n<p>\u0411\u0438\u0437\u043d\u0435\u0441-\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 (\u044d\u0442\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0431\u044d\u043a).<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0440\u0435\u0432\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 API.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0444\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u043e\u0441\u0438\u0442 \u043f\u0440\u0430\u0432\u043a\u0438 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u0438\u0441\u044c \u043c\u0430\u043f\u043f\u0435\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0451!<\/p>\n<\/li>\n<\/ol>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e<\/h3>\n<ul>\n<li>\n<p>\u0421\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c. \u0412\u043e\u043e\u0431\u0449\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a (\u043b\u0438\u0431\u043e \u0431\u044d\u043a) \u2014 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0440\u0430\u0432\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0440\u0430\u0432\u0434\u044b \u043e\u0434\u0438\u043d, \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u0441\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>KMM \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p>\u041d\u0443\u0436\u043d\u0430 \u0441\u043f\u0435\u043a\u0430 \u0432 OpenAPI.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0440\u0438\u0432\u043e\u0439 \u043d\u0435\u0439\u043c\u0438\u043d\u0433 \u0432 \u0441\u043f\u0435\u043a\u0435 \u2014 \u043a\u0440\u0438\u0432\u043e\u0439 \u043d\u0435\u0439\u043c\u0438\u043d\u0433 \u0432 \u043a\u043e\u0434\u0435. \u0423 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0447\u0443\u0432\u0441\u0442\u0432\u0430 \u0432\u043a\u0443\u0441\u0430 \u043d\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u0435\u043c\u0443 \u0434\u0430\u0434\u0438\u0442\u0435, \u0442\u043e \u043e\u043d \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0435 \u0434\u0440\u0443\u0436\u0438\u0442 \u0441 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0412\u0441\u0435 Request-\u044b \u0438 Response-\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 OpenAPI-\u0441\u043f\u0435\u043a\u0438. <a href=\"https:\/\/github.com\/OAI\/OpenAPI-Specification\/blob\/main\/versions\/3.0.3.md#components-object-example\" rel=\"noopener noreferrer nofollow\"><u>\u0422\u0443\u0442<\/u><\/a> \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0432\u044c\u044e \u0441\u043f\u0435\u043a\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0432\u0430\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435. \u00ab\u041f\u0440\u043e\u0432\u0435\u0440\u044e \u043f\u043e\u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00bb \u043d\u0435 \u043f\u0440\u043e\u043a\u0430\u0442\u0438\u0442.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/h3>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 TMDB \u043d\u0443\u0436\u043d\u043e \u0432 query \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c API key. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0438\u0436\u0435. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 API key \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e interceptor-\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e, \u0442.\u043a. \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043b\u0430\u0433\u0438\u043d \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e gradle-\u0442\u0430\u0441\u043a\u043e\u0432 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043f\u0435\u043a\u0438 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0430\u0441\u043a \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0438\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b outputDir \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0430\u0441\u043a\u0430 \u0431\u044b\u043b \u0441\u0432\u043e\u0439, \u0438\u043d\u0430\u0447\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0430\u0441\u043a \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u043c\u0430\u0442\u044c \u043a\u044d\u0448 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b <s>\u0438\u0437\u0432\u043b\u0435\u043a\u043b\u0438<\/s> \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0412\u0441\u0435\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432! \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0432\u0430\u0448\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c.<\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/appKODE\/OpenApiGeneratorSample\" rel=\"noopener noreferrer nofollow\"><u>Github \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/OpenAPITools\/openapi-generator\/tree\/master\/modules\/openapi-generator-gradle-plugin\" rel=\"noopener noreferrer nofollow\"><u>Github gradle-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 openapi-generator<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/openapi-generator.tech\/docs\/generators\/kotlin\/\" rel=\"noopener noreferrer nofollow\"><u>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Kotlin<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/OpenAPITools\/openapi-generator\/tree\/master\/modules\/openapi-generator\/src\/main\/resources\/kotlin-client\" rel=\"noopener noreferrer nofollow\"><u>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b mustache \u0434\u043b\u044f Kotlin<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/mustache.github.io\/\" rel=\"noopener noreferrer nofollow\"><u>\u0421\u0430\u0439\u0442 mustache<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developers.themoviedb.org\/3\/getting-started\/introduction\" rel=\"noopener noreferrer nofollow\"><u>The Movie Database API<\/u><\/a><\/p>\n<\/li>\n<\/ul>\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\/737010\/\"> https:\/\/habr.com\/ru\/articles\/737010\/<\/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<p>\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0440\u043e\u0439 \u0434\u043e \u043d\u0435\u043c\u044b\u0441\u043b\u0438\u043c\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041c\u044b \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u0440\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u043d\u0430 \u0441\u0435\u0431\u0435 \u0432\u0441\u0435 \u00ab\u043f\u0440\u0435\u043b\u0435\u0441\u0442\u0438\u00bb \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0437\u043e\u0440 \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041f\u043e\u0438\u0441\u043a\u0438 \u0443\u0432\u0435\u043d\u0447\u0430\u043b\u0438\u0441\u044c \u0443\u0441\u043f\u0435\u0445\u043e\u043c, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u044b \u043d\u0435 \u043f\u0438\u0448\u0435\u043c \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u0430\u043c\u0438.<\/p>\n<p>\u042f \u0421\u0435\u0440\u0433\u0435\u0439 \u0428\u0435\u0432\u0446\u043e\u0432, Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 KODE. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0432 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0447\u0430\u0441\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<a href=\"https:\/\/developers.themoviedb.org\/3\/getting-started\/introduction\" rel=\"noopener noreferrer nofollow\"> <u>TMDB API<\/u><\/a>.<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435:<\/p>\n<ol>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u043d\u0430 retrofit2, \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u0445 \u0438 kotlin-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u2014 \u0437\u0430\u043f\u0443\u0441\u043a gradle-\u0442\u0430\u0441\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\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 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u043f\u043e\u0434 \u043d\u0443\u0436\u0434\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ol>\n<li>\n<p>\u0424\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 OpenApi.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0424\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h2>\n<p>OpenApi-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 json\/yaml \u0444\u0430\u0439\u043b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435, \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f. \u041f\u0438\u0441\u0430\u0442\u044c \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u043c. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b.<\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438 \u043c\u044b \u2014<a href=\"https:\/\/stoplight.io\/\" rel=\"noopener noreferrer nofollow\"> <u>Stoplight<\/u><\/a>. TMDB API, \u043a\u0441\u0442\u0430\u0442\u0438, \u0442\u043e\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Stoplight. \u041f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u043f\u0438\u0448\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c<a href=\"https:\/\/drive.google.com\/file\/d\/1OnONoFebXD6nTVfmPfSPYAwhRvmcnxkY\/view?usp=sharing\" rel=\"noopener noreferrer nofollow\"><u> \u043e\u0442\u0441\u044e\u0434\u0430<\/u><\/a>.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e Stoplight \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e.<\/p>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0435\u043a\u0443:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0424\u0430\u0439\u043b \u043a\u043b\u0430\u0434\u0435\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u042f \u043f\u043e\u043b\u043e\u0436\u0443 \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043c\u043e\u0434\u0443\u043b\u044f app \u0440\u044f\u0434\u043e\u043c \u0441 build.gradle.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/h2>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438<a href=\"https:\/\/github.com\/OpenAPITools\/openapi-generator\/tree\/master\/modules\/openapi-generator-gradle-plugin\" rel=\"noopener noreferrer nofollow\"> <u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0433\u043e. \u0418\u0434\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 build.gradle \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code>\/\/ ... plugins {   \/\/ ...   id \"org.openapi.generator\" version \"6.3.0\" apply false }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e:<\/p>\n<pre><code>plugins {   \/\/ ...   id \"org.openapi.generator\" }<\/code><\/pre>\n<p>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0423\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e extension&#8217;\u0430 openApiGenerate.<\/p>\n<ul>\n<li>\n<p>generatorName \u2014 \u044f\u0437\u044b\u043a, \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\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>inputSpec \u2014 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>additionalProperties \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c. \u041f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 okHttp3 \u0438 moshi, \u043d\u0430\u043c \u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0443, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/openapi-generator.tech\/docs\/generators\/kotlin\/\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<pre><code>openApiGenerate {   generatorName = \"kotlin\"   inputSpec = \"${projectDir.path}\/movie-db-api.yaml\"   additionalProperties = [     \"library\": \"jvm-retrofit2\",     \"serializationLibrary\": \"kotlinx_serialization\",     \"useCoroutines\": \"true\"   ] }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u041c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u0441\u043a openApiGenerate \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 build\/generate-resources.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 MovieServiceApi, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 retrofit2:<\/p>\n<pre><code class=\"kotlin\">interface MovieServiceApi {   \/\/ \u2026    @GET(\"3\/movie\/{movie_id}\")    suspend fun getMovieDetails(@Path(\"movie_id\") movieId: kotlin.Long, @Query(\"language\") language: kotlin.String? = \"en-US\"): Response&lt;MovieDetails&gt;     \/\/ \u2026    @GET(\"3\/movie\/popular\")    suspend fun getPopularMovies(@Query(\"language\") language: kotlin.String? = \"en-US\", @Query(\"page\") page: kotlin.Int? = 1, @Query(\"region\") region: kotlin.String? = null): Response&lt;PopularMovies&gt;  }<\/code><\/pre>\n<p>\u0423\u0436\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0437\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0432 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u043e \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u0431\u0438\u043b\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043d\u0435\u0441\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>import org.openapitools.generator.gradle.plugin.tasks.GenerateTask \/\/ 1  android {   \/\/ ...   sourceSets.main.kotlin.srcDirs += \"${buildDir.path}\/openapi\" \/\/ 2   tasks.preBuild {     dependsOn(tasks.withType(GenerateTask))   } \/\/ 3 }  openApiGenerate {   \/\/ ...   outputDir = \"${buildDir.path}\/openapi\" \/\/ 4   \/\/ ... }<\/code><\/pre>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0442\u0430\u0441\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f.3.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 sourceSet&#8217;\u0430 \u043f\u0430\u043f\u043a\u0438 build\/openapi. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b IDE \u0432\u0438\u0434\u0435\u043b\u0430 \u044d\u0442\u043e\u0442 sourceSet, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c preBuild \u0442\u0430\u0441\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u043e\u0442 \u0442\u0430\u0441\u043a\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u0431\u0438\u043b\u0434\u0435. (\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043d\u043e \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c. \u0418\u043c\u0435\u0439\u0442\u0435 \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0443. \u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0430\u0441\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (build.gradle, gradlew.bat \u0438 \u043f\u0440.) \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0443\u0442 \u0442\u0435, \u0447\u0442\u043e \u043b\u0435\u0436\u0430\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443 \u043d\u0430\u0441 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u043d\u043e\u0440\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b openapi-generator-ignore, \u0433\u0434\u0435 \u0443\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0443 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<pre><code>\/**\/docs\/ \/**\/gradle\/wrapper\/ \/**\/org\/openapitools\/client\/infrastructure\/ \/**\/.openapi-generator-ignore \/**\/build.gradle \/**\/gradlew \/**\/gradlew.bat \/**\/README.md \/**\/settings.gradle<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0442\u0443\u0434\u0430 \u0436\u0435, \u0433\u0434\u0435 \u0441\u043f\u0435\u043a\u0430:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0443 \u0438, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u0441\u043a\u0430 \u0432 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 ignoreFileOverride. \u0417\u0430\u043e\u0434\u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u043c\u0435\u043d\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0437\u0430\u0434\u0430\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b apiPackage \u0438 modelPackage.<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   ignoreFileOverride = \"${projectDir.path}\/openapi-generator-ignore\"   apiPackage = \"com.example.popularmovies.schema.api\"   modelPackage = \"com.example.popularmovies.schema.model\"   \/\/ ... }<\/code><\/pre>\n<p>\u041a\u0430\u0440\u0442\u0438\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0430\u043a\u0430\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MovieServiceApi \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u044e\u0434\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 infrastructure, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0438\u0433\u043d\u043e\u0440-\u043b\u0438\u0441\u0442.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb, \u043c\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043f\u043b\u0430\u0433\u0438\u043d \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 mustache. \u0412\u043e\u0442 <a href=\"https:\/\/github.com\/OpenAPITools\/openapi-generator\/tree\/master\/modules\/openapi-generator\/src\/main\/resources\/kotlin-client\" rel=\"noopener noreferrer nofollow\"><u>\u0442\u0443\u0442<\/u><\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 kotlin. \u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 data-\u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code>\u2026  \/**  * {{{description}}}  * {{#allVars}}  * @param {{{name}}} {{{description}}} {{\/allVars}}  *\/ {{#parcelizeModels}} @Parcelize {{\/parcelizeModels}} {{#multiplatform}}{{^discriminator}}@Serializable{{\/discriminator}}{{\/multiplatform}}{{#kotlinx_serialization}}{{#serializableModel}}@KSerializable{{\/serializableModel}}{{^serializableModel}}@Serializable{{\/serializableModel}}{{\/kotlinx_serialization}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{\/moshiCodeGen}}{{\/moshi}}{{#jackson}}{{#discriminator}}{{&gt;typeInfoAnnotation}}{{\/discriminator}}{{\/jackson}} {{#isDeprecated}} @Deprecated(message = \"This schema is deprecated.\") {{\/isDeprecated}} {{&gt;additionalModelTypeAnnotations}} {{#nonPublicApi}}internal {{\/nonPublicApi}}{{#discriminator}}interface{{\/discriminator}}{{^discriminator}}data class{{\/discriminator}} {{classname}}{{^discriminator}} (  {{#allVars}} {{#required}}{{&gt;data_class_req_var}}{{\/required}}{{^required}}{{&gt;data_class_opt_var}}{{\/required}}{{^-last}},{{\/-last}}  {{\/allVars}}  \u2026<\/code><\/pre>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439: \u0431\u0435\u0440\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u043f\u0440\u0430\u0432\u0438\u043c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c. \u042d\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f. \u0412\u0441\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0430\u043d\u0443\u0430\u043b\u044b \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/mustache.github.io\/\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. \u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0441 mustache \u0432 \u0434\u0435\u043c\u043a\u0435.<\/p>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code>{{#\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}\u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438{{\/\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}} \/\/ 1  {{^\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}\u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438{{\/\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}} \/\/ 2  {{#\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}{{{\u0438\u043c\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}}}{{\/\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439}} \/\/ 3<\/code><\/pre>\n<p>\u0417\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f, \u043b\u0438\u0431\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0435\u0441\u0442\u044c, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/p>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/github.com\/appKODE\/OpenApiGeneratorSample\/tree\/master\/app\/templates\" rel=\"noopener noreferrer nofollow\"><u>\u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c<\/u><\/a> \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c retrofit2, \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0438 kotlin-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 templates \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0442\u0443\u0434\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c:<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   templateDir = \"${projectDir.path}\/templates\"   \/\/ additionalProperties \u0443\u0431\u0438\u0440\u0430\u0435\u043c, \u0442.\u043a. \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0439\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MovieServiceApi \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0439\u0442\u0438 \u0432 MovieDetails, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 release_date.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0432\u044f\u0437\u0430\u043d\u043e \u044d\u0442\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f string+date \u0432 \u0444\u0430\u0439\u043b\u0435 movie-db-api.yaml:<\/p>\n<pre><code class=\"yaml\">#\u2026 components:   schemas: # \u2026   MovieDetails: #    \u2026      release_date:        type: string        format: date #     \u2026<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0432 LocalDateTime. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043f\u0443\u0442\u0438, \u043a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 String \u0432\u043c\u0435\u0441\u0442\u043e LocalDateTime \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e typeMappings. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>openApiGenerate {   \/\/ ...   typeMappings = [     \"string+date\": \"kotlin.String\"   ] }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u0431\u044d\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0434\u0430\u0442\u044b \u043a\u0430\u043a \u043f\u043e\u043f\u0430\u043b\u043e, \u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 LocalDateTime \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 LocalDateTime \u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 LocalDateSerializer \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u0432 \u043f\u0430\u043a\u0435\u0442 com.example.popularmovies.data.serializers:<\/p>\n<pre><code class=\"kotlin\">import java.time.LocalDate import java.time.format.DateTimeFormatter import kotlinx.serialization.KSerializer import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import<\/code><\/pre>\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-347861","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347861","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=347861"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347861\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}