Skip to content

Typescript angular2 typings #4795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 188 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
1da350e
[docker] Cleanup and reduce container sizes
jimschubert May 24, 2016
b2c14c9
Limit base image to 1.0
jimschubert May 24, 2016
fe66364
[docker] Runnable CLI, reduced container size
jimschubert May 24, 2016
4367311
[docker] Update root Dockerfile and run-in-docker
jimschubert May 25, 2016
b996d0c
[docker] Add container docs and example usage
jimschubert May 27, 2016
4f92194
Merge branch 'dockerfiles' of https://github.com/jimschubert/swagger-…
fehguy Jun 4, 2016
98aaa1f
Adjust Date ISO Dateformat for Query Parameters
Oct 13, 2016
ababec6
[JAX-RS RESTEasy][issue #4447] Added swagger annotations to model and…
Dec 22, 2016
45002ec
[JAX-RS RESTEasy][issue #4447] Updated RESTEasy petstore samples
Dec 23, 2016
6b0b7a1
[dockerfile] Replace 'maven:3.3-jdk-7' with 'maven:3-jdk-7-alpine'
wy-z Dec 13, 2016
1a1d0ae
add beanvalidation to jersey1 and jersey2 #4091
jfiala Jan 3, 2017
6a080d3
add safe argument to quote method in python template to avoid unquote…
taxpon Jan 5, 2017
b224474
Fixes #4481 (#4493)
bshamblen Jan 5, 2017
aa1dc0f
Updated Nancy from 1.4.1 to 1.4.3 (#4482)
simo9000 Jan 5, 2017
43ab14b
Adding Curl connect timeout configuration to PHP generation templates…
brianvoss Jan 6, 2017
df0c54d
Support the empty string as an enumeration value (#4450)
kevinoid Jan 6, 2017
c0f1716
[html2] Open the description field that contains the description and …
frodrigo Jan 6, 2017
5686109
Allow templates to use maxItems and minItems for Arrays (#4309)
Jan 6, 2017
dde24eb
update jaxrs jersey1 templates and sample output #4091
jfiala Jan 6, 2017
5b532fd
update language jaxrs (Jersey2) and samples
jfiala Jan 6, 2017
24f4861
add test for options #4091
jfiala Jan 6, 2017
6b17b92
add check for isInteger (integer/decimal)
jfiala Jan 6, 2017
409e1a5
Fix Gson parsing of Joda DateTime without millis (#4473)
kevinoid Jan 7, 2017
1e8c718
[swift3] allow POST with both body and query parameters (#4490)
tomekc Jan 7, 2017
69b1e50
updated version
fehguy Jan 8, 2017
ccf6f02
Merge pull request #4521 from swagger-api/issue-4478
fehguy Jan 8, 2017
81b5b78
Enable support for vendor extensions in CodegenResponse. (#4517)
sreeshas Jan 8, 2017
26ead9b
Issue 4416 (Assist escapeReservedWord with custom mappings) (#4480)
AlexanderN Jan 9, 2017
380bed1
Issue 4244 - Add x-discriminator-value (#4252)
Jan 9, 2017
4d4af71
[CI] Add scripts to detect carriage return and tab (#4526)
wing328 Jan 9, 2017
de5ea8a
[JAX-RS/jersey2] Fix for incorrect JSON field name capitalization (#4…
y-higuchi Jan 10, 2017
c1f854f
Overriden objectmapper wasn't used in deserialisation (Scala) issue #…
lachatak Jan 10, 2017
a6b0518
replace tabs
jfiala Jan 10, 2017
d7eeb06
update 2016 to 2017
wing328 Jan 11, 2017
2e4de0c
Remove unnecessary call to setHost() in the constructor (#4525)
toomuchpete Jan 12, 2017
0fb154e
[Bash] Bash client script generator (#4541)
bkryza Jan 12, 2017
9bb58d2
add git tip
wing328 Jan 12, 2017
af43190
When reading mustache template files assume UTF-8 encoding, fixes #45…
eblis Jan 12, 2017
39b76ec
add space before C# in readme
wing328 Jan 12, 2017
d40f7a4
Add triple-mustache to all instances of vendorExtensions.extraAnnotat…
ThatJoeMoore Jan 13, 2017
2e7e258
Issue 4531 (#4539)
RichiWIP Jan 13, 2017
95987fc
Added support for datetime query parameters in cpprest (#4556)
genechang Jan 13, 2017
d7e6a3d
Add a useTags flag to allow tags to be used to generate interface / c…
eamon316 Jan 15, 2017
663b471
[nancyfx/csharp] Customize interface prefix (#4557)
jimschubert Jan 15, 2017
f0cddd2
Swift3 Clener template of client methods (#4552)
tomekc Jan 15, 2017
4001503
PHP server generator ze-ph (Zend Expressive + Path Handler) (#4559)
Articus Jan 15, 2017
2d8715f
Minor update to ze-ph batch script
wing328 Jan 15, 2017
23c5376
[csharp] Fix interfacePrefix sensitivity + default (#4561)
jimschubert Jan 15, 2017
d97b1da
[csharp] Support internal access of generated code (#4560)
jimschubert Jan 15, 2017
0ea506e
Add http://htc-cs.com
wing328 Jan 16, 2017
410f6d7
add Articus as php expressive creator
wing328 Jan 16, 2017
3b3ded0
fix bash test package name (#4566)
wing328 Jan 16, 2017
033a588
add zend expressive
wing328 Jan 16, 2017
691d89a
add link to zend-expressive
wing328 Jan 16, 2017
713e6bb
[html2] Add python and perl examples (#4575)
bshamblen Jan 17, 2017
545ee0c
Moved bash version detection to top and improved logic (#4578)
bkryza Jan 17, 2017
55443da
Extends obj using Object.assign (#4562)
damienpontifex Jan 17, 2017
4c7d133
[csharp] Client nuspec (#4576)
jimschubert Jan 17, 2017
a846a57
add tips about windows class path
wing328 Jan 17, 2017
0a559f0
Add support for modifier within the Jaxb XMLElement annotation (#4433)
danmikita Jan 17, 2017
da01b2e
Add title field to CodegenProperty (#4590)
sreeshas Jan 18, 2017
da6b57f
[aspnetcore] use default in model constructors, supports enums (#4573)
jimschubert Jan 18, 2017
5db75d8
add Webever GmbH
wing328 Jan 18, 2017
c7ecb3c
update https://www.webever.de
wing328 Jan 18, 2017
ee7f9fc
[Jaxrs] Add beanvalidation annotations and fix outer Enums (#4492)
jfiala Jan 19, 2017
1ae60b1
Merge branch 'jaxrs_jersey_beanval2' of https://github.com/jfiala/swa…
wing328 Jan 19, 2017
ccecc2a
new file for jaxrs jersey1
wing328 Jan 19, 2017
a8afaa8
remove /r from templates
wing328 Jan 19, 2017
5f1b118
Merge branch 'master' into master
wing328 Jan 19, 2017
157fcbc
fix invalid spec, update petstore samples (jaxrs, ruby)
wing328 Jan 19, 2017
3b6ae19
Merge branch 'jfiala-jaxrs_jersey_beanval2'
wing328 Jan 19, 2017
6f4e82d
[Jaxrs-Resteasy] Add beanvalidation annotations (#4506)
jfiala Jan 19, 2017
36c3fa0
Allows for generation of spring controller code using the delegate pa…
JLLeitschuh Jan 19, 2017
ccb3385
Set embedded templates directory when generating Javascript code (#4585)
me717 Jan 19, 2017
e82f3c5
Added support for cURL proxy configuration to PHP client
Jan 19, 2017
d4c96c9
Merge with Upstream
Jan 19, 2017
9a8ede4
update php sample
wing328 Jan 19, 2017
59c189e
Merge branch 'maik-kulbe-feature/php-proxy-support'
wing328 Jan 19, 2017
029728d
[maven-plugin] allow for ignore file override (#4597)
wing328 Jan 19, 2017
81e930a
change html2 mustache to fix parameter name
Jan 19, 2017
3b3f2d2
Options to allow unicode character in identifier names (#4508)
eblis Jan 20, 2017
22688f5
add embeddedTemplateDir to some generators (#4603)
wing328 Jan 20, 2017
1f0ecb5
Updating typescript-angular to export api classes (#4589)
damienpontifex Jan 21, 2017
4d19fb6
hide generation timestamp for perl (#4614)
wing328 Jan 21, 2017
728544c
use baseName instead of name to avoid sanitized name in json processing
fehguy Jan 22, 2017
62caf7d
rebuilt samples
fehguy Jan 22, 2017
5306b11
[java] Improve pom.xml to qualify for publishing to Maven central (#4…
wing328 Jan 22, 2017
7936cfc
Merge pull request #4619 from swagger-api/issue-4618
fehguy Jan 22, 2017
2e50a65
better handling of reserved words in models, operationId (#4620)
wing328 Jan 22, 2017
8e71dfb
Fix model prefix/suffix with incorrect camelization (#4621)
wing328 Jan 22, 2017
30315c8
Fix Issue 4554 - handle 204 server response in javascript (#4604)
tharders Jan 23, 2017
e836460
update js promise petstore sample
wing328 Jan 23, 2017
933cc1c
Enum constructFromObject should return value (#4613)
keysolutions Jan 23, 2017
9213289
Merge branch 'master' of https://github.com/gigo1980/swagger-codegen …
wing328 Jan 23, 2017
9abaab6
update ts angular2 petstore samples
wing328 Jan 23, 2017
697366c
Merge branch 'gigo1980-master'
wing328 Jan 23, 2017
9f8a1e2
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Jan 23, 2017
117e1ea
Removed pet variable from Javascript api_test Mustache file, which wa…
davidteixeira Jan 23, 2017
0ae61a5
Removed pet variable from Javascript api_test Mustache file, which wa…
davidteixeira Jan 23, 2017
5877ceb
add https://neverfail.com/
wing328 Jan 23, 2017
014cfe7
add https://pagertree.com/
wing328 Jan 23, 2017
b5de3a4
Prefix apiPackage and modelPackage with invokerPackage.
toomuchpete Jan 23, 2017
02dcd0e
Update petstore samples; these appear to have been added by #4616
toomuchpete Jan 23, 2017
c0bea5e
move beanvalidation code to AbstractJavaJAXRSServerCodegen.java #4091
jfiala Jan 23, 2017
3ffc4bf
backport support DecimalMin/DecimalMax #4091
jfiala Jan 23, 2017
6d5da3f
Added single quotes -- fixes bug where generated client throws an 'Un…
davidteixeira Jan 24, 2017
6e846e7
Issue 4637 Fix for ci build (#4643)
scottrw93 Jan 25, 2017
3476e83
fix for allowable values, #4645 (#4646)
fehguy Jan 25, 2017
efd0732
Fix the `rm` to remove the correct file in two spring generation bash…
JLLeitschuh Jan 25, 2017
1288725
Merge branch 'master' of https://github.com/johnluan/swagger-codegen
wing328 Jan 25, 2017
d239a4c
Merge branch 'master' of https://github.com/davidteixeira/swagger-cod…
wing328 Jan 25, 2017
3be04e8
update JS petstore client
wing328 Jan 25, 2017
f584f94
Merge branch 'davidteixeira-master'
wing328 Jan 25, 2017
9a79f13
new batch file to exec all JS petstore batch files
wing328 Jan 25, 2017
6e2ee4b
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Jan 25, 2017
78f38f1
Add support for read-only values in spring model (#4629)
JLLeitschuh Jan 25, 2017
ecaa8b1
tests, fix for #4647. Proper escaping project name per npmjs (#4648)
fehguy Jan 25, 2017
2b030a7
add https://mailmojo.no/
wing328 Jan 25, 2017
f592fdb
[Swift] two fixes to latest param mapping code (#4587)
jaz-ah Jan 25, 2017
f19cb9c
add kubernetes
wing328 Jan 25, 2017
347d477
Fixes #4655 (#4656)
amingilani Jan 26, 2017
658b650
Merge branch 'master' of https://github.com/karnik/swagger-codegen in…
wing328 Jan 26, 2017
e0adb97
Merge branch 'karnik-master'
wing328 Jan 26, 2017
c0fb30d
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Jan 26, 2017
05eea24
[PHP] Validate parent's model first, if any (#4659)
nazieb Jan 26, 2017
8952815
[Spring] Add beanvalidation annotations (#4600)
jfiala Jan 26, 2017
a45579d
fix issue with pom.xml (spring cloud, boot)
wing328 Jan 26, 2017
8693741
#4625 - Check if configOptions are set before trying to get the sourc…
eblis Jan 27, 2017
3236ade
[Python] Improve model equality implementation (#4663)
fdanielsen Jan 27, 2017
7e1e974
add https://kurio.co.id
wing328 Jan 28, 2017
6890ef9
[JavaScript] Fixed handling of empty arrays/empty strings/booleans/si…
frol Jan 28, 2017
ae8a123
[WIP][Scala] Finch generator (#3905)
wing328 Jan 29, 2017
7be4dc6
add finch
wing328 Jan 29, 2017
1d7ba4c
add core team for scala finch
wing328 Jan 29, 2017
d82c2bb
Fix Typescript errors with 'strictNullChecks' mode enabled (#4658)
megaboich Jan 29, 2017
f77bee8
[WIP] Add elixir client (#4675)
niku Jan 30, 2017
ca1ef49
add elixir template owner
wing328 Jan 30, 2017
2cffa09
add elixir to api client list
wing328 Jan 30, 2017
ee857d1
escape unsafe characters/quotes in elixir generator (#4676)
wing328 Jan 30, 2017
8042f5c
[JAXRS-CXF] [issue #4386] add builder-style methods to model classes …
MatanRubin Jan 31, 2017
f62a7e2
Copy dataformat if property field is an array. (#4661)
sreeshas Feb 1, 2017
96ed41a
Fixed issue #4665 [go] required object parameters are marked omitempt…
vvalchev Feb 1, 2017
cd34885
Fixed issue #4664: [go] incorrect code generated, if there are more t…
vvalchev Feb 1, 2017
4b2c4f0
Issue 3914 (#4678)
abaruni Feb 2, 2017
f4fee61
update go petstore sample
wing328 Feb 2, 2017
a128c07
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Feb 2, 2017
9032b8c
[aspnetcore] resolve source/packageName issues (#4699)
jimschubert Feb 3, 2017
d1766e3
Fix Issue #4611 by using {{unescapedDescription}} (#4641)
Feb 3, 2017
db2d9df
Merge branch 'php-client-invokerpkg-fix' of https://github.com/toomuc…
wing328 Feb 3, 2017
4c6aa92
Merge branch 'toomuchpete-php-client-invokerpkg-fix'
wing328 Feb 3, 2017
6954176
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Feb 3, 2017
c366f13
ISSUE#4391 - https://github.com/swagger-api/swagger-codegen/issues/43…
Feb 3, 2017
5282987
[Python] update python requirement.txt and use single quote for safe …
wing328 Feb 3, 2017
4ba0ea9
fix(jax-rs): fix package name in generated StringUtil.java to match w…
asgerjensen Feb 3, 2017
23aee52
Feature/4606 (#4607)
eamon316 Feb 3, 2017
95a8192
[Typescript-Angular2] Fixes #4703 (#4704)
27leaves Feb 4, 2017
a83f8d0
[JAXRS-Spec|Resteasy|CXF] Issue 4315 - Fixed bug generating arrays of…
markus-wa Feb 5, 2017
38c8796
[Jaxrs-cxf-cdi] Add beanvalidation annotations updated (#4615)
jfiala Feb 5, 2017
a52a84a
[Jaxrs-cxf-cdi] merge beanvalidation templates to single one #4719 (#…
jfiala Feb 6, 2017
4900427
[JAXRS-CXF] Issue 4569 - Re-added usage of contextPath in api.mustach…
markus-wa Feb 6, 2017
509a156
Merge branch 'jaxrs_beanval_final_4091' of https://github.com/jfiala/…
wing328 Feb 6, 2017
fd7d251
Merge branch 'jfiala-jaxrs_beanval_final_4091'
wing328 Feb 6, 2017
c0fc66e
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Feb 6, 2017
b891a4a
fix issue #4672 - XmlExampleGenerator does not properly handle proper…
jbhelm Feb 6, 2017
96b0d15
[csharp] Fix enum default value (#4681)
jimschubert Feb 6, 2017
e8f11bc
add https://www.slamby.com/
wing328 Feb 6, 2017
099abf4
Add "Simpfony" to list of companies using Swagger (#4726)
jbhelm Feb 6, 2017
8110b13
add Hewlett Packard Enterprise (hpe.com)
wing328 Feb 7, 2017
b415852
add https and change order for HPE
wing328 Feb 7, 2017
d12f428
rx2 support (#4708)
ber4444 Feb 7, 2017
a123dd7
Revert "rx2 support" (#4737)
wing328 Feb 7, 2017
1339222
[Java][Issue #1806] generate using java.util.UUID for UUIDs
MatanRubin Feb 7, 2017
73395bc
[Bash] Bash generator improvements (#4730)
bkryza Feb 7, 2017
73cfc84
Merge pull request #4487 from wy-z/dockerfile_update_base_image
fehguy Feb 7, 2017
e9823a8
[Jaxrs-spec] fix usage of Jersey templates in shellscript (#4722)
jfiala Feb 7, 2017
bdf6957
update jaxrs spec petstore sample (mac)
wing328 Feb 7, 2017
69edf28
add SPINEN
wing328 Feb 7, 2017
2179b44
[Java-Feign] Fixed String comparison using equals instead of == opera…
CodeNinjai Feb 8, 2017
7998a30
Merge branch 'uuid-type' of https://github.com/MatanRubin/swagger-cod…
wing328 Feb 8, 2017
882c3ec
update java petstore with new uuid mapping
wing328 Feb 8, 2017
beadd6d
update java server stub samples with new uuid mapping
wing328 Feb 8, 2017
08aef95
Merge branch 'MatanRubin-uuid-type'
wing328 Feb 8, 2017
d91135e
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
wing328 Feb 8, 2017
0d14496
[Java-retrofit] Fix for #4750 String comparison with equals (#4751)
CodeNinjai Feb 8, 2017
ef31efe
remove default temp folder during initalization (#4749)
wing328 Feb 9, 2017
8fa2ef8
merged
fehguy Feb 9, 2017
93a63db
Merge branch 'jimschubert-dockerfiles'
fehguy Feb 9, 2017
9444c49
Updated npm configuration to use new typescript2 typings system
Feb 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 9 additions & 30 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git/
*.iml
out/
*.ipr
Expand All @@ -13,35 +14,13 @@ generated-sources/*
generated-code/*
*.swp
*.swo

/target
/generated-files
/nbactions.xml
*.pyc
__pycache__
samples/server-generator/scalatra/output
samples/server-generator/node/output/node_modules
samples/server-generator/scalatra/target
samples/server-generator/scalatra/output/.history
samples/client/petstore/qt5cpp/PetStore/moc_*
samples/client/petstore/qt5cpp/PetStore/*.o
samples/client/petstore/objc/PetstoreClient.xcworkspace/xcuserdata
samples/client/petstore/qt5cpp/build-*
samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/java/hello.txt
samples/client/petstore/android/default/hello.txt
samples/client/petstore/objc/Build
samples/client/petstore/objc/Pods
samples/server/petstore/nodejs/node_modules
target
.idea
.lib
atlassian-ide-plugin.xml
*.bak
project/
samples/*
target/
.idea/
.lib/
.DS_Store

samples/client/petstore/php/SwaggerClient-php/composer.lock
samples/client/petstore/php/SwaggerClient-php/vendor/

samples/client/petstore/silex/SwaggerServer/composer.lock
samples/client/petstore/silex/SwaggerServer/venodr/
# Not needed in a linux container
bin/windows/*
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ before_install:
- docker pull swaggerapi/petstore
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- docker ps -a
# Add bats test framework and cURL for Bash script integration tests
- sudo add-apt-repository ppa:duggan/bats --yes
- sudo apt-get update -qq
- sudo apt-get install -qq bats
- sudo apt-get install -qq curl

# show host table to confirm petstore.swagger.io is mapped to localhost
- cat /etc/hosts

Expand All @@ -34,7 +40,15 @@ install:
- export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH"

script:
# fail fast
- set -e
# fail if templates/generators contain carriage return '\r'
- /bin/bash ./bin/utils/detect_carriage_return.sh
# fail if generators contain tab '\t'
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
# run integration tests defined in maven pom.xml
- mvn verify -Psamples
# docker test
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:$TRAVIS_TAG; fi && docker push $DOCKER_IMAGE_NAME; fi

env:
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ For a list of variables available in the template, please refer to this [page](h
### Style guide
Code change should conform to the programming style guide of the respective languages:
- Android: https://source.android.com/source/code-style.html
- Bash: https://github.com/bahamas10/bash-style-guide
- C#: https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx
- C++: https://google.github.io/styleguide/cppguide.html
- Clojure: https://github.com/bbatsov/clojure-style-guide
Expand Down Expand Up @@ -75,3 +76,5 @@ To start the CI tests, you can run `mvn verify -Psamples` (assuming you've all t
- Document the fix in the code to make the code more readable
- Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests)
- File a PR with meaningful title, description and commit messages. A good example is [PR-3306](https://github.com/swagger-api/swagger-codegen/pull/3306)
- Recommended git settings
- `git config --global core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM maven:3.3-jdk-7
FROM jimschubert/8-jdk-alpine-mvn:1.0

WORKDIR /src
VOLUME /src
VOLUME /root/.m2/repository
ENV GEN_DIR /opt/swagger-codegen

ADD . /opt/swagger-codegen
RUN set -x && \
apk add --no-cache bash

RUN cd /opt/swagger-codegen && mvn package
RUN mkdir /opt

ENTRYPOINT ["java", "-jar", "/opt/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"]
ADD . ${GEN_DIR}

CMD ["help"]
VOLUME ${MAVEN_HOME}/.m2/repository

WORKDIR ${GEN_DIR}

RUN mvn -am -pl "modules/swagger-codegen-cli" package

COPY docker-entrypoint.sh /usr/local/bin/

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["build"]
111 changes: 99 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
## Overview
This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:

- **API clients**: **ActionScript**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, Node)
- **Server stubs**: **C#** (ASP.NET Core, NancyFx), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), **PHP** (Lumen, Slim, Silex), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** (Scalatra)
- **API clients**: **ActionScript**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, Node)
- **Server stubs**: **C#** (ASP.NET Core, NancyFx), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra)
- **API documentation generators**: **HTML**, **Confluence Wiki**
- **Others**: **JMeter**

Expand Down Expand Up @@ -110,16 +110,41 @@ After cloning the project, you can build it from source with this command:
mvn clean package
```

### Homebrew

To install, run `brew install swagger-codegen`

Here is an example usage:
```
swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
```

### Docker
#### Build and run using docker

#### Development in docker

You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen`
in the docker container. It also maps `~/.m2/repository` to the appropriate container location.

To execute `mvn package`:

```
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
./run-in-docker.sh mvn package
```
```

Build artifacts are now accessible in your working directory.

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:

```
./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli
./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli
./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client
./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \
-l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore
```

#### Run Docker in Vagrant
Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
Expand All @@ -132,18 +157,54 @@ cd /vagrant
./run-in-docker.sh mvn package
```

#### Public Docker image
#### Public Pre-built Docker images

- https://hub.docker.com/r/swaggerapi/swagger-generator/ (official)
- https://hub.docker.com/r/jimschubert/swagger-codegen-cli/ (unofficial)
- https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service)
- https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI)
=======

### Homebrew
To install, run `brew install swagger-codegen`
##### Swagger Generator Docker Image

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.

Example usage (note this assumes `jq` is installed for command line processing of JSON):

Here is an example usage:
```
swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
# Start container and save the container id
CID=$(docker run -d swaggerapi/swagger-generator)
# allow for startup
sleep 5
# Get the IP of the running container
GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID)
# Execute an HTTP request and store the download link
RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"
}' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"')
# Download the generated zip and redirect to a file
curl $RESULT > result.zip
# Shutdown the swagger generator image
docker stop $CID && docker rm $CID
```

In the example above, `result.zip` will contain the generated client.

##### Swagger Codegen Docker Image

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.

To generate code with this image, you'll need to mount a local location as a volume.

Example:

```
docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l go \
-o /local/out/go
```

The generated code will be located under `./out/go` in the current directory.

## Getting Started

To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following
Expand Down Expand Up @@ -289,6 +350,10 @@ OPTIONS
the format of swaggerType=generatedType,swaggerType=generatedType.
For example: array=List,map=Map,string=String

--reserved-words-mappings <import mappings>
specifies how a reserved name should be escaped to. Otherwise, the
default _<name> is used. For example id=identifier

-v, --verbose
verbose mode

Expand Down Expand Up @@ -331,6 +396,10 @@ You would then compile your library in the `output/myLibrary` folder with `mvn p
```
java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen
```
For Windows users, you will need to use `;` instead of `:` in the classpath, e.g.
```
java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen
```

Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library:

Expand Down Expand Up @@ -459,6 +528,7 @@ AndroidClientCodegen.java
AspNet5ServerCodegen.java
AspNetCoreServerCodegen.java
AsyncScalaClientCodegen.java
BashClientCodegen.java
CSharpClientCodegen.java
ClojureClientCodegen.java
CsharpDotNet2ClientCodegen.java
Expand Down Expand Up @@ -784,25 +854,32 @@ Here are some companies/projects using Swagger Codegen in production. To add you
- [goTransverse](http://www.gotransverse.com/api)
- [GraphHopper](https://graphhopper.com/)
- [Gravitate Solutions](http://gravitatesolutions.com/)
- [Hewlett Packard Enterprise](https://hpe.com)
- [High Technologies Center](http://htc-cs.com)
- [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications)
- [Intent HQ](http://www.intenthq.com)
- [Interactive Intelligence](http://developer.mypurecloud.com/)
- [Kabuku](http://www.kabuku.co.jp/en)
- [Kurio](https://kurio.co.id)
- [Kuroi](http://kuroiwebdesign.com/)
- [Kuary](https://kuary.com/)
- [Kubernetes](https://kubernetes.io/)
- [LANDR Audio](https://www.landr.com/)
- [Lascaux](http://www.lascaux.it/)
- [Leica Geosystems AG](http://leica-geosystems.com)
- [LiveAgent](https://www.ladesk.com/)
- [LXL Tech](http://lxltech.com)
- [MailMojo](https://mailmojo.no/)
- [Mindera](http://mindera.com/)
- [Mporium](http://mporium.com/)
- [Neverfail](https://neverfail.com/)
- [nViso](http://www.nviso.ch/)
- [Okiok](https://www.okiok.com)
- [Onedata](http://onedata.org)
- [OrderCloud.io](http://ordercloud.io)
- [OSDN](https://osdn.jp)
- [PagerDuty](https://www.pagerduty.com)
- [PagerTree](https://pagertree.com)
- [Pepipost](https://www.pepipost.com)
- [Plexxi](http://www.plexxi.com)
- [Pixoneye](http://www.pixoneye.com/)
Expand All @@ -819,9 +896,12 @@ Here are some companies/projects using Swagger Codegen in production. To add you
- [Saritasa](https://www.saritasa.com/)
- [SCOOP Software GmbH](http://www.scoop-software.de)
- [Shine Solutions](https://shinesolutions.com/)
- [Simpfony](https://www.simpfony.com/)
- [Skurt](http://www.skurt.com)
- [Slamby](https://www.slamby.com/)
- [SmartRecruiters](https://www.smartrecruiters.com/)
- [snapCX](https://snapcx.io)
- [SPINEN](http://www.spinen.com)
- [SRC](https://www.src.si/)
- [StyleRecipe](http://stylerecipe.co.jp)
- [Svenska Spel AB](https://www.svenskaspel.se/)
Expand All @@ -832,6 +912,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
- [VMware](https://vmware.com/)
- [W.UP](http://wup.hu/?siteLang=en)
- [Wealthfront](https://www.wealthfront.com/)
- [Webever GmbH](https://www.webever.de/)
- [WEXO A/S](https://www.wexo.dk/)
- [Zalando](https://tech.zalando.com)
- [ZEEF.com](https://zeef.com/)
Expand Down Expand Up @@ -882,15 +963,19 @@ Swagger Codegen core team members are contributors who have been making signific
| Python Flask | |
| Ruby Sinatra | @wing328 (2016/05/01) | |
| Scala Scalatra | | |
| Scala Finch | @jimschubert (2017/01/28) |


## Template Creator
Here is a list of template creators:
* API Clients:
* Akka-Scala: @cchafer
* Bash: @bkryza
* C++ REST: @Danielku15
* C# (.NET 2.0): @who
* Clojure: @xhh
* Dart: @yissachar
* Elixir: @niku
* Groovy: @victorgit
* Go: @wing328
* Java (Feign): @davidkiss
Expand Down Expand Up @@ -922,7 +1007,9 @@ Here is a list of template creators:
* JAX-RS CXF (CDI): @nickcmaynard
* PHP Lumen: @abcsum
* PHP Slim: @jfastnacht
* PHP Zend Expressive (with Path Handler): @Articus
* Ruby on Rails 5: @zlx
* Scala Finch: @jimschubert
* Documentation
* HTML Doc 2: @jhitchcock
* Confluence Wiki: @jhitchcock
Expand Down Expand Up @@ -972,7 +1059,7 @@ When code is generated from this project, it shall be considered **AS IS** and o
License
-------

Copyright 2016 SmartBear Software
Copyright 2017 SmartBear Software

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
31 changes: 31 additions & 0 deletions bin/bash-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"

if [ ! -f "$executable" ]
then
mvn clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
args="$@ generate -t modules/swagger-codegen/src/main/resources/bash -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l bash -o samples/client/petstore/bash -c modules/swagger-codegen/src/test/resources/2_0/bash-config.json"

java $JAVA_OPTS -jar $executable $args
Loading