forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 3.1.x
This commit is contained in:
+1
-1
@@ -112,7 +112,7 @@ after_success:
|
||||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" uploadArchives --no-daemon;
|
||||
echo "Finished ./gradlew uploadArchives";
|
||||
popd;
|
||||
else
|
||||
elif ([ "$TRAVIS_BRANCH" == "3.1.x" ] || [ "$TRAVIS_BRANCH" == "4.0.x" ]) ; then
|
||||
mvn clean deploy --settings CI/settings.xml;
|
||||
echo "Finished mvn clean deploy for $TRAVIS_BRANCH";
|
||||
pushd .;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.2-SNAPSHOT`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.3-SNAPSHOT`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
@@ -85,9 +85,10 @@ OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes
|
||||
---------------------------- | ------------ | -------------------------- | -----
|
||||
4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback)
|
||||
3.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
|
||||
3.0.2 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.2-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2,
|
||||
3.0.1 | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
3.0.0 | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes
|
||||
3.0.3 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2,
|
||||
[3.0.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.2) | 18.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
[3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
[3.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.0) | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes
|
||||
|
||||
### [1.2 - Artifacts on Maven Central](#table-of-contents)
|
||||
|
||||
@@ -143,12 +144,12 @@ JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generato
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.1/openapi-generator-cli-3.0.1.jar -O openapi-generator-cli.jar
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.2/openapi-generator-cli-3.0.2.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
```
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.1/openapi-generator-cli-3.0.1.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.2/openapi-generator-cli-3.0.2.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -179,13 +180,15 @@ If you don't have maven installed, you may directly use the included [maven wrap
|
||||
|
||||
### [1.5 - Homebrew](#table-of-contents)
|
||||
|
||||
To install, run `brew install openapi-generator` (the new brew formula is pending https://github.com/Homebrew/homebrew-core/pull/28584)
|
||||
To install, run `brew install openapi-generator`
|
||||
|
||||
Here is an example usage to generate a Ruby client:
|
||||
```sh
|
||||
openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby -o /tmp/test/
|
||||
```
|
||||
|
||||
To reinstall with the latest master, run `brew reinstall --HEAD openapi-generator`
|
||||
|
||||
### [1.6 - Docker](#table-of-contents)
|
||||
|
||||
#### Public Pre-built Docker images
|
||||
|
||||
@@ -27,6 +27,6 @@ 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"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/qt5cpp -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ 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"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpprest -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-rest-sdk-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ 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"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/tizen -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-tizen-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ 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"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/qt5cpp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ 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"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/tizen -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-tizen-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ 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"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/qt5cpp -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g cpp-qt5 -o samples/client/petstore-security-test/cpp-qt5 $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g cpp-qt5 -o samples/client/petstore-security-test/cpp-qt5 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -t modules/openapi-generator/src/main/resources/qt5cpp -i modules\openapi-generator\src\test\resources\2_0\petstore-security-test.yaml -g qt5cpp -o samples\client\petstore-security-test\qt5cpp
|
||||
set ags=generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules\openapi-generator\src\test\resources\2_0\petstore-security-test.yaml -g qt5cpp -o samples\client\petstore-security-test\qt5cpp
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# this bash script run the scripts for the 'mature' generators
|
||||
# it ensures that all changes are commited into the 'samples/' folder
|
||||
# it ensures that all changes are committed into the 'samples/' folder
|
||||
|
||||
echo "# START SCRIPT: $0"
|
||||
|
||||
|
||||
+93
-54
@@ -1,54 +1,93 @@
|
||||
# Java-related client, server tests
|
||||
machine:
|
||||
java:
|
||||
version: openjdk8
|
||||
services:
|
||||
- docker
|
||||
# Override /etc/hosts
|
||||
hosts:
|
||||
petstore.swagger.io: 127.0.0.1
|
||||
environment:
|
||||
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
||||
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
||||
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/.m2"
|
||||
- "~/.sbt"
|
||||
- "~/.ivy2"
|
||||
|
||||
pre:
|
||||
- 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
|
||||
# to run petstore server locally via docker
|
||||
- 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
|
||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||
- cat /etc/hosts
|
||||
override:
|
||||
- cp CI/pom.xml.circleci pom.xml
|
||||
|
||||
test:
|
||||
override:
|
||||
## test with jdk8
|
||||
- java -version
|
||||
- mvn --quiet clean install
|
||||
- mvn --quiet verify -Psamples
|
||||
# skip the rest if previous mvn task fails
|
||||
- if [ $? -ne 0 ]; then exit 1; fi
|
||||
## test with jdk7
|
||||
- sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
- java -version
|
||||
- cp CI/pom.xml.circleci.java7 pom.xml # use jdk7 pom
|
||||
- mvn --quiet clean install
|
||||
- mvn --quiet verify -Psamples
|
||||
# skip the rest if previous mvn task fails
|
||||
- if [ $? -ne 0 ]; then exit 1; fi
|
||||
## docker push done in Travis instead
|
||||
## docker: build generator image and push to Docker Hub
|
||||
#- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/opeanapi-generator && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi
|
||||
### docker: build cli image and push to Docker Hub
|
||||
#- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
machine:
|
||||
docker_layer_caching: true
|
||||
working_directory: ~/OpenAPITools/openapi-generator
|
||||
parallelism: 1
|
||||
shell: /bin/bash --login
|
||||
environment:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
||||
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
||||
steps:
|
||||
# Machine Setup
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
|
||||
- checkout
|
||||
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
|
||||
# In many cases you can simplify this from what is generated here.
|
||||
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
|
||||
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run:
|
||||
command: sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV
|
||||
- run:
|
||||
command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
|
||||
- run:
|
||||
command: |-
|
||||
printf '127.0.0.1 petstore.swagger.io
|
||||
' | sudo tee -a /etc/hosts
|
||||
# Dependencies
|
||||
# This would typically go in either a build or a build-and-test job when using workflows
|
||||
# Restore the dependency cache
|
||||
- restore_cache:
|
||||
keys:
|
||||
# This branch if available
|
||||
- v1-dep-{{ .Branch }}-
|
||||
# Default branch if not
|
||||
- v1-dep-master-
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: sudo add-apt-repository ppa:duggan/bats --yes
|
||||
- run: sudo apt-get update -qq
|
||||
- run: sudo apt-get install -qq bats
|
||||
- run: sudo apt-get install -qq curl
|
||||
# - run: docker pull openapitools/openapi-petstore
|
||||
# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore
|
||||
- run: docker pull swaggerapi/petstore
|
||||
- run: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- run: docker ps -a
|
||||
- run: sleep 30
|
||||
- run: cat /etc/hosts
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: cp CI/pom.xml.circleci pom.xml
|
||||
# Save dependency cache
|
||||
- save_cache:
|
||||
key: v1-dep-{{ .Branch }}
|
||||
paths:
|
||||
# This is a broad list of cache paths to include many possible development environments
|
||||
# You can probably delete some of these entries
|
||||
- vendor/bundle
|
||||
- ~/virtualenvs
|
||||
- ~/.m2
|
||||
- ~/.ivy2
|
||||
- ~/.bundle
|
||||
- ~/.go_workspace
|
||||
- ~/.gradle
|
||||
- ~/.cache/bower
|
||||
# These cache paths were specified in the 1.0 config
|
||||
- ~/.sbt
|
||||
# Test
|
||||
# This would typically be a build job when using workflows, possibly combined with build
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: java -version
|
||||
- run: mvn --quiet clean install
|
||||
- run: mvn --quiet verify -Psamples
|
||||
- run: if [ $? -ne 0 ]; then exit 1; fi
|
||||
- run: sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
- run: java -version
|
||||
- run: cp CI/pom.xml.circleci.java7 pom.xml
|
||||
- run: mvn --quiet clean install
|
||||
- run: mvn --quiet verify -Psamples
|
||||
- run: if [ $? -ne 0 ]; then exit 1; fi
|
||||
# Teardown
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# Save test results
|
||||
- store_test_results:
|
||||
path: /tmp/circleci-test-results
|
||||
# Save artifacts
|
||||
- store_artifacts:
|
||||
path: /tmp/circleci-artifacts
|
||||
- store_artifacts:
|
||||
path: /tmp/circleci-test-results
|
||||
|
||||
@@ -166,7 +166,7 @@ cf8d8d56f [PHP] Fix code example from README. Variable name was missing when usi
|
||||
76907cacd [PHP] declare property headerSelector
|
||||
|
||||
### Python
|
||||
7184f1ec6 [python] asyncio supports _preload_content; remove unsed imports (#107)
|
||||
7184f1ec6 [python] asyncio supports _preload_content; remove unused imports (#107)
|
||||
d74d2ba03 fix: python clients
|
||||
8e0a0ebd6 Fix python / tornado body handling
|
||||
b39c35c76 Fix inconsistency between model name and file name in python client
|
||||
@@ -250,7 +250,7 @@ ce930e7a6 [Jaxrs-cxf] Add bean-level cascaded beanvalidation for pojos (@Valid)
|
||||
ff1178ad7 [Java][Spring] fix missing optional query params
|
||||
2103fadab Fix package declaration for play-framework
|
||||
2c6380c84 fix inner item (list, map) for play framework
|
||||
e33b350c8 Fix an issue in Play Framework generator where a CSV is empty and transfered to the controllerImp with an empty item.
|
||||
e33b350c8 Fix an issue in Play Framework generator where a CSV is empty and transferred to the controllerImp with an empty item.
|
||||
99fc27246 [JAX-RS][Spec] Removes throws Exception.
|
||||
fe2a44339 Fixes issue (SpringCodeGen dateLibrary "java8-localdatetime" option is ignored).
|
||||
d890d733f [JaxRS][Java] issue with implFolder on windows, and required fields generation for containers (#88)
|
||||
|
||||
+42
-8
@@ -21,7 +21,9 @@ import io.airlift.airline.Command;
|
||||
import io.airlift.airline.Option;
|
||||
|
||||
import io.swagger.parser.OpenAPIParser;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.parser.core.models.SwaggerParseResult;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -34,26 +36,58 @@ public class Validate implements Runnable {
|
||||
description = "location of the OpenAPI spec, as URL or file (required)")
|
||||
private String spec;
|
||||
|
||||
@Option(name = { "--recommend"}, title = "recommend spec improvements")
|
||||
private Boolean recommend;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("Validating spec (" + spec + ")");
|
||||
|
||||
SwaggerParseResult result = new OpenAPIParser().readLocation(spec, null, null);
|
||||
List<String> messageList = result.getMessages();
|
||||
Set<String> messages = new HashSet<String>(messageList);
|
||||
Set<String> errors = new HashSet<String>(messageList);
|
||||
Set<String> warnings = new HashSet<String>();
|
||||
|
||||
if (messages.size() > 0) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(System.lineSeparator());
|
||||
for (String message : messages) {
|
||||
sb.append(String.format("\t- %s%s", message, System.lineSeparator()));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
OpenAPI specification = result.getOpenAPI();
|
||||
|
||||
if (Boolean.TRUE.equals(recommend)) {
|
||||
if (specification != null) {
|
||||
// Add information about unused models to the warnings set.
|
||||
List<String> unusedModels = ModelUtils.getUnusedSchemas(specification);
|
||||
if (unusedModels != null) {
|
||||
unusedModels.forEach(name -> warnings.add("Unused model: " + name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errors.size() > 0) {
|
||||
sb.append("Errors:").append(System.lineSeparator());
|
||||
errors.forEach(msg ->
|
||||
sb.append("\t-").append(msg).append(System.lineSeparator())
|
||||
);
|
||||
}
|
||||
|
||||
if (!warnings.isEmpty()) {
|
||||
sb.append("Warnings: ").append(System.lineSeparator());
|
||||
warnings.forEach(msg ->
|
||||
sb.append("\t-").append(msg).append(System.lineSeparator())
|
||||
);
|
||||
}
|
||||
|
||||
if (!errors.isEmpty()) {
|
||||
sb.append(System.lineSeparator());
|
||||
sb.append("[error] Spec is invalid.");
|
||||
sb.append("[error] Spec has ").append(errors.size()).append(" errors.");
|
||||
System.err.println(sb.toString());
|
||||
System.exit(1);
|
||||
} else if (!warnings.isEmpty()) {
|
||||
sb.append(System.lineSeparator());
|
||||
sb.append("[info] Spec has ").append(warnings.size()).append(" recommendation(s).");
|
||||
} else {
|
||||
System.out.println("No validation errors detected.");
|
||||
// we say "issues" here rather than "errors" to account for both errors and issues.
|
||||
sb.append("No validation issues detected.");
|
||||
}
|
||||
|
||||
System.out.println(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.1"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ gradle buildGoSdk
|
||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||
|
||||
```bash
|
||||
gradle -PopenApiGeneratorVersion=3.0.1 openApiValidate
|
||||
gradle -PopenApiGeneratorVersion=3.0.2 openApiValidate
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
||||
@@ -10,6 +10,6 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring
|
||||
|
||||
The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox)
|
||||
|
||||
Start your server as an simple java application
|
||||
Start your server as a simple java application
|
||||
|
||||
Change default port value in application.properties
|
||||
Change default port value in application.properties
|
||||
|
||||
+6
-6
@@ -210,7 +210,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
for (String name : allModels.keySet()) {
|
||||
CodegenModel cm = allModels.get(name);
|
||||
CodegenModel parent = allModels.get(cm.getParent());
|
||||
// if a discriminator exists on the parent, don't add this child to the inheritance heirarchy
|
||||
// if a discriminator exists on the parent, don't add this child to the inheritance hierarchy
|
||||
// TODO Determine what to do if the parent discriminator name == the grandparent discriminator name
|
||||
while (parent != null) {
|
||||
if (parent.getChildren() == null) {
|
||||
@@ -1201,7 +1201,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
*/
|
||||
private static String getPrimitiveType(Schema schema) {
|
||||
if (schema == null) {
|
||||
throw new RuntimeException("schema cannnot be null in getPrimitiveType");
|
||||
throw new RuntimeException("schema cannot be null in getPrimitiveType");
|
||||
} else if (ModelUtils.isStringSchema(schema) && "number".equals(schema.getFormat())) {
|
||||
// special handle of type: string, format: number
|
||||
return "BigDecimal";
|
||||
@@ -1300,7 +1300,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
/**
|
||||
* Determine the type alias for the given type if it exists. This feature
|
||||
* was original developed for Java because the language does not have a aliasing
|
||||
* was originally developed for Java because the language does not have an aliasing
|
||||
* mechanism of its own but later extends to handle other languages
|
||||
*
|
||||
* @param name The type name.
|
||||
@@ -2055,7 +2055,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
if (operation == null)
|
||||
throw new RuntimeException("operation cannnot be null in fromOperation");
|
||||
throw new RuntimeException("operation cannot be null in fromOperation");
|
||||
|
||||
// store the original operationId for plug-in
|
||||
op.operationIdOriginal = operation.getOperationId();
|
||||
@@ -3853,7 +3853,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody());
|
||||
|
||||
if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) {
|
||||
return Collections.emptySet(); // return emtpy set
|
||||
return Collections.emptySet(); // return empty set
|
||||
}
|
||||
return requestBody.getContent().keySet();
|
||||
}
|
||||
@@ -4249,7 +4249,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (schema.getAdditionalProperties() != null) {// http body is map
|
||||
LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue.");
|
||||
} else if (codegenProperty != null) {
|
||||
LOGGER.warn("The folowing schema has undefined (null) baseType. " +
|
||||
LOGGER.warn("The following schema has undefined (null) baseType. " +
|
||||
"It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " +
|
||||
"A correct 'consumes' for form parameters should be " +
|
||||
"'application/x-www-form-urlencoded' or 'multipart/form-data'");
|
||||
|
||||
+1
-1
@@ -1012,7 +1012,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
for (String key : definitions.keySet()) {
|
||||
Schema schema = definitions.get(key);
|
||||
if (schema == null)
|
||||
throw new RuntimeException("schema cannnot be null in processMoels");
|
||||
throw new RuntimeException("schema cannot be null in processMoels");
|
||||
CodegenModel cm = config.fromModel(key, schema, allDefinitions);
|
||||
Map<String, Object> mo = new HashMap<String, Object>();
|
||||
mo.put("model", cm);
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
|
||||
/**
|
||||
* Post process the media types (produces and consumes) for Ada code generator.
|
||||
* <p>
|
||||
* For each media type, add a adaMediaType member that gives the Ada enum constant
|
||||
* For each media type, add an adaMediaType member that gives the Ada enum constant
|
||||
* for the corresponding type.
|
||||
*
|
||||
* @param types the list of media types.
|
||||
|
||||
+1
-1
@@ -341,7 +341,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
.build();
|
||||
|
||||
if (objs.containsKey("lambda")) {
|
||||
LOGGER.warn("An property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " +
|
||||
LOGGER.warn("A property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " +
|
||||
"You'll likely need to use a custom template, " +
|
||||
"see https://github.com/swagger-api/swagger-codegen#modifying-the-client-library-format. ");
|
||||
objs.put("_lambda", lambdas);
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
|
||||
apiTemplateFiles.put("api-impl-source.mustache", ".cpp");
|
||||
apiTemplateFiles.put("main-api-server.mustache", ".cpp");
|
||||
|
||||
embeddedTemplateDir = templateDir = "pistache-server";
|
||||
embeddedTemplateDir = templateDir = "cpp-pistache-server";
|
||||
|
||||
cliOptions.clear();
|
||||
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo
|
||||
* Template Location. This is the location which templates will be read from. The generator
|
||||
* will use the resource stream to attempt to read the templates.
|
||||
*/
|
||||
embeddedTemplateDir = templateDir = "qt5cpp";
|
||||
embeddedTemplateDir = templateDir = "cpp-qt5-client";
|
||||
|
||||
// CLI options
|
||||
addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace);
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
|
||||
apiTemplateFiles.put("api-header.mustache", ".h");
|
||||
apiTemplateFiles.put("api-source.mustache", ".cpp");
|
||||
|
||||
embeddedTemplateDir = templateDir = "cpprest";
|
||||
embeddedTemplateDir = templateDir = "cpp-rest-sdk-client";
|
||||
|
||||
cliOptions.clear();
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
|
||||
apiTemplateFiles.put("api-header.mustache", ".h");
|
||||
apiTemplateFiles.put("api-source.mustache", ".cpp");
|
||||
|
||||
embeddedTemplateDir = templateDir = "restbed";
|
||||
embeddedTemplateDir = templateDir = "cpp-restbed-server";
|
||||
|
||||
cliOptions.clear();
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class CppTizenClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
modelTemplateFiles.put("model-body.mustache", ".cpp");
|
||||
apiTemplateFiles.put("api-header.mustache", ".h");
|
||||
apiTemplateFiles.put("api-body.mustache", ".cpp");
|
||||
embeddedTemplateDir = templateDir = "tizen";
|
||||
embeddedTemplateDir = templateDir = "cpp-tizen-client";
|
||||
modelPackage = "";
|
||||
|
||||
defaultIncludes = new HashSet<String>(
|
||||
|
||||
+5
@@ -986,6 +986,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
}
|
||||
String jsdocType = getJSDocType(operation);
|
||||
operation.vendorExtensions.put("x-jsdoc-type", jsdocType);
|
||||
|
||||
// Format the return type correctly
|
||||
if (operation.returnType != null) {
|
||||
operation.vendorExtensions.put("x-return-type", normalizeType(operation.returnType));
|
||||
}
|
||||
}
|
||||
}
|
||||
return objs;
|
||||
|
||||
+1
-1
@@ -229,7 +229,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
|
||||
.build();
|
||||
|
||||
if (objs.containsKey("lambda")) {
|
||||
LOGGER.warn("An property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " +
|
||||
LOGGER.warn("A property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " +
|
||||
"You'll likely need to use a custom template, " +
|
||||
"see https://github.com/swagger-api/swagger-codegen#modifying-the-client-library-format. "); // TODO: update the URL
|
||||
objs.put("_lambda", lambdas);
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public class URLPathUtils {
|
||||
LOGGER.warn("Server information seems not defined in the spec. Default to {}.", LOCAL_HOST);
|
||||
return getDefaultUrl();
|
||||
}
|
||||
// TOOD need a way to obtain all server URLs
|
||||
// TODO need a way to obtain all server URLs
|
||||
final Server server = servers.get(0);
|
||||
String url = sanitizeUrl(server.getUrl());
|
||||
|
||||
@@ -150,4 +150,4 @@ public class URLPathUtils {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ run the following command:
|
||||
gprbuild -p -P{{projectName}}
|
||||
```
|
||||
|
||||
After the build is successfull, you will get the server binary
|
||||
After the build is successful, you will get the server binary
|
||||
in bin/{{packageName}}-server and you can start it as follows:
|
||||
```
|
||||
./bin/{{packageName}}-server
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expanded class
|
||||
feature -- Access
|
||||
|
||||
from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY
|
||||
-- Deserialize a a json representation `a_val' to an object
|
||||
-- Deserialize a json representation `a_val' to an object
|
||||
-- of type `a_type'
|
||||
local
|
||||
conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER
|
||||
|
||||
+1
-1
@@ -915,7 +915,7 @@ public class ApiClient {
|
||||
* @param <T> Type
|
||||
* @param response Response
|
||||
* @param returnType Return type
|
||||
* @throws ApiException If the response has a unsuccessful status code or
|
||||
* @throws ApiException If the response has an unsuccessful status code or
|
||||
* fail to deserialize the response body
|
||||
* @return Type
|
||||
*/
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring
|
||||
The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox)
|
||||
|
||||
{{/useSpringfox}}
|
||||
Start your server as an simple java application
|
||||
Start your server as a simple java application
|
||||
|
||||
{{^reactive}}
|
||||
You can view the api documentation in swagger-ui by pointing to
|
||||
@@ -46,4 +46,4 @@ public interface PetClient extends PetApi {
|
||||
|
||||
}
|
||||
```
|
||||
{{/interfaceOnly}}
|
||||
{{/interfaceOnly}}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
var authNames = [<#authMethods>'<name>'<#hasMore>, </hasMore></authMethods>];
|
||||
var contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, </hasMore></consumes>];
|
||||
var accepts = [<#produces>'<& mediaType>'<#hasMore>, </hasMore></produces>];
|
||||
var returnType = <#returnType><&returnType></returnType><^returnType>null</returnType>;
|
||||
var returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type></vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null</vendorExtensions.x-return-type>;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'<&path>', '<httpMethod>',
|
||||
|
||||
@@ -15,7 +15,7 @@ import querystring from "querystring";
|
||||
* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient
|
||||
* @class
|
||||
*/{{/emitJSDoc}}
|
||||
export default class ApiClient {
|
||||
class ApiClient {
|
||||
constructor() {
|
||||
{{#emitJSDoc}}/**
|
||||
* The base URL against which to resolve every API call's (relative) path.
|
||||
@@ -221,43 +221,6 @@ export default class ApiClient {
|
||||
return newParams;
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Enumeration of collection format separator strategies.
|
||||
* @enum {String}
|
||||
* @readonly
|
||||
*/{{/emitJSDoc}}
|
||||
static CollectionFormatEnum = {
|
||||
{{#emitJSDoc}}/**
|
||||
* Comma-separated values. Value: <code>csv</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
CSV: ',',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Space-separated values. Value: <code>ssv</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
SSV: ' ',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Tab-separated values. Value: <code>tsv</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
TSV: '\t',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Pipe(|)-separated values. Value: <code>pipes</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
PIPES: '|',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Native array. Value: <code>multi</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
MULTI: 'multi'
|
||||
};
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Builds a string representation of an array-type actual parameter, according to the given collection format.
|
||||
* @param {Array} param An array parameter.
|
||||
@@ -597,8 +560,46 @@ export default class ApiClient {
|
||||
};
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Enumeration of collection format separator strategies.
|
||||
* @enum {String}
|
||||
* @readonly
|
||||
*/{{/emitJSDoc}}
|
||||
ApiClient.CollectionFormatEnum = {
|
||||
{{#emitJSDoc}}/**
|
||||
* Comma-separated values. Value: <code>csv</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
CSV: ',',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Space-separated values. Value: <code>ssv</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
SSV: ' ',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Tab-separated values. Value: <code>tsv</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
TSV: '\t',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Pipe(|)-separated values. Value: <code>pipes</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
PIPES: '|',
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Native array. Value: <code>multi</code>
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
MULTI: 'multi'
|
||||
};
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* The default API client implementation.
|
||||
* @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient}
|
||||
*/{{/emitJSDoc}}
|
||||
ApiClient.instance = new ApiClient();
|
||||
export default ApiClient;
|
||||
@@ -69,7 +69,7 @@ export default class <classname> {
|
||||
let authNames = [<#authMethods>'<name>'<#hasMore>, </hasMore></authMethods>];
|
||||
let contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, </hasMore></consumes>];
|
||||
let accepts = [<#produces>'<& mediaType>'<#hasMore>, </hasMore></produces>];
|
||||
let returnType = <#returnType><&returnType></returnType><^returnType>null</returnType>;
|
||||
let returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type></vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null</vendorExtensions.x-return-type>;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'<&path>', '<httpMethod>',
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
{{>licenseInfo}}
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
{{#imports}}import {{import}} from './{{import}}';
|
||||
{{/imports}}
|
||||
|
||||
{{#models}}{{#model}}
|
||||
{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}}
|
||||
{{/model}}{{/models}}
|
||||
{{/imports}}{{#models}}{{#model}}{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}}{{/model}}{{/models}}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ export default class {{classname}} {
|
||||
* value: {{{value}}}
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
{{name}} = {{{value}}};
|
||||
"{{name}}" = {{{value}}};
|
||||
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
|
||||
|
||||
+72
-89
@@ -1,54 +1,49 @@
|
||||
|
||||
{{#models}}{{#model}}
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* The {{classname}} model module.
|
||||
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @version {{projectVersion}}
|
||||
*/{{/emitJSDoc}}
|
||||
export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{
|
||||
{{#models}}{{#model}}{{#emitJSDoc}}/**
|
||||
* The {{classname}} model module.
|
||||
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @version {{projectVersion}}
|
||||
*/{{/emitJSDoc}}
|
||||
class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{
|
||||
{{#emitJSDoc}}/**
|
||||
* Constructs a new <code>{{classname}}</code>.{{#description}}
|
||||
* {{description}}{{/description}}
|
||||
* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @class{{#useInheritance}}{{#parent}}
|
||||
* @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}}
|
||||
* @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
|
||||
* @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}}
|
||||
*/{{/emitJSDoc}}
|
||||
|
||||
constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) {
|
||||
{{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}
|
||||
* Constructs a new <code>{{classname}}</code>.{{#description}}
|
||||
* {{description}}{{/description}}
|
||||
* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}}
|
||||
* @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}}
|
||||
* @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
|
||||
* @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}}
|
||||
*/{{/emitJSDoc}}
|
||||
constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}
|
||||
super();
|
||||
{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}
|
||||
|
||||
{{#useInheritance}}
|
||||
{{#parentModel}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/parentModel}}
|
||||
{{#interfaceModels}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/interfaceModels}}
|
||||
{{/useInheritance}}
|
||||
|
||||
{{#vars}}{{#required}}this['{{baseName}}'] = {{name}};{{/required}}{{/vars}}
|
||||
|
||||
{{#parent}}{{^parentModel}}return this;{{/parentModel}}{{/parent}}
|
||||
{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{{#useInheritance}}
|
||||
{{#interfaceModels}}{{classname}}.initialize(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/interfaceModels}}{{/useInheritance}}
|
||||
{{classname}}.initialize(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Constructs a <code>{{classname}}</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {{=< >=}}{module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> obj Optional instance to populate.
|
||||
* @return {{=< >=}}{module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> The populated <code>{{classname}}</code> instance.
|
||||
*/{{/emitJSDoc}}
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/{{/emitJSDoc}}
|
||||
static initialize(obj{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}}) { {{#vars}}{{#required}}
|
||||
obj['{{baseName}}'] = {{name}};{{/required}}{{/vars}}
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Constructs a <code>{{classname}}</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {{=< >=}}{module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> obj Optional instance to populate.
|
||||
* @return {{=< >=}}{module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> The populated <code>{{classname}}</code> instance.
|
||||
*/{{/emitJSDoc}}
|
||||
static constructFromObject(data, obj) {
|
||||
if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} {
|
||||
obj = obj || new {{classname}}();
|
||||
obj = obj || new {{classname}}();{{#parent}}{{^parentModel}}
|
||||
|
||||
{{#parent}}{{^parentModel}}ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}');{{/parentModel}}
|
||||
{{/parent}}
|
||||
|
||||
{{#useInheritance}}{{#parentModel}}{{classname}}.constructFromObject(data, obj);{{/parentModel}}
|
||||
{{#interfaces}}{{.}}.constructFromObject(data, obj);{{/interfaces}}
|
||||
{{/useInheritance}}
|
||||
ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}');
|
||||
{{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}}
|
||||
{{classname}}.constructFromObject(data, obj);{{/parentModel}}{{#interfaces}}
|
||||
{{.}}.constructFromObject(data, obj);{{/interfaces}}{{/useInheritance}}
|
||||
|
||||
{{#vars}}
|
||||
if (data.hasOwnProperty('{{baseName}}')) {
|
||||
@@ -59,61 +54,49 @@ export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtension
|
||||
return obj;
|
||||
}
|
||||
|
||||
{{#vars}}
|
||||
{{#emitJSDoc}}/**{{#description}}
|
||||
* {{{description}}}{{/description}}
|
||||
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
|
||||
* @default {{{defaultValue}}}{{/defaultValue}}
|
||||
*/{{/emitJSDoc}}
|
||||
{{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}};
|
||||
{{/vars}}
|
||||
|
||||
{{#useInheritance}}{{#interfaceModels}}
|
||||
// Implement {{classname}} interface:
|
||||
{{#allVars}}{{#emitJSDoc}}/**{{#description}}
|
||||
* {{{description}}}{{/description}}
|
||||
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
|
||||
* @default {{{defaultValue}}}{{/defaultValue}}
|
||||
*/{{/emitJSDoc}}
|
||||
{{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}};
|
||||
{{/allVars}}
|
||||
{{/interfaceModels}}{{/useInheritance}}
|
||||
|
||||
|
||||
{{#emitModelMethods}}{{#vars}}
|
||||
{{#emitJSDoc}}/**{{#description}}
|
||||
* Returns {{{description}}}{{/description}}{{#minimum}}
|
||||
* minimum: {{minimum}}{{/minimum}}{{#maximum}}
|
||||
* maximum: {{maximum}}{{/maximum}}
|
||||
* @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=>
|
||||
*/{{/emitJSDoc}}
|
||||
{{#emitModelMethods}}{{#vars}}{{#emitJSDoc}}/**{{#description}}
|
||||
* Returns {{{description}}}{{/description}}{{#minimum}}
|
||||
* minimum: {{minimum}}{{/minimum}}{{#maximum}}
|
||||
* maximum: {{maximum}}{{/maximum}}
|
||||
* @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=>
|
||||
*/{{/emitJSDoc}}
|
||||
{{getter}}() {
|
||||
return this.{{baseName}};
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}/**{{#description}}
|
||||
* Sets {{{description}}}{{/description}}
|
||||
* @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}}
|
||||
*/{{/emitJSDoc}}
|
||||
* Sets {{{description}}}{{/description}}
|
||||
* @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}}
|
||||
*/{{/emitJSDoc}}
|
||||
{{setter}}({{name}}) {
|
||||
this['{{baseName}}'] = {{name}};
|
||||
}
|
||||
{{/vars}}{{/emitModelMethods}}
|
||||
{{/vars}}{{/emitModelMethods}}{{/model}}
|
||||
}
|
||||
|
||||
{{#vars}}{{#emitJSDoc}}/**{{#description}}
|
||||
* {{{description}}}{{/description}}
|
||||
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
|
||||
* @default {{{defaultValue}}}{{/defaultValue}}
|
||||
*/{{/emitJSDoc}}
|
||||
{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}};
|
||||
|
||||
{{#vars}}
|
||||
{{#isEnum}}
|
||||
{{^isContainer}}
|
||||
{{>partial_model_inner_enum}}
|
||||
{{/isContainer}}
|
||||
{{/isEnum}}
|
||||
{{#items.isEnum}}
|
||||
{{#items}}
|
||||
{{^isContainer}}
|
||||
{{>partial_model_inner_enum}}
|
||||
{{/isContainer}}
|
||||
{{/items}}
|
||||
{{/items.isEnum}}
|
||||
{{/vars}}
|
||||
|
||||
{{/model}}{{/models}}
|
||||
}
|
||||
{{#useInheritance}}{{#interfaceModels}}// Implement {{classname}} interface:
|
||||
{{#allVars}}{{#emitJSDoc}}/**{{#description}}
|
||||
* {{{description}}}{{/description}}
|
||||
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
|
||||
* @default {{{defaultValue}}}{{/defaultValue}}
|
||||
*/{{/emitJSDoc}}
|
||||
{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}};
|
||||
{{/allVars}}{{/interfaceModels}}{{/useInheritance}}
|
||||
|
||||
{{#vars}}{{#isEnum}}{{^isContainer}}
|
||||
{{>partial_model_inner_enum}}
|
||||
{{/isContainer}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{^isContainer}}
|
||||
{{>partial_model_inner_enum}}
|
||||
{{/isContainer}}{{/items}}{{/items.isEnum}}{{/vars}}
|
||||
|
||||
export default {{classname}};
|
||||
{{/models}}
|
||||
|
||||
+14
-14
@@ -1,15 +1,15 @@
|
||||
{{#emitJSDoc}}/**
|
||||
* Allowed values for the <code>{{baseName}}</code> property.
|
||||
* @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%>
|
||||
* @readonly
|
||||
*/{{/emitJSDoc}}
|
||||
{{classname}}['{{datatypeWithEnum}}'] = {
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
{{#emitJSDoc}}/**
|
||||
* Allowed values for the <code>{{baseName}}</code> property.
|
||||
* @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%>
|
||||
* @readonly
|
||||
*/{{/emitJSDoc}}
|
||||
static {{datatypeWithEnum}} = {
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
{{#emitJSDoc}}/**
|
||||
* value: {{{value}}}
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
"{{name}}": {{{value}}}{{^-last}},
|
||||
{{/-last}}
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
};
|
||||
* value: {{{value}}}
|
||||
* @const
|
||||
*/{{/emitJSDoc}}
|
||||
"{{name}}": {{{value}}}{{^-last}},
|
||||
{{/-last}}
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
};
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* MultipartFormData.h
|
||||
*
|
||||
* This class represents a container for building a application/x-multipart-formdata requests.
|
||||
* This class represents a container for building application/x-multipart-formdata requests.
|
||||
*/
|
||||
|
||||
#ifndef {{modelHeaderGuardPrefix}}_MultipartFormData_H_
|
||||
+1
-1
@@ -46,7 +46,7 @@ PROJECT_NUMBER = {{#openAPI}}{{#info}}{{version}}{{/info}}{{/openAPI}}
|
||||
|
||||
PROJECT_BRIEF = "An SDK for creating client applications for {{#openAPI}}{{#info}}{{title}}{{/info}}{{/openAPI}} on Tizen Platform (http://tizen.org/)"
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included in
|
||||
# the documentation. The maximum height of the logo should not exceed 55 pixels
|
||||
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
|
||||
# to the output directory.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user