{"id":6697,"date":"2022-08-21T13:53:39","date_gmt":"2022-08-21T13:53:39","guid":{"rendered":"https:\/\/www.garysieling.com\/blog\/?p=6697"},"modified":"2022-08-21T13:53:39","modified_gmt":"2022-08-21T13:53:39","slug":"openapi-generator-cli-override-a-single-file","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/openapi-generator-cli-override-a-single-file\/","title":{"rendered":"OpenAPI Generator CLI &#8211; Override a single file"},"content":{"rendered":"\n<p>This is simple to do, but not obvious from the docs.<\/p>\n\n\n\n<p>First, find the mustache template you want to change.<\/p>\n\n\n\n<p>Then make a folder named for the kind of generator you&#8217;re working on, and put the customization there.<\/p>\n\n\n\n<p>When you invoke the generator CLI, use the -t argument with the folder you made &#8211; that&#8217;s all you have to do.<\/p>\n\n\n\n<p>You only need to add files you change. The CLI calls a Java jar, and this path is added to the classpath prior to anything else, so anything not included in the folder will ultimately still be found.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openapi-generator \\\n  generate -i openapi.yaml \\\n  -g java \\\n  -t .\/java \\\n  --additional-properties=\"&lt;properties here>\" \\\n  -o .\/api-bindings\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is simple to do, but not obvious from the docs. First, find the mustache template you want to change. Then make a folder named for the kind of generator you&#8217;re working on, and put the customization there. When you invoke the generator CLI, use the -t argument with the folder you made &#8211; that&#8217;s &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/openapi-generator-cli-override-a-single-file\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OpenAPI Generator CLI &#8211; Override a single file&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[300],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6697"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=6697"}],"version-history":[{"count":1,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6697\/revisions"}],"predecessor-version":[{"id":6698,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6697\/revisions\/6698"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=6697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=6697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=6697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}