Skip to content

Commit 47e06dd

Browse files
authored
Merge pull request #4 from OpenAPITools/master
Merge openapi master
2 parents ea5a5eb + 0b2aa21 commit 47e06dd

File tree

4,017 files changed

+70024
-42958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,017 files changed

+70024
-42958
lines changed
File renamed without changes.

.github/.test/samples.json

+25-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@
807807
]
808808
},
809809
{
810-
"input": "php-ze-ph-petstore-server.sh",
810+
"input": "php-mezzio-ph-petstore-server.sh",
811811
"matches": [
812812
"Server: PHP"
813813
]
@@ -1244,6 +1244,30 @@
12441244
"Client: TypeScript"
12451245
]
12461246
},
1247+
{
1248+
"input": "typescript-nestjs-v6-petstore-not-provided-in-root-with-npm.sh",
1249+
"matches": [
1250+
"Client: TypeScript"
1251+
]
1252+
},
1253+
{
1254+
"input": "typescript-nestjs-v6-petstore-not-provided-in-root.sh",
1255+
"matches": [
1256+
"Client: TypeScript"
1257+
]
1258+
},
1259+
{
1260+
"input": "typescript-nestjs-v6-petstore-provided-in-root-with-npm.sh",
1261+
"matches": [
1262+
"Client: TypeScript"
1263+
]
1264+
},
1265+
{
1266+
"input": "typescript-nestjs-v6-petstore-provided-in-root.sh",
1267+
"matches": [
1268+
"Client: TypeScript"
1269+
]
1270+
},
12471271
{
12481272
"input": "typescript-node-petstore-with-npm.sh",
12491273
"matches": [

.github/PULL_REQUEST_TEMPLATE.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55

66
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
77
- [ ] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
8-
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) beforehand.
9-
- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
10-
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`
11-
- [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.
8+
- [ ] Run the following to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples:
9+
```
10+
./mvnw clean package
11+
./bin/generate-samples.sh
12+
./bin/utils/export_docs_generators.sh
13+
```
14+
Commit all changed files.
15+
This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master.
16+
These must match the expectations made by your contribution.
17+
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
18+
For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
19+
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `5.1.x`, `6.0.x`
20+
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.

.gitignore

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ packages/
3131
.vscode/
3232
**/.vs
3333
.factorypath
34+
.metals/*
3435

3536
.settings
3637

@@ -176,12 +177,12 @@ samples/client/petstore/python-tornado/.venv/
176177
# PHP
177178
samples/client/petstore/php/OpenAPIClient-php/composer.lock
178179
samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
179-
samples/openapi3/server/petstore/php-ze-ph/composer.lock
180+
samples/openapi3/server/petstore/php-mezzio-ph/composer.lock
180181
samples/server/petstore/php-laravel/lib/composer.lock
181182
samples/server/petstore/php-lumen/lib/composer.lock
182183
samples/server/petstore/php-slim4/composer.lock
183184
samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
184-
samples/server/petstore/php-ze-ph/composer.lock
185+
samples/server/petstore/php-mezzio-ph/composer.lock
185186

186187
# ts
187188
samples/client/petstore/typescript-angular2/npm/npm-debug.log
@@ -258,3 +259,6 @@ samples/client/petstore/c/*.so
258259
# Ruby
259260
samples/openapi3/client/petstore/ruby/Gemfile.lock
260261
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock
262+
263+
# Crystal
264+
samples/client/petstore/crystal/lib
+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import java.net.*;
17+
import java.io.*;
18+
import java.nio.channels.*;
19+
import java.util.Properties;
20+
21+
public class MavenWrapperDownloader {
22+
23+
private static final String WRAPPER_VERSION = "0.5.6";
24+
/**
25+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26+
*/
27+
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29+
30+
/**
31+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32+
* use instead of the default one.
33+
*/
34+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35+
".mvn/wrapper/maven-wrapper.properties";
36+
37+
/**
38+
* Path where the maven-wrapper.jar will be saved to.
39+
*/
40+
private static final String MAVEN_WRAPPER_JAR_PATH =
41+
".mvn/wrapper/maven-wrapper.jar";
42+
43+
/**
44+
* Name of the property which should be used to override the default download url for the wrapper.
45+
*/
46+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47+
48+
public static void main(String args[]) {
49+
System.out.println("- Downloader started");
50+
File baseDirectory = new File(args[0]);
51+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52+
53+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
54+
// wrapperUrl parameter.
55+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56+
String url = DEFAULT_DOWNLOAD_URL;
57+
if(mavenWrapperPropertyFile.exists()) {
58+
FileInputStream mavenWrapperPropertyFileInputStream = null;
59+
try {
60+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61+
Properties mavenWrapperProperties = new Properties();
62+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64+
} catch (IOException e) {
65+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66+
} finally {
67+
try {
68+
if(mavenWrapperPropertyFileInputStream != null) {
69+
mavenWrapperPropertyFileInputStream.close();
70+
}
71+
} catch (IOException e) {
72+
// Ignore ...
73+
}
74+
}
75+
}
76+
System.out.println("- Downloading from: " + url);
77+
78+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79+
if(!outputFile.getParentFile().exists()) {
80+
if(!outputFile.getParentFile().mkdirs()) {
81+
System.out.println(
82+
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83+
}
84+
}
85+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86+
try {
87+
downloadFileFromURL(url, outputFile);
88+
System.out.println("Done");
89+
System.exit(0);
90+
} catch (Throwable e) {
91+
System.out.println("- Error downloading");
92+
e.printStackTrace();
93+
System.exit(1);
94+
}
95+
}
96+
97+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99+
String username = System.getenv("MVNW_USERNAME");
100+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101+
Authenticator.setDefault(new Authenticator() {
102+
@Override
103+
protected PasswordAuthentication getPasswordAuthentication() {
104+
return new PasswordAuthentication(username, password);
105+
}
106+
});
107+
}
108+
URL website = new URL(urlString);
109+
ReadableByteChannel rbc;
110+
rbc = Channels.newChannel(website.openStream());
111+
FileOutputStream fos = new FileOutputStream(destination);
112+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113+
fos.close();
114+
rbc.close();
115+
}
116+
117+
}

.mvn/wrapper/maven-wrapper.jar

2.32 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

.travis.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,30 @@ addons:
6262
- petstore.swagger.io
6363

6464
before_install:
65+
# to run petstore server locally via docker
66+
- echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin || true
67+
- docker pull swaggerapi/petstore
68+
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
69+
- docker ps -a
70+
# install crystal
71+
- curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash
72+
- curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -
73+
- echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list
74+
- sudo apt-get update
75+
- sudo apt install crystal
6576
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
6677
- export PATH="$HOME/.yarn/bin:$PATH"
6778
# install rust
6879
- curl https://sh.rustup.rs -sSf | sh -s -- -y -v
6980
# required when sudo: required for the Ruby petstore tests
7081
- gem install bundler
82+
- nvm install 12.20.0
83+
- nvm use 12.20.0
7184
- npm install -g typescript
7285
- npm install -g npm
7386
- npm config set registry http://registry.npmjs.org/
7487
# set python 3.6.3 as default
7588
- source ~/virtualenv/python3.6/bin/activate
76-
# to run petstore server locally via docker
77-
- docker pull swaggerapi/petstore
78-
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
79-
- docker ps -a
8089
# -- skip bash test to shorten build time
8190
# Add bats test framework and cURL for Bash script integration tests
8291
#- sudo add-apt-repository ppa:duggan/bats --yes
@@ -122,7 +131,7 @@ before_install:
122131
fi;
123132
- pushd .; cd website; yarn install; popd
124133
# install Deno
125-
- sh -s v1.1.2 < ./CI/deno_install.sh
134+
- sh -s v1.6.2 < ./CI/deno_install.sh
126135
- export PATH="$HOME/.deno/bin:$PATH"
127136

128137
install:

CI/.drone.yml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ kind: pipeline
22
name: default
33

44
steps:
5+
# test nim client
6+
- name: nim-client-test
7+
image: nimlang/nim
8+
commands:
9+
- (cd samples/client/petstore/nim/ && nim c sample_client.nim)
510
# test protobuf schema generator
611
- name: protobuf-schema-test
712
image: nanoservice/protobuf-go

CI/bitrise.yml

-51
This file was deleted.

CI/circle_parallel.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ elif [ "$NODE_INDEX" = "2" ]; then
4141
curl -sSL https://get.haskellstack.org/ | sh
4242
stack upgrade
4343
stack --version
44-
# install r
44+
# prepare r
4545
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
4646
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
4747
gpg -a --export E084DAB9 | sudo apt-key add -
4848
sudo apt-get update
4949
sudo apt-get -y install r-base
5050
R --version
51+
5152
# install curl
5253
sudo apt-get -y build-dep libcurl4-gnutls-dev
5354
sudo apt-get -y install libcurl4-gnutls-dev

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Code change should conform to the programming style guide of the respective lang
4949
- C++: https://google.github.io/styleguide/cppguide.html
5050
- C++ (Tizen): https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style
5151
- Clojure: https://github.com/bbatsov/clojure-style-guide
52+
- Crystal: https://crystal-lang.org/reference/conventions/coding_style.html
5253
- Dart: https://www.dartlang.org/guides/language/effective-dart/style
5354
- Elixir: https://github.com/christopheradams/elixir_style_guide
5455
- Eiffel: https://www.eiffel.org/doc/eiffel/Coding%20Standards

0 commit comments

Comments
 (0)