Skip to content

Commit 76a95c8

Browse files
authored
Create CONTRIBUTING.adoc
1 parent 29de943 commit 76a95c8

File tree

1 file changed

+143
-0
lines changed

1 file changed

+143
-0
lines changed

CONTRIBUTING.adoc

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
= Contributing to springdoc-openapi
2+
3+
springdoc-openapi is released under the Apache 2.0 license. If you would like to contribute
4+
something, or simply want to hack on the code this document should help you get started.
5+
6+
7+
8+
== Code of Conduct
9+
This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.adoc[code of
10+
conduct]. By participating, you are expected to uphold this code.
11+
12+
13+
== Using GitHub Issues
14+
We use GitHub issues to track bugs and enhancements. If you have a general usage question
15+
please ask on https://stackoverflow.com[Stack Overflow]. The springdoc-openapi team and the
16+
broader community monitor the https://stackoverflow.com/tags/springdoc[`springdoc`]
17+
tag.
18+
19+
These are some basic guidelines before opening an issue. First of all you need to make sure, you don't create duplicate issues, and there no question already answred on https://stackoverflow.com/tags/springdoc.
20+
Then refer to the relevant documentation:
21+
22+
1. For OpenAPI specification 3:
23+
- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
24+
2. For swagger2-annotations:
25+
- https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations
26+
3. For swagger-ui configuration:
27+
- https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md
28+
4. For springdoc-openapi:
29+
- https://springdoc.github.io/springdoc-openapi-demos/
30+
- https://springdoc.github.io/springdoc-openapi-demos/faq.html
31+
- https://springdoc.github.io/springdoc-openapi-demos/migrating-from-springfox.html
32+
33+
34+
If you are reporting a bug, please help to speed up problem diagnosis by providing as
35+
much information as possible:
36+
37+
- You need to describe your context (the title of an issue is not enough)
38+
- What version of spring-boot you are using?
39+
- What modules and versions of springdoc-openapi are you using?
40+
- What are the actual and the expected result using OpenAPI Description (yml or json)?
41+
- Provide with a sample code (HelloController) or Test that reproduces the problem
42+
43+
44+
== Reporting Security Vulnerabilities
45+
If you think you have found a security vulnerability in Spring Boot please *DO NOT*
46+
disclose it publicly until we've had a chance to fix it. Please don't report security
47+
vulnerabilities using GitHub issues, instead head over to [email protected] and
48+
learn how to disclose them responsibly.
49+
50+
51+
== Code Conventions and Housekeeping
52+
None of these is essential for a pull request, but they will all help. They can also be
53+
added after the original pull request but before a merge.
54+
55+
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project
56+
to apply code formatting conventions. If you use Eclipse and you follow the '`Importing
57+
into eclipse`' instructions below you should get project specific formatting
58+
automatically. You can also install the
59+
https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ
60+
Plugin]
61+
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
62+
`@author` tag identifying you, and preferably at least a paragraph on what the class is
63+
for.
64+
* Add the ASF license header comment to all new `.java` files (copy from existing files
65+
in the project)
66+
* Add yourself as an `@author` to the `.java` files that you modify substantially (more
67+
than cosmetic changes).
68+
* Add some Javadocs.
69+
* A few unit tests would help a lot as well -- someone has to do it.
70+
* If no-one else is using your branch, please rebase it against the current master (or
71+
other target branch in the main project).
72+
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
73+
if you are fixing an existing issue please add `Fixes #XXXX` at the end of the commit
74+
message (where `XXXX` is the issue number).
75+
76+
77+
78+
== Working with the Code
79+
If you don't have an IDE preference we would recommend that you use IntellIJ.
80+
81+
=== Importing into IntelliJ IDEA
82+
If you have performed a checkout of this repository already, use "`File`" -> "`Open`" and
83+
then select the root `build.gradle` file to import the code.
84+
85+
Alternatively, you can let IntellIJ IDEA checkout the code for you. Use "`File`" ->
86+
"`New`" -> "`Project from Version Control`" and
87+
`https://github.com/spring-projects/spring-boot` for the URL. Once the checkout has
88+
completed, a pop-up will suggest to open the project.
89+
90+
91+
==== Install the Spring Formatter plugin
92+
If you haven't done so, install the formatter plugin so that proper formatting rules are
93+
applied automatically when you reformat code in the IDE.
94+
95+
* Download the latest https://search.maven.org/search?q=g:io.spring.javaformat%20AND%20a:spring-javaformat-intellij-plugin[IntelliJ IDEA plugin].
96+
* Select "`IntelliJ IDEA`" -> "`Preferences`".
97+
* Select "`Plugins`".
98+
* Select the wheel and "`Install Plugin from Disk...`".
99+
* Select the jar file you've downloaded.
100+
101+
102+
==== Import additional code style
103+
The formatter does not cover all rules (such as order of imports) and an additional file
104+
needs to be added.
105+
106+
* Select "`IntelliJ IDEA`" -> "`Preferences`".
107+
* Select "`Editor`" -> "`Code Style`".
108+
* Select the wheel and "`Import Scheme`" -> "`IntelliJ IDEA code style XML`".
109+
* Select https://github.com/spring-projects/spring-boot/blob/master/idea/codeStyleConfig.xml[`idea/codeStyleConfig.xml`] from this repository.
110+
111+
==== Importing into Eclipse
112+
113+
You can use Spring Boot project specific source formatting settings.
114+
115+
116+
===== Install the Spring Formatter plugin
117+
* Select "`Help`" -> "`Install New Software`".
118+
* Add `https://dl.bintray.com/spring/javaformat-eclipse/` as a site.
119+
* Install "Spring Java Format".
120+
121+
NOTE: The plugin is optional. Projects can be imported without the plugins, your code
122+
changes just won't be automatically formatted.
123+
124+
=== Building from Source
125+
springdoc-openapi source can be built from the command line using https://maven.apache.org/[Maven] on
126+
JDK 1.8 or above.
127+
128+
The project can be built from the root directory using the standard maven command:
129+
130+
[indent=0]
131+
----
132+
$ ./mvn install
133+
----
134+
135+
136+
== Cloning the git repository on Windows
137+
Some files in the git repository may exceed the Windows maximum file path (260
138+
characters), depending on where you clone the repository. If you get `Filename too long`
139+
errors, set the `core.longPaths=true` git option:
140+
141+
```
142+
git clone -c core.longPaths=true https://github.com/springdoc/springdoc-openapi
143+
```

0 commit comments

Comments
 (0)