Skip to content

Commit 327873b

Browse files
frankkilcomminsfrantuma
authored andcommitted
chore(repo): simplify README to aid navigation and docs
1 parent 61cfeac commit 327873b

15 files changed

+1119
-1108
lines changed

README.md

Lines changed: 79 additions & 1108 deletions
Large diffs are not rendered by default.

docs/Swagger-Codegen-Logo.png

25.8 KB
Loading

docs/building.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Building
2+
3+
After cloning the project, you can build it from source with this command:
4+
5+
```sh
6+
mvn clean package
7+
```
8+
9+
If you don't have maven installed, you may directly use the included [maven wrapper](https://github.com/takari/maven-wrapper), and build with the command:
10+
11+
```sh
12+
./mvnw clean package
13+
```
14+
15+
## Homebrew
16+
17+
To install, run `brew install swagger-codegen`
18+
19+
Here is an example usage:
20+
21+
```sh
22+
swagger-codegen generate -i https://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
23+
```
24+
25+
## To build a server stub
26+
27+
Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information.
28+
29+
## To build the codegen library
30+
31+
This will create the Swagger Codegen library from source.
32+
33+
```sh
34+
mvn package
35+
```
36+
37+
Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts.

docs/compatibility.md

Lines changed: 120 additions & 0 deletions
Large diffs are not rendered by default.

