forked from loafle/openapi-generator-original
129 lines
28 KiB
HTML
129 lines
28 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Guidelines For Contributing · OpenAPI Generator</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="<h2><a class="anchor" aria-hidden="true" id="before-submitting-an-issue"></a><a href="#before-submitting-an-issue" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Before submitting an issue</h2>
|
||
"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Guidelines For Contributing · OpenAPI Generator"/><meta property="og:type" content="website"/><meta property="og:url" content="https://openapi-generator.tech/index.html"/><meta property="og:description" content="<h2><a class="anchor" aria-hidden="true" id="before-submitting-an-issue"></a><a href="#before-submitting-an-issue" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Before submitting an issue</h2>
|
||
"/><meta property="og:image" content="https://openapi-generator.tech/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://openapi-generator.tech/img/icons/twitter.svg"/><link rel="shortcut icon" href="/img/favicon.png"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><link rel="alternate" type="application/atom+xml" href="https://openapi-generator.tech/blog/atom.xml" title="OpenAPI Generator Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://openapi-generator.tech/blog/feed.xml" title="OpenAPI Generator Blog RSS Feed"/><script>
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||
|
||
ga('create', 'UA-132927057-1', 'auto');
|
||
ga('send', 'pageview');
|
||
</script><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/code-block-buttons.js"></script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/mono-logo.svg" alt="OpenAPI Generator"/><h2 class="headerTitleWithLogo">OpenAPI Generator</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/installation" target="_self">Get Started</a></li><li class="siteNavGroupActive"><a href="/docs/generators" target="_self">Generators</a></li><li class="siteNavGroupActive"><a href="/docs/roadmap" target="_self">Roadmap</a></li><li class=""><a href="/team" target="_self">Team</a></li><li class=""><a href="/docs/faq" target="_self">FAQ</a></li><li class=""><a href="/blog/" target="_self">Blog</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Contributing</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/installation">CLI Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/plugins">Plugins</a></li><li class="navListItem"><a class="navItem" href="/docs/online">Online</a></li><li class="navListItem"><a class="navItem" href="/docs/usage">Usage</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Extending</h3><ul><li class="navListItem"><a class="navItem" href="/docs/templating">Using Templates</a></li><li class="navListItem"><a class="navItem" href="/docs/customization">Customization</a></li><li class="navListItem"><a class="navItem" href="/docs/debugging">Debugging</a></li><li class="navListItem"><a class="navItem" href="/docs/integrations">Workflow Integrations</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Contributing</h3><ul><li class="navListItem navListItemActive"><a class="navItem" href="/docs/contributing">Guidelines</a></li><li class="navListItem"><a class="navItem" href="/docs/code-of-conduct">Code of Conduct</a></li><li class="navListItem"><a class="navItem" href="/docs/contribute-building">Building the code</a></li><li class="navListItem"><a class="navItem" href="/docs/new-generator">Create a New Generator</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">About</h3><ul><li class="navListItem"><a class="navItem" href="/docs/roadmap">Roadmap</a></li><li class="navListItem"><a class="navItem" href="/docs/swagger-codegen-migration">Migrating from Swagger Codegen</a></li><li class="navListItem"><a class="navItem" href="/docs/fork-qna">Swagger Codegen Fork: Q&A</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Releases</h3><ul><li class="navListItem"><a class="navItem" href="/docs/release-summary">Release Summary</a></li><li class="navListItem"><a class="navItem" href="/docs/release-3-0-0">Release Notes: 3.0.0</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">API</h3><ul><li class="navListItem"><a class="navItem" href="/docs/generators">Generators List</a></li></ul></div></div></section></div><script>
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
|
||
createToggler('#tocToggler', 'body', 'tocActive');
|
||
|
||
const headings = document.querySelector('.toc-headings');
|
||
headings && headings.addEventListener('click', function(event) {
|
||
if (event.target.tagName === 'A') {
|
||
document.body.classList.remove('tocActive');
|
||
}
|
||
}, false);
|
||
|
||
function createToggler(togglerSelector, targetSelector, className) {
|
||
var toggler = document.querySelector(togglerSelector);
|
||
var target = document.querySelector(targetSelector);
|
||
|
||
if (!toggler) {
|
||
return;
|
||
}
|
||
|
||
toggler.onclick = function(event) {
|
||
event.preventDefault();
|
||
|
||
target.classList.toggle(className);
|
||
};
|
||
}
|
||
});
|
||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle">Guidelines For Contributing</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" id="before-submitting-an-issue"></a><a href="#before-submitting-an-issue" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Before submitting an issue</h2>
|
||
<ul>
|
||
<li>If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: <a href="https://github.com/openapitools/openapi-generator#getting-started">Getting Started</a></li>
|
||
<li>Search the <a href="https://github.com/openapitools/openapi-generator/issues">open issue</a> and <a href="https://github.com/openapitools/openapi-generator/issues?q=is%3Aissue+is%3Aclosed">closed issue</a> to ensure no one else has reported something similar before.</li>
|
||
<li>File an <a href="https://github.com/openapitools/openapi-generator/issues/new">issue ticket</a> by providing all the required information.</li>
|
||
<li>Test with the latest master by building the JAR locally to see if the issue has already been addressed.</li>
|
||
<li>You can also make a suggestion or ask a question by opening an "issue".</li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="before-submitting-a-pr"></a><a href="#before-submitting-a-pr" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Before submitting a PR</h2>
|
||
<ul>
|
||
<li>Search the <a href="https://github.com/openapitools/openapi-generator/issues">open issue</a> to ensure no one else has reported something similar and no one is actively working on similar proposed change.</li>
|
||
<li>If no one has suggested something similar, open an <a href="https://github.com/openapitools/openapi-generator/issues">"issue"</a> with your suggestion to gather feedback from the community.</li>
|
||
<li>If you're adding a new option to a generator, please consider using the <code>-t</code> option with customized templates instead or start a discussion first by opening an issue as we want to avoid adding too many options to the generator.</li>
|
||
<li>It's recommended to <strong>create a new git branch</strong> for the change so that the merge commit message looks nicer in the commit history.</li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="how-to-contribute"></a><a href="#how-to-contribute" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How to contribute</h2>
|
||
<h3><a class="anchor" aria-hidden="true" id="git"></a><a href="#git" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>git</h3>
|
||
<p>If you're new to git, you may find the following FAQs useful:</p>
|
||
<p><a href="https://github.com/openapitools/openapi-generator/wiki/FAQ#git">https://github.com/openapitools/openapi-generator/wiki/FAQ#git</a></p>
|
||
<h3><a class="anchor" aria-hidden="true" id="branches"></a><a href="#branches" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Branches</h3>
|
||
<p>Please file the pull request against the correct branch, e.g. <code>master</code> for non-breaking changes. See the <a href="https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches">Git Branches</a> page for more information.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="code-generators"></a><a href="#code-generators" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Code generators</h3>
|
||
<p>All the code generators can be found in <a href="https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages">modules/openapi-generator/src/main/java/org/openapitools/codegen/languages</a></p>
|
||
<h3><a class="anchor" aria-hidden="true" id="templates"></a><a href="#templates" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Templates</h3>
|
||
<p>All the templates (<a href="https://mustache.github.io/">mustache</a>) can be found in <a href="https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources">modules/openapi-generator/src/main/resources</a>.</p>
|
||
<p>For a list of variables available in the template, please refer to this <a href="https://github.com/openapitools/openapi-generator/wiki/Mustache-Template-Variables">page</a></p>
|
||
<h3><a class="anchor" aria-hidden="true" id="style-guide"></a><a href="#style-guide" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Style guide</h3>
|
||
<p>Code change should conform to the programming style guide of the respective languages:</p>
|
||
<ul>
|
||
<li>Ada: <a href="https://en.wikibooks.org/wiki/Ada_Style_Guide/Source_Code_Presentation">https://en.wikibooks.org/wiki/Ada_Style_Guide/Source_Code_Presentation</a></li>
|
||
<li>Android: <a href="https://source.android.com/source/code-style.html">https://source.android.com/source/code-style.html</a></li>
|
||
<li>Bash: <a href="https://github.com/bahamas10/bash-style-guide">https://github.com/bahamas10/bash-style-guide</a></li>
|
||
<li>C#: <a href="https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx">https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx</a></li>
|
||
<li>C++: <a href="https://google.github.io/styleguide/cppguide.html">https://google.github.io/styleguide/cppguide.html</a></li>
|
||
<li>C++ (Tizen): <a href="https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style">https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style</a></li>
|
||
<li>Clojure: <a href="https://github.com/bbatsov/clojure-style-guide">https://github.com/bbatsov/clojure-style-guide</a></li>
|
||
<li>Dart: <a href="https://www.dartlang.org/guides/language/effective-dart/style">https://www.dartlang.org/guides/language/effective-dart/style</a></li>
|
||
<li>Elixir: <a href="https://github.com/christopheradams/elixir_style_guide">https://github.com/christopheradams/elixir_style_guide</a></li>
|
||
<li>Eiffel: <a href="https://www.eiffel.org/doc/eiffel/Coding%20Standards">https://www.eiffel.org/doc/eiffel/Coding%20Standards</a></li>
|
||
<li>Erlang: <a href="https://github.com/inaka/erlang_guidelines">https://github.com/inaka/erlang_guidelines</a></li>
|
||
<li>Haskell: <a href="https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md">https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md</a></li>
|
||
<li>Java: <a href="https://google.github.io/styleguide/javaguide.html">https://google.github.io/styleguide/javaguide.html</a></li>
|
||
<li>JavaScript: <a href="https://github.com/airbnb/javascript/">https://github.com/airbnb/javascript/</a></li>
|
||
<li>Kotlin: <a href="https://kotlinlang.org/docs/reference/coding-conventions.html">https://kotlinlang.org/docs/reference/coding-conventions.html</a></li>
|
||
<li>Groovy: <a href="http://groovy-lang.org/style-guide.html">http://groovy-lang.org/style-guide.html</a></li>
|
||
<li>Go: <a href="https://github.com/golang/go/wiki/CodeReviewComments">https://github.com/golang/go/wiki/CodeReviewComments</a></li>
|
||
<li>ObjC: <a href="https://github.com/NYTimes/objective-c-style-guide">https://github.com/NYTimes/objective-c-style-guide</a></li>
|
||
<li>Perl: <a href="http://perldoc.perl.org/perlstyle.html">http://perldoc.perl.org/perlstyle.html</a></li>
|
||
<li>PHP: <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md</a></li>
|
||
<li>PowerShell: <a href="https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx</a></li>
|
||
<li>Python: <a href="https://www.python.org/dev/peps/pep-0008/">https://www.python.org/dev/peps/pep-0008/</a></li>
|
||
<li>R: <a href="https://google.github.io/styleguide/Rguide.xml">https://google.github.io/styleguide/Rguide.xml</a></li>
|
||
<li>Ruby: <a href="https://github.com/bbatsov/ruby-style-guide">https://github.com/bbatsov/ruby-style-guide</a></li>
|
||
<li>Rust: <a href="https://github.com/rust-lang-nursery/fmt-rfcs/blob/master/guide/guide.md">https://github.com/rust-lang-nursery/fmt-rfcs/blob/master/guide/guide.md</a> (the default <a href="https://github.com/rust-lang-nursery/rustfmt">rustfmt</a> configuration)</li>
|
||
<li>Scala: <a href="http://docs.scala-lang.org/style/">http://docs.scala-lang.org/style/</a></li>
|
||
<li>Swift: <a href="https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html">Apple Developer</a></li>
|
||
<li>TypeScript: <a href="https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines">https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines</a></li>
|
||
</ul>
|
||
<p>For other languages, feel free to suggest.</p>
|
||
<p>You may find the current code base not 100% conform to the coding style and we welcome contributions to fix those.</p>
|
||
<p>For <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions">Vendor Extensions</a>, please follow the naming convention below:</p>
|
||
<ul>
|
||
<li>For general vendor extension, use lower case and hyphen. e.g. <code>x-is-unique</code>, <code>x-content-type</code></li>
|
||
<li>For language-specified vendor extension, put it in the form of <code>x-{lang}-{extension-name}</code>. e.g. <code>x-objc-operation-id</code>, <code>x-java-feign-retry-limit</code></li>
|
||
<li>For a list of existing vendor extensions in use, please refer to <a href="https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions">https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions</a>. If you've added new vendor extensions as part of your PR, please update the wiki page.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="testing"></a><a href="#testing" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Testing</h3>
|
||
<p>To add test cases (optional) covering the change in the code generator, please refer to <a href="https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen">modules/openapi-generator/src/test/java/org/openapitools/codegen</a></p>
|
||
<p>To test the templates, please perform the following:</p>
|
||
<ul>
|
||
<li>Update the Petstore sample by running the shell script under <code>bin</code> folder. For example, run <code>./bin/ruby-petstore.sh</code> to update the Ruby PetStore API client under <a href="https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/ruby"><code>samples/client/petstore/ruby</code></a> For Windows, the batch files can be found under <code>bin\windows</code> folder. (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)</li>
|
||
<li>Run the tests in the sample folder, e.g. in <code>samples/client/petstore/ruby</code>, run <code>mvn integration-test -rf :RubyPetstoreClientTests</code>. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)</li>
|
||
<li>Finally, git commit the updated samples files: <code>git commit -a</code>
|
||
(<code>git add -A</code> if added files with new test cases)</li>
|
||
<li>For new test cases, please add to the <a href="https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml">Fake Petstore spec</a></li>
|
||
</ul>
|
||
<p>To start the CI tests, you can run <code>mvn verify -Psamples</code> (assuming you've all the required tools installed to run tests for different languages) or you can leverage <a href="http://travis-ci.org">http://travis-ci.org</a> to run the CI tests by adding your own openapi-generator repository.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="tips"></a><a href="#tips" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Tips</h3>
|
||
<ul>
|
||
<li>Smaller changes are easier to review</li>
|
||
<li>[Optional] For bug fixes, provide a OpenAPI Spec to repeat the issue so that the reviewer can use it to confirm the fix</li>
|
||
<li>Add test case(s) to cover the change</li>
|
||
<li>Document the fix in the code to make the code more readable</li>
|
||
<li>Make sure test cases passed after the change (one way is to leverage <a href="https://travis-ci.org/">https://travis-ci.org/</a> to run the CI tests)</li>
|
||
<li>File a PR with meaningful title, description and commit messages.</li>
|
||
<li>Recommended git settings
|
||
<ul>
|
||
<li><code>git config --global core.autocrlf input</code> to tell Git convert CRLF to LF on commit but not the other way around</li>
|
||
</ul></li>
|
||
<li>To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. <code>fix #1542</code>. (Ref: <a href="https://help.github.com/articles/closing-issues-using-keywords/">closing issues using keywords</a>)</li>
|
||
</ul>
|
||
</span></div></article></div><div class="docLastUpdate"><em>Last updated on 2019-1-11</em></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/integrations"><span class="arrow-prev">← </span><span>Workflow Integrations</span></a><a class="docs-next button" href="/docs/code-of-conduct"><span>Code of Conduct</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#before-submitting-an-issue">Before submitting an issue</a></li><li><a href="#before-submitting-a-pr">Before submitting a PR</a></li><li><a href="#how-to-contribute">How to contribute</a><ul class="toc-headings"><li><a href="#git">git</a></li><li><a href="#branches">Branches</a></li><li><a href="#code-generators">Code generators</a></li><li><a href="#templates">Templates</a></li><li><a href="#style-guide">Style guide</a></li><li><a href="#testing">Testing</a></li><li><a href="#tips">Tips</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/mono-logo.svg" alt="OpenAPI Generator" width="66" height="58"/></a><div><h5>Docs</h5><a href="/docs/en/customization.html">Customizing Generators</a><a href="/docs/en/integrations.html">Workflow Integrations</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a><a href="http://stackoverflow.com/questions/tagged/openapi-generator" target="_blank" rel="noreferrer noopener">Stack Overflow</a><a href="https://gitter.im/OpenAPITools/openapi-generator">Chat Room</a><a href="https://twitter.com/oas_generator" target="_blank" rel="noreferrer noopener">Twitter</a></div><div><h5>More</h5><a href="/blog">Blog</a><a href="https://github.com/OpenAPITools/openapi-generator">GitHub Repo</a><a class="github-button" href="https://github.com/OpenAPITools/openapi-generator" data-icon="octicon-star" data-count-href="/OpenAPITools/openapi-generator/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech). (Both "OpenAPI Tools" (https://OpenAPITools.org) and "OpenAPI Generator" are not affiliated with OpenAPI Initiative (OAI))</section></footer></div></body></html> |