docs/consumers.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Companies leveraging Swagger Codegen
2+
3+
Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please raise a PR.
4+
5+
- [Acando](https://www.acando.de/)
6+
- [Accengage](https://www.accengage.com/)
7+
- [Accruent](https://www.accruent.com/)
8+
- [Activehours](https://www.activehours.com/)
9+
- [Actonica](https://www.actonica.com)
10+
- [Acunetix](https://www.acunetix.com/)
11+
- [Adaptant](https://www.adaptant.io/)
12+
- [Atlassian](https://www.atlassian.com/)
13+
- [Autodesk](http://www.autodesk.com/)
14+
- [Avenida Compras S.A.](https://www.avenida.com.ar)
15+
- [AYLIEN](http://aylien.com/)
16+
- [Balance Internet](https://www.balanceinternet.com.au/)
17+
- [beemo](http://www.beemo.eu)
18+
- [bitly](https://bitly.com)
19+
- [BeezUP](http://www.beezup.com)
20+
- [Box](https://box.com)
21+
- [Bufferfly Network](https://www.butterflynetinc.com/)
22+
- [Cachet Financial](http://www.cachetfinancial.com/)
23+
- [carpolo](http://www.carpolo.co/)
24+
- [Carus](https://www.carus.com/)
25+
- [Cisco](http://www.cisco.com/)
26+
- [CloudBoost](https://www.CloudBoost.io/)
27+
- [Cloudsmith](https://cloudsmith.io/)
28+
- [Conplement](http://www.conplement.de/)
29+
- [Cummins](http://www.cummins.com/)
30+
- [Cupix](http://www.cupix.com)
31+
- [DBBest Technologies](https://www.dbbest.com)
32+
- [DecentFoX](http://decentfox.com/)
33+
- [DocRaptor](https://docraptor.com)
34+
- [DocuSign](https://www.docusign.com)
35+
- [Elastic](https://www.elastic.co/)
36+
- [Ergon](http://www.ergon.ch/)
37+
- [Dell EMC](https://www.emc.com/)
38+
- [eureka](http://eure.jp/)
39+
- [everystory.us](http://everystory.us)
40+
- [Expected Behavior](http://www.expectedbehavior.com/)
41+
- [fashionTrade](https://www.fashiontrade.com/)
42+
- [Fastly](https://www.fastly.com/)
43+
- [FINRA](https://github.com/FINRAOS/herd/)
44+
- [Flat](https://flat.io)
45+
- [Finder](http://en.finder.pl/)
46+
- [Fitwell](https://fitwell.co/)
47+
- [FH Münster - University of Applied Sciences](http://www.fh-muenster.de)
48+
- [FormAPI](https://formapi.io/)
49+
- [Fotition](https://www.fotition.com/)
50+
- [Gear Zero Network](https://www.gearzero.ca)
51+
- [General Electric](https://www.ge.com/)
52+
- [Genentech](https://gene.com)
53+
- [Genesys - PureCloud](http://developer.mypurecloud.com/)
54+
- [Germin8](http://www.germin8.com)
55+
- [GigaSpaces](http://www.gigaspaces.com)
56+
- [GMO Pepabo](https://pepabo.com/en/)
57+
- [goTransverse](http://www.gotransverse.com/api)
58+
- [GraphHopper](https://graphhopper.com/)
59+
- [Gravitate Solutions](http://gravitatesolutions.com/)
60+
- [HashData](http://www.hashdata.cn/)
61+
- [Hewlett Packard Enterprise](https://hpe.com)
62+
- [High Technologies Center](http://htc-cs.com)
63+
- [Hootsuite](https://hootsuite.com/)
64+
- [Huawei Cloud](http://www.huaweicloud.com/en-us/product/cs.html)
65+
- [Husbanken](https://www.husbanken.no)
66+
- [IBM](https://www.ibm.com)
67+
- [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications)
68+
- [Individual Standard IVS](http://www.individual-standard.com)
69+
- [INSPIDE](http://www.inspide.com)
70+
- [Intent HQ](http://www.intenthq.com)
71+
- [Kabuku](http://www.kabuku.co.jp/en)
72+
- [Kurio](https://kurio.co.id)
73+
- [Kuroi](http://kuroiwebdesign.com/)
74+
- [Kuary](https://kuary.com/)
75+
- [Kubernetes](https://kubernetes.io/)
76+
- [LANDR Audio](https://www.landr.com/)
77+
- [Lascaux](http://www.lascaux.it/)
78+
- [Leanix](http://www.leanix.net/)
79+
- [Leica Geosystems AG](http://leica-geosystems.com)
80+
- [LiveAgent](https://www.ladesk.com/)
81+
- [LXL Tech](http://lxltech.com)
82+
- [Lyft](https://www.lyft.com/developers)
83+
- [MailMojo](https://mailmojo.no/)
84+
- [Metaswitch](https://www.metaswitch.com/)
85+
- [Mindera](http://mindera.com/)
86+
- [ModuleQ](https://moduleq.com)
87+
- [Mporium](http://mporium.com/)
88+
- [Neverfail](https://neverfail.com/)
89+
- [NexCap](http://www.nexess-solutions.com/fr/plateforme-iot/)
90+
- [Nitrobox](https://www.nitrobox.com)
91+
- [Norwegian Air Shuttle](https://www.norwegian.com/)
92+
- [NTT DATA](http://www.nttdata.com/)
93+
- [nViso](http://www.nviso.ch/)
94+
- [NHSD](https://digital.nhs.uk/)
95+
- [Okiok](https://www.okiok.com)
96+
- [Onedata](http://onedata.org)
97+
- [Open International Systems](https://openintl.com/)
98+
- [OrderCloud.io](http://ordercloud.io)
99+
- [OSDN](https://osdn.jp)
100+
- [PagerDuty](https://www.pagerduty.com)
101+
- [PagerTree](https://pagertree.com)
102+
- [Pepipost](https://www.pepipost.com)
103+
- [Peatio Tech](https://www.peatio.tech)
104+
- [Plexxi](http://www.plexxi.com)
105+
- [Pixoneye](http://www.pixoneye.com/)
106+
- [PostAffiliatePro](https://www.postaffiliatepro.com/)
107+
- [PracticeBird](https://www.practicebird.com/)
108+
- [Prill Tecnologia](http://www.prill.com.br)
109+
- [Prokarma](https://www.prokarma.com)
110+
- [QAdept](http://qadept.com/)
111+
- [QuantiModo](https://quantimo.do/)
112+
- [QuickBlox](https://quickblox.com/)
113+
- [Rapid7](https://rapid7.com/)
114+
- [Red Hat](https://www.redhat.com/)
115+
- [Reload! A/S](https://reload.dk/)
116+
- [REstore](https://www.restore.eu)
117+
- [REST United](https://restunited.com)
118+
- [Revault Sàrl](http://revault.ch)
119+
- [Riffyn](https://riffyn.com)
120+
- [Roche](https://roche.com)
121+
- [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html)
122+
- [Saritasa](https://www.saritasa.com/)
123+
- [SAS](https://www.sas.com)
124+
- [SCOOP Software GmbH](http://www.scoop-software.de)
125+
- [SessionM](https://www.sessionm.com/)
126+
- [Shine Solutions](https://shinesolutions.com/)
127+
- [Simpfony](https://www.simpfony.com/)
128+
- [Skurt](http://www.skurt.com)
129+
- [Slamby](https://www.slamby.com/)
130+
- [SmartRecruiters](https://www.smartrecruiters.com/)
131+
- [snapCX](https://snapcx.io)
132+
- [SPINEN](http://www.spinen.com)
133+
- [Sponsoo](https://www.sponsoo.de)
134+
- [SRC](https://www.src.si/)
135+
- [Stardog Ventures](https://www.stardog.io)
136+
- [Stingray](http://www.stingray.com)
137+
- [StyleRecipe](http://stylerecipe.co.jp)
138+
- [Svenska Spel AB](https://www.svenskaspel.se/)
139+
- [Switch Database](https://www.switchdatabase.com/)
140+
- [TaskData](http://www.taskdata.com/)
141+
- [ThirdWatch.ai](https://www.thirdwatch.ai/)
142+
- [ThoughtWorks](https://www.thoughtworks.com)
143+
- [Tpay](https://tpay.com)
144+
- [Trexle](https://trexle.com/)
145+
- [Upwork](http://upwork.com/)
146+
- [uShip](https://www.uship.com/)
147+
- [Variograma](https://variograma.pt)
148+
- [VMware](https://vmware.com/)
149+
- [Viavi Solutions Inc.](https://www.viavisolutions.com)
150+
- [W.UP](http://wup.hu/?siteLang=en)
151+
- [Wealthfront](https://www.wealthfront.com/)
152+
- [Webever GmbH](https://www.webever.de/)
153+
- [WEXO A/S](https://www.wexo.dk/)
154+
- [XSky](http://www.xsky.com/)
155+
- [Yelp](http://www.yelp.com/)
156+
- [Zalando](https://tech.zalando.com)
157+
- [ZEEF.com](https://zeef.com/)
158+
- [zooplus](https://www.zooplus.com/)
159+
- [Trifork](https://www.trifork.com/)

docs/docker.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Docker
2+
3+
## Development in docker
4+
5+
You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen`
6+
in the docker container. It also maps `~/.m2/repository` to the appropriate container location.
7+
8+
To execute `mvn package`:
9+
10+
```sh
11+
git clone https://github.com/swagger-api/swagger-codegen
12+
cd swagger-codegen
13+
./run-in-docker.sh mvn package
14+
```
15+
16+
Build artifacts are now accessible in your working directory.
17+
18+
Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example:
19+
20+
```sh
21+
./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli
22+
./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli
23+
./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client
24+
./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \
25+
-l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore
26+
```
27+
28+
## Standalone generator Development in docker
29+
30+
See [standalone generator development](https://github.com/swagger-api/swagger-codegen/blob/master/standalone-gen-dev/standalone-generator-development.md)
31+
32+
## Run Docker in Vagrant
33+
34+
Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
35+
36+
```sh
37+
git clone http://github.com/swagger-api/swagger-codegen.git
38+
cd swagger-codegen
39+
vagrant up
40+
vagrant ssh
41+
cd /vagrant
42+
./run-in-docker.sh mvn package
43+
```
44+
45+
## Public Pre-built Docker images
46+
47+
- https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service)
48+
- https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI)
49+
50+
### Swagger Generator Docker Image
51+
52+
The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code.
53+
54+
Example usage (note this assumes `jq` is installed for command line processing of JSON):
55+
56+
```sh
57+
# Start container and save the container id
58+
CID=$(docker run -d swaggerapi/swagger-generator)
59+
# allow for startup
60+
sleep 5
61+
# Get the IP of the running container
62+
GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID)
63+
# Execute an HTTP request and store the download link
64+
RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
65+
"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
66+
}' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"')
67+
# Download the generated zip and redirect to a file
68+
curl $RESULT > result.zip
69+
# Shutdown the swagger generator image
70+
docker stop $CID && docker rm $CID
71+
```
72+
73+
In the example above, `result.zip` will contain the generated client.
74+
75+
### Swagger Codegen CLI Docker Image
76+
77+
The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version.
78+
79+
To generate code with this image, you'll need to mount a local location as a volume.
80+
81+
Example:
82+
83+
```sh
84+
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
85+
-i https://petstore.swagger.io/v2/swagger.json \
86+
-l go \
87+
-o /local/out/go
88+
```
89+
90+
(On Windows replace `${PWD}` with `%CD%`)
91+
92+
The generated code will be located under `./out/go` in the current directory.

docs/generation-selective.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Selective generation
2+
3+
You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output:
4+
5+
The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated:
6+
7+
```sh
8+
# generate only models
9+
java -Dmodels {opts}
10+
11+
# generate only apis
12+
java -Dapis {opts}
13+
14+
# generate only supporting files
15+
java -DsupportingFiles
16+
17+
# generate models and supporting files
18+
java -Dmodels -DsupportingFiles
19+
```
20+
21+
To control the specific files being generated, you can pass a CSV list of what you want:
22+
23+
```sh
24+
# generate the User and Pet models only
25+
-Dmodels=User,Pet
26+
27+
# generate the User model and the supportingFile `StringUtil.java`:
28+
-Dmodels=User -DsupportingFiles=StringUtil.java
29+
```
30+
31+
To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`.
32+
These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`):
33+
34+
```sh
35+
# generate only models (with tests and documentation)
36+
java -Dmodels {opts}
37+
38+
# generate only models (with tests but no documentation)
39+
java -Dmodels -DmodelDocs=false {opts}
40+
41+
# generate only User and Pet models (no tests and no documentation)
42+
java -Dmodels=User,Pet -DmodelTests=false {opts}
43+
44+
# generate only apis (without tests)
45+
java -Dapis -DapiTests=false {opts}
46+
47+
# generate only apis (modelTests option is ignored)
48+
java -Dapis -DmodelTests=false {opts}
49+
```
50+
51+
When using selective generation, _only_ the templates needed for the specific generation will be used.

0 commit comments

Comments
 (0)