diff --git a/.gitignore b/.gitignore index f82755eaa4..58819fc69d 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,8 @@ samples/client/petstore/silex/SwaggerServer/venodr/ samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/cache/ samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/logs/ +#PHP-laravel +samples/server/petstore/php-laravel/node_modules # Perl samples/client/petstore/perl/deep_module_test/ diff --git a/CI/pom.xml.bash b/CI/pom.xml.bash index 4b5ef7d23a..fea6011599 100644 --- a/CI/pom.xml.bash +++ b/CI/pom.xml.bash @@ -920,7 +920,7 @@ - 2.0.1 + 2.0.2-OpenAPITools.org-1 2.0.1 2.11.1 3.3.0 diff --git a/CI/pom.xml.circleci b/CI/pom.xml.circleci index 921ad9ce33..5b668d0891 100644 --- a/CI/pom.xml.circleci +++ b/CI/pom.xml.circleci @@ -976,7 +976,7 @@ - 2.0.1 + 2.0.2-OpenAPITools.org-1 2.0.1 2.11.1 3.3.0 diff --git a/CI/pom.xml.circleci.java7 b/CI/pom.xml.circleci.java7 index 9d1b57fbe3..b4630eda54 100644 --- a/CI/pom.xml.circleci.java7 +++ b/CI/pom.xml.circleci.java7 @@ -948,7 +948,7 @@ - 2.0.1 + 2.0.2-OpenAPITools.org-1 2.0.1 2.11.1 3.3.0 diff --git a/CI/pom.xml.ios b/CI/pom.xml.ios index 86a96796a4..eaa81180e2 100644 --- a/CI/pom.xml.ios +++ b/CI/pom.xml.ios @@ -928,7 +928,7 @@ - 2.0.1 + 2.0.2-OpenAPITools.org-1 2.0.1 2.11.1 3.3.0 diff --git a/Dockerfile b/Dockerfile index e46f873c12..e53ca77d84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,9 @@ COPY ./LICENSE ${GEN_DIR} COPY ./google_checkstyle.xml ${GEN_DIR} # Modules are copied individually here to allow for caching of docker layers between major.minor versions -# NOTE: openapi-generator-online is not included here +COPY ./modules/openapi-generator-gradle-plugin ${GEN_DIR}/modules/openapi-generator-gradle-plugin COPY ./modules/openapi-generator-maven-plugin ${GEN_DIR}/modules/openapi-generator-maven-plugin +COPY ./modules/openapi-generator-online ${GEN_DIR}/modules/openapi-generator-online COPY ./modules/openapi-generator-cli ${GEN_DIR}/modules/openapi-generator-cli COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator COPY ./pom.xml ${GEN_DIR} diff --git a/README.md b/README.md index 5bcf49e56b..68e703830f 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,20 @@ Once built, `run-in-docker.sh` will act as an executable for openapi-generator-c -g go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` +##### Troubleshooting + +If an error like this occurs, just execute the **mvn clean install -U** command: + +> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project openapi-generator: A type incompatibility occurred while executing org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test: java.lang.ExceptionInInitializerError cannot be cast to java.io.IOException + +```sh +./run-in-docker.sh mvn clean install -U +``` + +> Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project openapi-generator-gradle-plugin-mvn-wrapper: org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.7-bin.zip' + +Right now: no solution for this one :| + #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ```sh @@ -545,6 +559,7 @@ Here is a list of template creators: * Ada: @stcarrez * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk + * C++ (Qt5 QHttpEngine): @etherealjoy * C++ Pistache: @sebymiano * C++ Restbed: @stkrwork * Erlang Server: @galaxie @@ -560,6 +575,7 @@ Here is a list of template creators: * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * Kotlin: @jimschubert + * PHP Laravel: @renepardon * PHP Lumen: @abcsun * PHP Slim: @jfastnacht * PHP Symfony: @ksm2 diff --git a/bin/openapi3/php-laravel-petstore.sh b/bin/openapi3/php-laravel-petstore.sh new file mode 100755 index 0000000000..b6eb2ef177 --- /dev/null +++ b/bin/openapi3/php-laravel-petstore.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +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 + +# Make sure that the working directory is the root dir +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "${SCRIPT_DIR}/../" + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +# Make sure that we are regenerating the sample by removing any existing target directory +TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-laravel" +if [ -d "$TARGET_DIR" ]; then + rm -rf $TARGET_DIR +fi + +executable="$SCRIPT_DIR/../../modules/openapi-generator-cli/target/openapi-generator-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" +ags="generate -t $SCRIPT_DIR/../../modules/openapi-generator/src/main/resources/php-laravel -i $SCRIPT_DIR/../../modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-laravel -o $TARGET_DIR $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-laravel-petstore-server.sh b/bin/php-laravel-petstore-server.sh new file mode 100755 index 0000000000..b0ec642959 --- /dev/null +++ b/bin/php-laravel-petstore-server.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +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/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B 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" +ags="generate -t modules/openapi-generator/src/main/resources/php-laravel -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-laravel -o samples/server/petstore/php-laravel $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/rust-server-petstore.sh b/bin/rust-server-petstore.sh index 06a8c4d020..5d76464ace 100755 --- a/bin/rust-server-petstore.sh +++ b/bin/rust-server-petstore.sh @@ -25,8 +25,10 @@ then mvn -B 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" -ags="generate -t modules/openapi-generator/src/main/resources/rust-server -i modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml -g rust-server -o samples/server/petstore/rust-server -DpackageName=petstore_api --additional-properties hideGenerationTimestamp=true $@" +for spec_path in modules/openapi-generator/src/test/resources/2_0/rust-server/* ; do + export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" + spec=$(basename "$spec_path" | sed 's/.yaml//') + ags="generate -t modules/openapi-generator/src/main/resources/rust-server -i $spec_path -g rust-server -o samples/server/petstore/rust-server/output/$spec -DpackageName=$spec --additional-properties hideGenerationTimestamp=true $@" -java $JAVA_OPTS -jar $executable $ags + java $JAVA_OPTS -jar $executable $ags +done diff --git a/bin/utils/release_version_update_docs.sh b/bin/utils/release_version_update_docs.sh index 709666e68b..0209e837a6 100755 --- a/bin/utils/release_version_update_docs.sh +++ b/bin/utils/release_version_update_docs.sh @@ -36,6 +36,9 @@ echo "IMPORTANT: this script works on Mac only" echo "Release preparation: replacing $FROM with $TO in different files" declare -a files=("modules/openapi-generator-maven-plugin/README.md" + "modules/openapi-generator-maven-plugin/examples/java-client.xml" + "modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" + "modules/openapi-generator-maven-plugin/examples/non-java.xml" "modules/openapi-generator-gradle-plugin/README.adoc" "modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" "modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle" diff --git a/docs/migration-guide.adoc b/docs/migration-guide.adoc index 3745556cc9..c7315c1e8d 100644 --- a/docs/migration-guide.adoc +++ b/docs/migration-guide.adoc @@ -17,6 +17,17 @@ Version `3.2.0` is a minor version of OpenAPI-Generator, in comparison to `3.1.x The default value of some options might change. Projects relying on generated code might need to be adapted. +==== Validate spec on generation by default + +The default is to validate the spec during generation. If the spec has errors, +they will appear as errors or warnings to the user. This prevent generation of the project. + +If you want to switch back to the `3.1.x` behavior you can use: + +* Set the `validateSpec` option to `false` if you are using the Maven or Gradle plugin +* Use the command line option `--skip-validate-spec` if you are using the CLI + + ==== Model (all languages) In `CodegenModel` and in `CodegenOperation` we use now our own class `org.openapitools.codegen.CodegenDiscriminator` instead of `io.swagger.v3.oas.models.media.Discriminator`. diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 475f9cfa66..0c460241fa 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -12,7 +12,7 @@ org.openapitools openapi-generator-maven-plugin - 3.1.1-SNAPSHOT + 3.1.2 @@ -20,7 +20,7 @@ - swagger.yaml + ${project.basedir}/swagger.yaml java @@ -39,13 +39,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + - org.openapitools + io.swagger swagger-annotations ${swagger-annotations-version} @@ -55,13 +64,8 @@ - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson + org.glassfish.jersey.core + jersey-client ${jersey-version} @@ -69,6 +73,11 @@ jersey-media-multipart ${jersey-version} + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + @@ -96,7 +105,7 @@ jackson-jaxrs-json-provider ${jackson-version} - + com.fasterxml.jackson.datatype @@ -107,19 +116,19 @@ joda-time joda-time ${jodatime-version} - + com.brsanthu migbase64 2.2 - + 1.5.8 - 2.22.2 + 2.27 2.8.9 2.7 1.0.0 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index 31da5677d9..f21abd3764 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -12,7 +12,7 @@ org.openapitools openapi-generator-maven-plugin - 3.1.1-SNAPSHOT + 3.1.2 @@ -20,7 +20,7 @@ false - petstore-v3.0-invalid.yaml + ${project.basedir}/petstore-v3.0-invalid.yaml aspnetcore optionalProjectFile=true diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 8592217bdc..4124bd25ef 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -12,14 +12,14 @@ org.openapitools openapi-generator-maven-plugin - 3.1.1-SNAPSHOT + 3.1.2 generate - swagger.yaml + ${project.basedir}/swagger.yaml aspnetcore optionalProjectFile=true diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index a6aeeda2d3..8e72af82bd 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -204,9 +204,9 @@ ${swagger-core-version} - io.swagger.parser.v3 - swagger-parser - ${swagger-parser-version} + org.openapitools.swagger.parser + swagger-parser + ${swagger-parser-version} com.samskivert diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 4be60e75a5..9aa86e7364 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -257,4 +257,8 @@ public class CodegenConstants { public static final String DOCEXTENSION = "docExtension"; public static final String DOCEXTENSION_DESC = "The extension of the generated documentation files, defaults to markdown, .md"; + + public static final String DATABASE_ADAPTER = "databaseAdapter"; + public static final String DATABASE_ADAPTER_DESC = "The adapter for database (e.g. mysql, sqlite). Default: sqlite"; + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a2d631ae69..0747ade522 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4423,7 +4423,11 @@ public class DefaultCodegen implements CodegenConfig { } if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = mostInnerItem.complexType; + if(StringUtils.isEmpty(mostInnerItem.complexType)) { + codegenParameter.baseName = "request_body"; + } else { + codegenParameter.baseName = mostInnerItem.complexType; + } } else { codegenParameter.baseName = bodyParameterName; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 503bf24135..54455f49c8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -95,7 +95,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { /** * Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore, - * or other metadata files used by Swagger Codegen. + * or other metadata files used by OpenAPI Generator. * * @param generateMetadata true: enable outputs, false: disable outputs */ @@ -193,8 +193,14 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { URL url = URLPathUtils.getServerURL(openAPI); contextPath = config.escapeText(url.getPath()); - basePath = config.escapeText(URLPathUtils.getHost(openAPI)); basePathWithoutHost = contextPath; // for backward compatibility + basePath = config.escapeText(URLPathUtils.getHost(openAPI)); + if ("/".equals(basePath.substring(basePath.length() - 1))) { + // remove trailing "/" + // https://host.example.com/ => https://host.example.com + basePath = basePath.substring(0, basePath.length() - 1); + } + } private void configureOpenAPIInfo() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 2e2c7da0b5..e787821cdd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -536,7 +536,7 @@ public class CodegenConfigurator implements Serializable { if (this.isValidateSpec()) { StringBuilder sb = new StringBuilder(); - sb.append("There were issues with the specification. The option can be disabled by passing false to skipValidateSpec (Maven/Gradle) or --skip-validate-spec (CLI)."); + sb.append("There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI)."); sb.append(System.lineSeparator()); SpecValidationException ex = new SpecValidationException(sb.toString()); ex.setErrors(validationMessages); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java new file mode 100644 index 0000000000..cfae5b1a58 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java @@ -0,0 +1,680 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import java.util.*; +import org.apache.commons.lang3.StringUtils; +import com.google.common.base.Strings; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.utils.ModelUtils; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public abstract class AbstractApexCodegen extends DefaultCodegen implements CodegenConfig { + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractApexCodegen.class); + + protected Boolean serializableModel = false; + + public AbstractApexCodegen() { + super(); + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "apex"; + } + + @Override + public String getHelp() { + return "Generates an Apex API client library."; + } + + @Override + public void processOpts() { + super.processOpts(); + } + + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + @Override + public String sanitizeName(String name) { + name = super.sanitizeName(name); + if (name.contains("__")) { // Preventing namespacing + name.replaceAll("__", "_"); + } + if (name.matches("^\\d.*")) { // Prevent named credentials with leading number + name.replaceAll("^\\d.*", ""); + } + return name; + } + + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + if (name.toLowerCase().matches("^_*class$")) { + return "propertyClass"; + } + + if ("_".equals(name)) { + name = "_u"; + } + + // if it's all uppper case, do nothing + if (name.matches("^[A-Z_]*$")) { + if (isReservedWord(name)) { + name = escapeReservedWord(name); + } + return name; + } + + if (startsWithTwoUppercaseLetters(name)) { + name = name.substring(0, 2).toLowerCase() + name.substring(2); + } + + // camelize (lower first character) the variable name + // pet_id => petId + name = camelize(name, true); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + return name; + } + + private boolean startsWithTwoUppercaseLetters(String name) { + boolean startsWithTwoUppercaseLetters = false; + if (name.length() > 1) { + startsWithTwoUppercaseLetters = name.substring(0, 2).equals(name.substring(0, 2).toUpperCase()); + } + return startsWithTwoUppercaseLetters; + } + + @Override + public String toParamName(String name) { + // to avoid conflicts with 'callback' parameter for async call + if ("callback".equals(name)) { + return "paramCallback"; + } + + // should be the same as variable name + return toVarName(name); + } + + @Override + public String toModelName(final String name) { + + final String sanitizedName = sanitizeName(name); + + String nameWithPrefixSuffix = sanitizedName; + if (!StringUtils.isEmpty(modelNamePrefix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + // add '_' so that model name can be camelized correctly + nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix; + } + + // camelize the model name + // phone_number => PhoneNumber + final String camelizedName = camelize(nameWithPrefixSuffix); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(camelizedName)) { + final String modelName = "Model" + camelizedName; + LOGGER.warn(camelizedName + " (reserved word) cannot be used as model name. Renamed to " + modelName); + return modelName; + } + + // model name starts with number + if (camelizedName.matches("^\\d.*")) { + final String modelName = "Model" + camelizedName; // e.g. 200Response => Model200Response (after camelize) + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); + return modelName; + } + + return camelizedName; + } + + @Override + public String toModelFilename(String name) { + // should be the same as the model name + return toModelName(name); + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + if (inner == null) { + LOGGER.warn(ap.getName() + "(array property) does not have a proper inner type defined"); + // TODO maybe better defaulting to StringProperty than returning null + return null; + } + return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = (Schema) p.getAdditionalProperties(); + + if (inner == null) { + LOGGER.warn(p.getName() + "(map property) does not have a proper inner type defined"); + // TODO maybe better defaulting to StringProperty than returning null + return null; + } + return getSchemaType(p) + ""; + } + return super.getTypeDeclaration(p); + } + + @Override + public String getAlias(String name) { + if (typeAliases != null && typeAliases.containsKey(name)) { + return typeAliases.get(name); + } + return name; + } + + @Override + public String toDefaultValue(Schema p) { + if (ModelUtils.isArraySchema(p)) { + final ArraySchema ap = (ArraySchema) p; + final String pattern = "new ArrayList<%s>()"; + if (ap.getItems() == null) { + return null; + } + + return String.format(pattern, getTypeDeclaration(ap.getItems())); + } else if (ModelUtils.isMapSchema(p)) { + final MapSchema ap = (MapSchema) p; + final String pattern = "new HashMap<%s>()"; + if (ap.getAdditionalProperties() == null) { + return null; + } + + return String.format(pattern, String.format("String, %s", getTypeDeclaration((Schema) ap.getAdditionalProperties()))); + } else if (ModelUtils.isLongSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString() + "l"; + } + return "null"; + } else if (ModelUtils.isIntegerSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } + return "null"; + } else if (ModelUtils.isFloatSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString() + "f"; + } + return "null"; + } else if (ModelUtils.isDoubleSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString() + "d"; + } + return "null"; + } else if (ModelUtils.isBooleanSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } + return "null"; + } else if (ModelUtils.isStringSchema(p)) { + if (p.getDefault() != null) { + String _default = (String) p.getDefault(); + if (p.getEnum() == null) { + return "\"" + escapeText(_default) + "\""; + } else { + // convert to enum var name later in postProcessModels + return _default; + } + } + return "null"; + } + return super.toDefaultValue(p); + } + + @Override + public void setParameterExampleValue(CodegenParameter p) { + + if (Boolean.TRUE.equals(p.isLong)) { + p.example = "2147483648L"; + } else if (Boolean.TRUE.equals(p.isFile)) { + p.example = "Blob.valueOf('Sample text file\\nContents')"; + } else if (Boolean.TRUE.equals(p.isDate)) { + p.example = "Date.newInstance(1960, 2, 17)"; + } else if (Boolean.TRUE.equals(p.isDateTime)) { + p.example = "Datetime.newInstanceGmt(2013, 11, 12, 3, 3, 3)"; + } else if (Boolean.TRUE.equals(p.isListContainer)) { + if (p.items != null && p.items.example != null) { + p.example = "new " + p.dataType + "{" + p.items.example + "}"; + } + } else if (Boolean.TRUE.equals(p.isMapContainer)) { + if (p.items != null && p.items.example != null) { + p.example = "new " + p.dataType + "{" + p.items.example + "}"; + } + } else if (Boolean.TRUE.equals(p.isString)) { + p.example = "'" + p.example + "'"; + } else if ("".equals(p.example) || p.example == null && p.dataType != "Object") { + // Get an example object from the generated model + if (!isReservedWord(p.dataType.toLowerCase())) { + p.example = p.dataType + ".getExample()"; + } + } else { + p.example = "''"; + } + + } + + @Override + public String toExampleValue(Schema p) { + if (p == null) { + return ""; + } + + Object obj = p.getExample(); + String example = obj == null ? "" : obj.toString(); + + if (ModelUtils.isArraySchema(p)) { + example = "new " + getTypeDeclaration(p) + "{" + toExampleValue( + ((ArraySchema) p).getItems()) + "}"; + } else if (ModelUtils.isBooleanSchema(p)) { + example = String.valueOf(!"false".equals(example)); + } else if (ModelUtils.isByteArraySchema(p)) { + if (example.isEmpty()) { + example = "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu"; + } + ((ByteArraySchema) p).setExample(example); + example = "EncodingUtil.base64Decode('" + example + "')"; + } else if (ModelUtils.isDateSchema(p)) { + if (example.matches("^\\d{4}(-\\d{2}){2}")) { + example = example.substring(0, 10).replaceAll("-0?", ", "); + } else if (example.isEmpty()) { + example = "2000, 1, 23"; + } else { + LOGGER.warn(String.format("The example provided for property '%s' is not a valid RFC3339 date. Defaulting to '2000-01-23'. [%s]", p + .getName(), example)); + example = "2000, 1, 23"; + } + example = "Date.newInstance(" + example + ")"; + } else if (ModelUtils.isDateTimeSchema(p)) { + if (example.matches("^\\d{4}([-T:]\\d{2}){5}.+")) { + example = example.substring(0, 19).replaceAll("[-T:]0?", ", "); + } else if (example.isEmpty()) { + example = "2000, 1, 23, 4, 56, 7"; + } else { + LOGGER.warn(String.format("The example provided for property '%s' is not a valid RFC3339 datetime. Defaulting to '2000-01-23T04-56-07Z'. [%s]", p + .getName(), example)); + example = "2000, 1, 23, 4, 56, 7"; + } + example = "Datetime.newInstanceGmt(" + example + ")"; + } else if (ModelUtils.isNumberSchema(p)) { + example = example.replaceAll("[^-0-9.]", ""); + example = example.isEmpty() ? "1.3579" : example; + } else if (ModelUtils.isFileSchema(p)) { + if (example.isEmpty()) { + example = "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu"; + p.setExample(example); + } + example = "EncodingUtil.base64Decode(" + example + ")"; + } else if (ModelUtils.isEmailSchema(p)) { + if (example.isEmpty()) { + example = "example@example.com"; + p.setExample(example); + } + example = "'" + example + "'"; + } else if (ModelUtils.isLongSchema(p)) { + example = example.isEmpty() ? "123456789L" : example + "L"; + } else if (ModelUtils.isMapSchema(p)) { + example = "new " + getTypeDeclaration(p) + "{'key'=>" + toExampleValue((Schema) p.getAdditionalProperties()) + "}"; + + } else if (ModelUtils.isPasswordSchema(p)) { + example = example.isEmpty() ? "password123" : escapeText(example); + p.setExample(example); + example = "'" + example + "'"; + } else if (ModelUtils.isStringSchema(p)) { + List enums = p.getEnum(); + if (enums != null && example.isEmpty()) { + example = enums.get(0); + p.setExample(example); + } else if (example.isEmpty()) { + example = ""; + } else { + example = escapeText(example); + p.setExample(example); + } + example = "'" + example + "'"; + } else if (ModelUtils.isUUIDSchema(p)) { + example = example.isEmpty() + ? "'046b6c7f-0b8a-43b9-b35d-6489e6daee91'" + : "'" + escapeText(example) + "'"; + } else if (ModelUtils.isIntegerSchema(p)) { + example = example.matches("^-?\\d+$") ? example : "0"; + } else if (ModelUtils.isObjectSchema(p)) { + example = example.isEmpty() ? "null" : example; + } else { + example = getTypeDeclaration(p) + ".getExample()"; + } + return example; + } + + @Override + public String getSchemaType(Schema p) { + String schemaType = super.getSchemaType(p); + + schemaType = getAlias(schemaType); + + // don't apply renaming on types from the typeMapping + if (typeMapping.containsKey(schemaType)) { + return typeMapping.get(schemaType); + } + + if (null == schemaType) { + LOGGER.error("No Type defined for Property " + p); + } + return toModelName(schemaType); + } + + @Override + public String toOperationId(String operationId) { + // throw exception if method name is empty + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method/operation name (operationId) not allowed"); + } + + operationId = camelize(sanitizeName(operationId), true); + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + String newOperationId = camelize("call_" + operationId, true); + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId); + return newOperationId; + } + + return operationId; + } + + @Override + public CodegenModel fromModel(String name, Schema model, Map allDefinitions) { + CodegenModel cm = super.fromModel(name, model, allDefinitions); + + // TODO Check enum model handling + if (cm.interfaces == null) { + cm.interfaces = new ArrayList(); + } + + Boolean hasDefaultValues = false; + + // for (de)serializing properties renamed for Apex (e.g. reserved words) + List> propertyMappings = new ArrayList<>(); + for (CodegenProperty p : cm.allVars) { + hasDefaultValues |= p.defaultValue != null; + if (!p.baseName.equals(p.name)) { + Map mapping = new HashMap<>(); + mapping.put("externalName", p.baseName); + mapping.put("internalName", p.name); + propertyMappings.add(mapping); + } + } + + cm.vendorExtensions.put("hasPropertyMappings", !propertyMappings.isEmpty()); + cm.vendorExtensions.put("hasDefaultValues", hasDefaultValues); + cm.vendorExtensions.put("propertyMappings", propertyMappings); + + if (!propertyMappings.isEmpty()) { + cm.interfaces.add("OAS.MappedProperties"); + } + return cm; + } + + @Override + public void postProcessParameter(CodegenParameter parameter) { + if (parameter.isBodyParam && parameter.isListContainer) { + // items of array bodyParams are being nested an extra level too deep for some reason + parameter.items = parameter.items.items; + setParameterExampleValue(parameter); + } + } + + @Override + public Map postProcessModels(Map objs) { + return postProcessModelsEnum(objs); + } + + /* the following function is not used anywhere in this class so we'll remove it later + private static String getAccept(Operation operation) { + String accepts = null; + String defaultContentType = "application/json"; + if (operation.getProduces() != null && !operation.getProduces().isEmpty()) { + StringBuilder sb = new StringBuilder(); + for (String produces : operation.getProduces()) { + if (defaultContentType.equalsIgnoreCase(produces)) { + accepts = defaultContentType; + break; + } else { + if (sb.length() > 0) { + sb.append(","); + } + sb.append(produces); + } + } + if (accepts == null) { + accepts = sb.toString(); + } + } else { + accepts = defaultContentType; + } + + return accepts; + }*/ + + @Override + protected boolean needToImport(String type) { + return super.needToImport(type) && type.indexOf(".") < 0; + } + + @Override + public String toEnumName(CodegenProperty property) { + return sanitizeName(camelize(property.name)) + "Enum"; + } + + @Override + public String toEnumVarName(String value, String datatype) { + if (value.length() == 0) { + return "EMPTY"; + } + + // for symbol, e.g. $, # + if (getSymbolName(value) != null) { + return getSymbolName(value).toUpperCase(); + } + + // number + if ("Integer".equals(datatype) || "Long".equals(datatype) || + "Float".equals(datatype) || "Double".equals(datatype)) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // string + String var = value.replaceAll("\\W+", "_").toUpperCase(); + if (var.matches("\\d.*")) { + return "_" + var; + } else { + return var; + } + } + + @Override + public String toEnumValue(String value, String datatype) { + if ("Integer".equals(datatype) || "Double".equals(datatype)) { + return value; + } else if ("Long".equals(datatype)) { + // add l to number, e.g. 2048 => 2048l + return value + "l"; + } else if ("Float".equals(datatype)) { + // add f to number, e.g. 3.14 => 3.14f + return value + "f"; + } else { + return "\"" + escapeText(value) + "\""; + } + } + + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, OpenAPI openAPI) { + + CodegenOperation op = super.fromOperation( + path, httpMethod, operation, definitions, openAPI); + + if (op.getHasExamples()) { + // prepare examples for Apex test classes + ApiResponse apiResponse = findMethodResponse(operation.getResponses()); + final Schema responseSchema = ModelUtils.getSchemaFromResponse(apiResponse); + String deserializedExample = toExampleValue(responseSchema); + for (Map example : op.examples) { + example.put("example", escapeText(example.get("example"))); + example.put("deserializedExample", deserializedExample); + } + } + + return op; + } + + private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { + // This generator uses inline classes to define enums, which breaks when + // dealing with models that have subTypes. To clean this up, we will analyze + // the parent and child models, look for enums that match, and remove + // them from the child models and leave them in the parent. + // Because the child models extend the parents, the enums will be available via the parent. + + // Only bother with reconciliation if the parent model has enums. + if (!parentCodegenModel.hasEnums) { + return codegenModel; + } + + // Get the properties for the parent and child models + final List parentModelCodegenProperties = parentCodegenModel.vars; + List codegenProperties = codegenModel.vars; + + // Iterate over all of the parent model properties + boolean removedChildEnum = false; + for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) { + // Look for enums + if (parentModelCodegenPropery.isEnum) { + // Now that we have found an enum in the parent class, + // and search the child class for the same enum. + Iterator iterator = codegenProperties.iterator(); + while (iterator.hasNext()) { + CodegenProperty codegenProperty = iterator.next(); + if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) { + // We found an enum in the child class that is + // a duplicate of the one in the parent, so remove it. + iterator.remove(); + removedChildEnum = true; + } + } + } + } + + if (removedChildEnum) { + // If we removed an entry from this model's vars, we need to ensure hasMore is updated + int count = 0, numVars = codegenProperties.size(); + for (CodegenProperty codegenProperty : codegenProperties) { + count += 1; + codegenProperty.hasMore = (count < numVars) ? true : false; + } + codegenModel.vars = codegenProperties; + } + return codegenModel; + } + + private static String sanitizePackageName(String packageName) { + packageName = packageName.trim(); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + packageName = packageName.replaceAll("[^a-zA-Z0-9_\\.]", "_"); + if (Strings.isNullOrEmpty(packageName)) { + return "invalidPackageName"; + } + return packageName; + } + + + public void setSerializableModel(Boolean serializableModel) { + this.serializableModel = serializableModel; + } + + private String sanitizePath(String p) { + //prefer replace a ", instead of a fuLL URL encode for readability + return p.replaceAll("\"", "%22"); + } + + public String toRegularExpression(String pattern) { + return escapeText(pattern); + } + + public boolean convertPropertyToBoolean(String propertyKey) { + boolean booleanValue = false; + if (additionalProperties.containsKey(propertyKey)) { + booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString()); + } + + return booleanValue; + } + + public void writePropertyBack(String propertyKey, boolean value) { + additionalProperties.put(propertyKey, value); + } + + @Override + public String sanitizeTag(String tag) { + return camelize(sanitizeName(tag)); + } + + @Override + public String toModelTestFilename(String name) { + return toModelName(name) + "Test"; + } + +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index e92ad679d9..c56f2c9423 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -603,6 +603,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co operationId = "call_" + operationId; } + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + return camelize(sanitizeName(operationId)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index ccc28aed87..814d8e12bf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -128,6 +128,38 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg ); } + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public String toApiName(String type) { + return sanitizeName(modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"); + } + + @Override + public String toModelName(String type) { + if (type == null) { + LOGGER.warn("Model name can't be null. Default to 'UnknownModel'."); + type = "UnknownModel"; + } + + if (typeMapping.keySet().contains(type) || typeMapping.values().contains(type) + || importMapping.values().contains(type) || defaultIncludes.contains(type) + || languageSpecificPrimitives.contains(type)) { + return type; + } else { + return sanitizeName(modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1)); + } + } + @Override public String toVarName(String name) { if (typeMapping.keySet().contains(name) || typeMapping.values().contains(name) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index a710c6c852..2db13c3af6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -145,7 +145,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege @Override public String toVarName(String name) { - + // replace - with _ e.g. created-at => created_at name = sanitizeName(name); @@ -267,10 +267,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege // the type. String openAPIType = getSchemaType(p); String ref = p.get$ref(); - if(ref != null && !ref.isEmpty()) { + if (ref != null && !ref.isEmpty()) { String tryRefV2 = "#/definitions/" + openAPIType; String tryRefV3 = "#/components/schemas/" + openAPIType; - if(ref.equals(tryRefV2) || ref.equals(tryRefV3)) { + if (ref.equals(tryRefV2) || ref.equals(tryRefV3)) { return toModelName(openAPIType); } } @@ -296,7 +296,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege String ref = p.get$ref(); String type = null; - if(ref != null && !ref.isEmpty()) { + if (ref != null && !ref.isEmpty()) { type = openAPIType; } else if (typeMapping.containsKey(openAPIType)) { type = typeMapping.get(openAPIType); @@ -314,7 +314,13 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege // method name cannot use reserved keyword, e.g. return if (isReservedWord(sanitizedOperationId)) { LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " - + camelize("call_" + operationId)); + + camelize("call_" + sanitizedOperationId)); + sanitizedOperationId = "call_" + sanitizedOperationId; + } + + // operationId starts with a number + if (sanitizedOperationId.matches("^\\d.*")) { + LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize("call_" + sanitizedOperationId)); sanitizedOperationId = "call_" + sanitizedOperationId; } @@ -564,8 +570,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege enumName = enumName.replaceFirst("^_", ""); enumName = enumName.replaceFirst("_$", ""); - if (isReservedWord(enumName) || enumName.matches("\\d.*")) { // reserved word or starts with number + if (isReservedWord(enumName)) { // reserved word return escapeReservedWord(enumName); + } else if (enumName.matches("\\d.*")) { // starts with a number + return "_" + enumName; } else { return enumName; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 557f238a0f..ea1b16fbfb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -884,6 +884,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code return newOperationId; } + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), true); + operationId = camelize("call_" + operationId, true); + } + return operationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 850b3205f2..5a02de7202 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -18,7 +18,6 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.NumberSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import org.apache.commons.lang3.StringUtils; @@ -157,7 +156,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @Override public String toVarName(String name) { // sanitize name - name = sanitizeName(name); + name = sanitizeName(name, "\\W-[\\$]"); if ("_".equals(name)) { name = "_u"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java index d1242c9583..8af857cc28 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java @@ -17,65 +17,43 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.BooleanSchema; -import io.swagger.v3.oas.models.media.ByteArraySchema; -import io.swagger.v3.oas.models.media.EmailSchema; -import io.swagger.v3.oas.models.media.FileSchema; -import io.swagger.v3.oas.models.media.PasswordSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.responses.ApiResponse; - -import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.utils.ModelUtils; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.info.*; +import io.swagger.v3.oas.models.OpenAPI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; +import java.util.*; -public class ApexClientCodegen extends AbstractJavaCodegen { +public class ApexClientCodegen extends AbstractApexCodegen { private static final String CLASS_PREFIX = "classPrefix"; private static final String API_VERSION = "apiVersion"; private static final String BUILD_METHOD = "buildMethod"; private static final String NAMED_CREDENTIAL = "namedCredential"; private static final Logger LOGGER = LoggerFactory.getLogger(ApexClientCodegen.class); - private String classPrefix = "Swag"; - private String apiVersion = "39.0"; + private String classPrefix = "OAS"; + private String apiVersion = "42.0"; private String buildMethod = "sfdx"; private String namedCredential = classPrefix; private String srcPath = "force-app/main/default/"; + private String sfdxConfigPath = "config/"; + private HashMap primitiveDefaults = new HashMap(); public ApexClientCodegen() { super(); importMapping.clear(); - testFolder = sourceFolder = srcPath; - embeddedTemplateDir = templateDir = "apex"; outputFolder = "generated-code" + File.separator + "apex"; - apiPackage = "classes"; - modelPackage = "classes"; + modelPackage = apiPackage = srcPath + "classes"; testPackage = "force-app.main.default.classes"; modelNamePrefix = classPrefix; - dateLibrary = ""; apiTemplateFiles.put("api.mustache", ".cls"); apiTemplateFiles.put("cls-meta.mustache", ".cls-meta.xml"); @@ -91,12 +69,12 @@ public class ApexClientCodegen extends AbstractJavaCodegen { cliOptions.add(CliOption.newString(BUILD_METHOD, "The build method for this package.")); cliOptions.add(CliOption.newString(NAMED_CREDENTIAL, "The named credential name for the HTTP callouts")); - supportingFiles.add(new SupportingFile("Swagger.cls", srcPath + "classes", "Swagger.cls")); - supportingFiles.add(new SupportingFile("cls-meta.mustache", srcPath + "classes", "Swagger.cls-meta.xml")); - supportingFiles.add(new SupportingFile("SwaggerTest.cls", srcPath + "classes", "SwaggerTest.cls")); - supportingFiles.add(new SupportingFile("cls-meta.mustache", srcPath + "classes", "SwaggerTest.cls-meta.xml")); - supportingFiles.add(new SupportingFile("SwaggerResponseMock.cls", srcPath + "classes", "SwaggerResponseMock.cls")); - supportingFiles.add(new SupportingFile("cls-meta.mustache", srcPath + "classes", "SwaggerResponseMock.cls-meta.xml")); + supportingFiles.add(new SupportingFile("OAS.cls", srcPath + "classes", "OAS.cls")); + supportingFiles.add(new SupportingFile("cls-meta.mustache", srcPath + "classes", "OAS.cls-meta.xml")); + supportingFiles.add(new SupportingFile("OASTest.cls", srcPath + "classes", "OASTest.cls")); + supportingFiles.add(new SupportingFile("cls-meta.mustache", srcPath + "classes", "OASTest.cls-meta.xml")); + supportingFiles.add(new SupportingFile("OASResponseMock.cls", srcPath + "classes", "OASResponseMock.cls")); + supportingFiles.add(new SupportingFile("cls-meta.mustache", srcPath + "classes", "OASResponseMock.cls-meta.xml")); typeMapping.put("BigDecimal", "Double"); typeMapping.put("binary", "String"); @@ -109,14 +87,15 @@ public class ApexClientCodegen extends AbstractJavaCodegen { typeMapping.put("short", "Integer"); typeMapping.put("UUID", "String"); + // https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reserved_words.htm setReservedWordsLowerCase( Arrays.asList("abstract", "activate", "and", "any", "array", "as", "asc", "autonomous", "begin", "bigdecimal", "blob", "break", "bulk", "by", "byte", "case", "cast", "catch", "char", "class", "collect", "commit", "const", "continue", - "convertcurrency", "date", "decimal", "default", "delete", "desc", "do", "else", + "convertcurrency", "currency", "date", "datetime", "decimal", "default", "delete", "desc", "do", "else", "end", "enum", "exception", "exit", "export", "extends", "false", "final", "finally", "float", "for", "from", "future", "global", "goto", "group", "having", - "hint", "if", "implements", "import", "inner", "insert", "instanceof", "int", + "hint", "if", "implements", "import", "in", "inner", "insert", "instanceof", "int", "interface", "into", "join", "last_90_days", "last_month", "last_n_days", "last_week", "like", "limit", "list", "long", "loop", "map", "merge", "new", "next_90_days", "next_month", "next_n_days", "next_week", "not", "null", "nulls", @@ -124,7 +103,7 @@ public class ApexClientCodegen extends AbstractJavaCodegen { "pragma", "private", "protected", "public", "retrieve", "return", "returning", "rollback", "savepoint", "search", "select", "set", "short", "sort", "stat", "static", "super", "switch", "synchronized", "system", "testmethod", "then", "this", - "this_month", "this_week", "throw", "today", "tolabel", "tomorrow", "transaction", + "this_month", "this_week", "throw", "time", "today", "tolabel", "tomorrow", "transaction", "trigger", "true", "try", "type", "undelete", "update", "upsert", "using", "virtual", "webservice", "when", "where", "while", "yesterday" )); @@ -133,6 +112,17 @@ public class ApexClientCodegen extends AbstractJavaCodegen { Arrays.asList("Blob", "Boolean", "Date", "Datetime", "Decimal", "Double", "ID", "Integer", "Long", "Object", "String", "Time" )); + + primitiveDefaults.put("Boolean", true); + primitiveDefaults.put("Decimal", 1); + primitiveDefaults.put("Double", 1); + primitiveDefaults.put("Integer", 1); + primitiveDefaults.put("Long", 1); + primitiveDefaults.put("String", ""); + + instantiationTypes.put("array", "List"); + instantiationTypes.put("map", "Map"); + } @Override @@ -162,6 +152,48 @@ public class ApexClientCodegen extends AbstractJavaCodegen { postProcessOpts(); } + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + Info info = openAPI.getInfo(); + String calloutLabel = info.getTitle(); + additionalProperties.put("calloutLabel", calloutLabel); + String sanitized = sanitizeName(calloutLabel); + additionalProperties.put("calloutName", sanitized); + supportingFiles.add(new SupportingFile("namedCredential.mustache", srcPath + "/namedCredentials", + sanitized + ".namedCredential-meta.xml" + )); + + if (additionalProperties.get(BUILD_METHOD).equals("sfdx")) { + generateSfdxSupportingFiles(); + } else if (additionalProperties.get(BUILD_METHOD).equals("ant")) { + generateAntSupportingFiles(); + } + } + + @Override + public String escapeQuotationMark(String input) { + return input.replace("'", "\\'"); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public String escapeText(String input) { + if (input == null) { + return input; + } + + return input.replace("'", "\\'").replace("\n", "\\n").replace("\r", "\\r").replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public String toApiName(String name) { + return camelize(classPrefix + super.toApiName(name)); + } + @Override public String escapeReservedWord(String name) { // Identifiers must start with a letter @@ -191,16 +223,19 @@ public class ApexClientCodegen extends AbstractJavaCodegen { } else if (ModelUtils.isBooleanSchema(p)) { // true => "true", false => "false", null => "null" out = String.valueOf(((BooleanSchema) p).getDefault()); - } else if (ModelUtils.isLongSchema(p)) { // long - out = p.getDefault() == null ? out : p.getDefault().toString() + "L"; + } else if (ModelUtils.isLongSchema(p)) { + Long def = (Long) p.getDefault(); + out = def == null ? out : def.toString() + "L"; } else if (ModelUtils.isMapSchema(p)) { Schema inner = (Schema) p.getAdditionalProperties(); String s = inner == null ? "Object" : getTypeDeclaration(inner); out = String.format("new Map()", s); } else if (ModelUtils.isStringSchema(p)) { - String def = (String) p.getDefault(); - if (def != null) { - out = p.getEnum() == null ? String.format("'%s'", escapeText(def)) : def; + if (p.getDefault() != null) { + String def = p.getDefault().toString(); + if (def != null) { + out = p.getEnum() == null ? String.format("'%s'", escapeText(def)) : def; + } } } else { out = super.toDefaultValue(p); @@ -210,256 +245,10 @@ public class ApexClientCodegen extends AbstractJavaCodegen { return "null".equals(out) ? null : out; } - @Override - public void setParameterExampleValue(CodegenParameter p) { - String example; - - if (p.defaultValue == null) { - example = p.example; - } else { - example = p.defaultValue; - } - - String type = p.baseType; - if (type == null) { - type = p.dataType; - } - - if (Boolean.TRUE.equals(p.isInteger)) { - if (example == null) { - example = "56"; - } - } else if (Boolean.TRUE.equals(p.isLong)) { - if (example == null) { - example = "2147483648L"; - } - } else if (Boolean.TRUE.equals(p.isDouble) - || Boolean.TRUE.equals(p.isFloat) - || Boolean.TRUE.equals(p.isNumber)) { - if (example == null) { - example = "3.4"; - } - } else if (Boolean.TRUE.equals(p.isBoolean)) { - if (Boolean.parseBoolean(p.example)) { - p.example = "1"; - } else { - p.example = "0"; - } - } else if (Boolean.TRUE.equals(p.isFile) || Boolean.TRUE.equals(p.isBinary)) { - example = "Blob.valueOf('Sample text file\\nContents')"; - } else if (Boolean.TRUE.equals(p.isByteArray)) { - if (example == null) { - example = "YmFzZSA2NCBkYXRh"; - } - example = "\"" + escapeText(example) + "\""; - } else if (Boolean.TRUE.equals(p.isDate)) { - if (example == null) { - example = "1960, 2, 17"; - } - example = "Date.newInstance(" + escapeText(p.example) + ")"; - } else if (Boolean.TRUE.equals(p.isDateTime)) { - if (example == null) { - example = "2013, 11, 12, 3, 3, 3"; - } - example = "Datetime.newInstanceGmt(" + escapeText(p.example) + ")"; - } else if (Boolean.TRUE.equals(p.isString)) { - if (example == null) { - example = p.paramName + "_example"; - } - example = "\'" + escapeText(example) + "\'"; - - } else if (!languageSpecificPrimitives.contains(type)) { - // type is a model class, e.g. User - example = type + ".getExample()"; - } - - // container - if (Boolean.TRUE.equals(p.isListContainer)) { - example = setPropertyExampleValue(p.items); - example = "new " + p.dataType + "{" + example + "}"; - } else if (Boolean.TRUE.equals(p.isMapContainer)) { - example = setPropertyExampleValue(p.items); - example = "new " + p.dataType + "{" + example + "}"; - } else if (example == null) { - example = "null"; - } - - p.example = example; - } - - protected String setPropertyExampleValue(CodegenProperty p) { - String example; - - if (p == null) { - return "null"; - } - - if (p.defaultValue == null) { - example = p.example; - } else { - example = p.defaultValue; - } - - String type = p.baseType; - if (type == null) { - type = p.dataType; - } - - if (Boolean.TRUE.equals(p.isInteger)) { - if (example == null) { - example = "56"; - } - } else if (Boolean.TRUE.equals(p.isLong)) { - if (example == null) { - example = "2147483648L"; - } - } else if (Boolean.TRUE.equals(p.isDouble) - || Boolean.TRUE.equals(p.isFloat) - || Boolean.TRUE.equals(p.isNumber)) { - if (example == null) { - example = "3.4"; - } - } else if (Boolean.TRUE.equals(p.isBoolean)) { - if (example == null) { - example = "true"; - } - } else if (Boolean.TRUE.equals(p.isFile) || Boolean.TRUE.equals(p.isBinary)) { - if (example == null) { - example = "Blob.valueOf('Sample text file\\nContents')"; - } - example = escapeText(example); - } else if (Boolean.TRUE.equals(p.isDate)) { - if (example == null) { - example = "1960, 2, 17"; - } - example = "Date.newInstance(" + escapeText(p.example) + ")"; - } else if (Boolean.TRUE.equals(p.isDateTime)) { - if (example == null) { - example = "2013, 11, 12, 3, 3, 3"; - } - example = "Datetime.newInstanceGmt(" + escapeText(p.example) + ")"; - } else if (Boolean.TRUE.equals(p.isString)) { - if (example == null) { - example = p.name + "_example"; - } - example = "\'" + escapeText(example) + "\'"; - - } else if (!languageSpecificPrimitives.contains(type)) { - // type is a model class, e.g. User - example = type + ".getExample()"; - } - - return example; - } - - @Override - public CodegenModel fromModel(String name, Schema model, Map allDefinitions) { - CodegenModel cm = super.fromModel(name, model, allDefinitions); - if (cm.interfaces == null) { - cm.interfaces = new ArrayList(); - } - - Boolean hasDefaultValues = false; - - // for (de)serializing properties renamed for Apex (e.g. reserved words) - List> propertyMappings = new ArrayList<>(); - for (CodegenProperty p : cm.allVars) { - hasDefaultValues |= p.defaultValue != null; - if (!p.baseName.equals(p.name)) { - Map mapping = new HashMap<>(); - mapping.put("externalName", p.baseName); - mapping.put("internalName", p.name); - propertyMappings.add(mapping); - } - } - - cm.vendorExtensions.put("hasPropertyMappings", !propertyMappings.isEmpty()); - cm.vendorExtensions.put("hasDefaultValues", hasDefaultValues); - cm.vendorExtensions.put("propertyMappings", propertyMappings); - - if (!propertyMappings.isEmpty()) { - cm.interfaces.add("Swagger.MappedProperties"); - } - return cm; - } - - /* the following workaround is no longer needed - @Override - public void postProcessParameter(CodegenParameter parameter) { - if (parameter.isBodyParam && parameter.isListContainer) { - // items of array bodyParams are being nested an extra level too deep for some reason - parameter.items = parameter.items.items; - setParameterExampleValue(parameter); - } - } - */ - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - Info info = openAPI.getInfo(); - String calloutLabel = info.getTitle(); - additionalProperties.put("calloutLabel", calloutLabel); - String sanitized = sanitizeName(calloutLabel); - additionalProperties.put("calloutName", sanitized); - supportingFiles.add(new SupportingFile("namedCredential.mustache", srcPath + "/namedCredentials", - sanitized + ".namedCredential" - )); - - if (additionalProperties.get(BUILD_METHOD).equals("sfdx")) { - generateSfdxSupportingFiles(); - } else if (additionalProperties.get(BUILD_METHOD).equals("ant")) { - generateAntSupportingFiles(); - } - - } - - @Override - public CodegenOperation fromOperation(String path, - String httpMethod, - Operation operation, - Map definitions, - OpenAPI openAPI) { - Boolean hasFormParams = false; - // comment out the following as there's no consume/produce in OAS3.0 - // we can move the logic below to postProcessOperations if needed - /* - // only support serialization into JSON and urlencoded forms for now - operation.setConsumes( - Collections.singletonList(hasFormParameter(operation) - ? "application/x-www-form-urlencoded" - : "application/json")); - - // only support deserialization from JSON for now - operation.setProduces(Collections.singletonList("application/json")); - */ - - CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, openAPI); - - if (op.getHasExamples()) { - // prepare examples for Apex test classes - ApiResponse responseProperty = findMethodResponse(operation.getResponses()); - String deserializedExample = toExampleValue(ModelUtils.getSchemaFromResponse(responseProperty)); - for (Map example : op.examples) { - example.put("example", escapeText(example.get("example"))); - example.put("deserializedExample", deserializedExample); - } - } - - return op; - } - - @Override - public String escapeQuotationMark(String input) { - return input.replace("'", "\\'"); - } - public void setBuildMethod(String buildMethod) { if (buildMethod.equals("ant")) { this.srcPath = "deploy/"; - } else { - this.srcPath = "src/"; } - testFolder = sourceFolder = srcPath; this.buildMethod = buildMethod; } @@ -494,114 +283,6 @@ public class ApexClientCodegen extends AbstractJavaCodegen { )); } - @Override - public String escapeText(String input) { - if (input == null) { - return input; - } - - return input.replace("'", "\\'").replace("\n", "\\n").replace("\r", "\\r"); - } - - @Override - public String toModelTestFilename(String name) { - return toModelName(name) + "Test"; - } - - @Override - public String toExampleValue(Schema p) { - if (p == null) { - return ""; - } - Object obj = p.getExample(); - String example = obj == null ? "" : obj.toString(); - if (ModelUtils.isArraySchema(p)) { // array - example = "new " + getTypeDeclaration(p) + "{" + toExampleValue( - ((ArraySchema) p).getItems()) + "}"; - } else if (ModelUtils.isBooleanSchema(p)) { - example = String.valueOf(!"false".equals(example)); - } else if (ModelUtils.isByteArraySchema(p)) { // byte array - if (example.isEmpty()) { - example = "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu"; - } - ((ByteArraySchema) p).setExample(example); - example = "EncodingUtil.base64Decode('" + example + "')"; - } else if (ModelUtils.isDateSchema(p)) { // date - if (example.matches("^\\d{4}(-\\d{2}){2}")) { - example = example.substring(0, 10).replaceAll("-0?", ", "); - } else if (example.isEmpty()) { - example = "2000, 1, 23"; - } else { - LOGGER.warn(String.format("The example provided for property '%s' is not a valid RFC3339 date. Defaulting to '2000-01-23'. [%s]", p - .getName(), example)); - example = "2000, 1, 23"; - } - example = "Date.newInstance(" + example + ")"; - } else if (ModelUtils.isDateTimeSchema(p)) { // datetime - if (example.matches("^\\d{4}([-T:]\\d{2}){5}.+")) { - example = example.substring(0, 19).replaceAll("[-T:]0?", ", "); - } else if (example.isEmpty()) { - example = "2000, 1, 23, 4, 56, 7"; - } else { - LOGGER.warn(String.format("The example provided for property '%s' is not a valid RFC3339 datetime. Defaulting to '2000-01-23T04-56-07Z'. [%s]", p - .getName(), example)); - example = "2000, 1, 23, 4, 56, 7"; - } - example = "Datetime.newInstanceGmt(" + example + ")"; - } else if (ModelUtils.isNumberSchema(p)) { // number - example = example.replaceAll("[^-0-9.]", ""); - example = example.isEmpty() ? "1.3579" : example; - } else if (ModelUtils.isFileSchema(p)) { // file - if (example.isEmpty()) { - example = "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu"; - ((FileSchema) p).setExample(example); - } - example = "EncodingUtil.base64Decode(" + example + ")"; - } else if (ModelUtils.isEmailSchema(p)) { // email - if (example.isEmpty()) { - example = "example@example.com"; - ((EmailSchema) p).setExample(example); - } - example = "'" + example + "'"; - } else if (ModelUtils.isLongSchema(p)) { // long - example = example.isEmpty() ? "123456789L" : example + "L"; - } else if (ModelUtils.isMapSchema(p)) { // map - example = "new " + getTypeDeclaration(p) + "{'key'=>" + toExampleValue( - (Schema) p.getAdditionalProperties()) + "}"; - } else if (ModelUtils.isObjectSchema(p)) { // object - example = example.isEmpty() ? "null" : example; - } else if (ModelUtils.isPasswordSchema(p)) { // password - example = example.isEmpty() ? "password123" : escapeText(example); - ((PasswordSchema) p).setExample(example); - example = "'" + example + "'"; - } else if (!StringUtils.isEmpty(p.get$ref())) { - example = getTypeDeclaration(p) + ".getExample()"; - } else if (ModelUtils.isUUIDSchema(p)) { - example = example.isEmpty() - ? "'046b6c7f-0b8a-43b9-b35d-6489e6daee91'" - : "'" + escapeText(example) + "'"; - } else if (ModelUtils.isStringSchema(p)) { // string - List enums = p.getEnum(); - if (enums != null && example.isEmpty()) { - example = enums.get(0); - p.setExample(example); - } else if (example.isEmpty()) { - example = "aeiou"; - } else { - example = escapeText(example); - p.setExample(example); - } - example = "'" + example + "'"; - } - - return example; - } - - @Override - public String toApiName(String name) { - return camelize(classPrefix + super.toApiName(name)); - } - @Override public void updateCodegenPropertyEnum(CodegenProperty var) { super.updateCodegenPropertyEnum(var); @@ -612,21 +293,6 @@ public class ApexClientCodegen extends AbstractJavaCodegen { } } - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "apex"; - } - - @Override - public String getHelp() { - return "Generates an Apex API client library (beta)."; - } - private void generateAntSupportingFiles() { supportingFiles.add(new SupportingFile("package.mustache", "deploy", "package.xml")); @@ -638,11 +304,17 @@ public class ApexClientCodegen extends AbstractJavaCodegen { supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); writeOptional(outputFolder, new SupportingFile("README_ant.mustache", "README.md")); + } private void generateSfdxSupportingFiles() { - supportingFiles.add(new SupportingFile("sfdx.mustache", "", "sfdx-oss-manifest.json")); + + supportingFiles.add(new SupportingFile("sfdx-project-scratch-def.json", sfdxConfigPath, "project-scratch-def.json")); + supportingFiles.add(new SupportingFile("sfdx-project.json.mustache", "sfdx-project.json")); + writeOptional(outputFolder, new SupportingFile("README_sfdx.mustache", "README.md")); + } + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index a2a7ef0cab..a1ac3bf86a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -129,18 +129,6 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { } } - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle - * escaping those terms here. This logic is only called if a variable - * matches the reserved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - return "_" + name; // add an underscore to the name - } - @Override public String toModelImport(String name) { if (importMapping.containsKey(name)) { @@ -392,33 +380,6 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { return toModelName(type); } - @Override - public String toModelName(String type) { - if (typeMapping.keySet().contains(type) || typeMapping.values().contains(type) - || importMapping.values().contains(type) || defaultIncludes.contains(type) - || languageSpecificPrimitives.contains(type)) { - return type; - } else { - return Character.toUpperCase(type.charAt(0)) + type.substring(1); - } - } - - @Override - public String toApiName(String type) { - return Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - @Override public String getTypeDeclaration(String str) { return toModelName(str); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java index f57667f5be..bb06b36b1a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java @@ -251,20 +251,6 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo return "#include \"" + folder + toModelName(name) + ".h\""; } - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping - * those terms here. This logic is only called if a variable matches the reserved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - /** * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated @@ -378,25 +364,6 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo return toModelName(type); } - @Override - public String toModelName(String type) { - if (type == null) { - LOGGER.warn("Model name can't be null. Default to 'UnknownModel'."); - type = "UnknownModel"; - } - - if (typeMapping.keySet().contains(type) || - typeMapping.values().contains(type) || - importMapping.values().contains(type) || - defaultIncludes.contains(type) || - languageSpecificPrimitives.contains(type)) { - return type; - } else { - String typeName = sanitizeName(type); - return modelNamePrefix + Character.toUpperCase(typeName.charAt(0)) + typeName.substring(1); - } - } - @Override public String toVarName(String name) { // sanitize name @@ -424,22 +391,6 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo return toVarName(name); } - @Override - public String toApiName(String type) { - return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - public void setOptionalProjectFileFlag(boolean flag) { this.optionalProjectFileFlag = flag; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java index ace3b24b9b..9ca30263bf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Set; public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implements CodegenConfig { + @SuppressWarnings("unused") private static final Logger LOGGER = LoggerFactory.getLogger(CppQt5QHttpEngineServerCodegen.class); public static final String CPP_NAMESPACE = "cppNamespace"; @@ -234,7 +235,7 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement } /** - * Returns human-friendly help for the generator. Provide the consumer with help + * Returns human-friendly help for the generator. Provide the consumer with help * tips, parameters here * * @return A string value for the help message @@ -262,21 +263,7 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement return "#include \"" + folder + name + ".h\""; } - - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping - * those terms here. This logic is only called if a variable matches the reserved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - + /** * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated @@ -327,6 +314,7 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement * @return a string value used as the `dataType` field for model templates, `returnType` for api templates */ @Override + @SuppressWarnings("rawtypes") public String getTypeDeclaration(Schema p) { String openAPIType = getSchemaType(p); @@ -352,6 +340,7 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement } @Override + @SuppressWarnings("rawtypes") public String toDefaultValue(Schema p) { if (ModelUtils.isBooleanSchema(p)) { return "false"; @@ -391,6 +380,7 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement * @return a string value of the type or complex model for this property */ @Override + @SuppressWarnings("rawtypes") public String getSchemaType(Schema p) { String openAPIType = super.getSchemaType(p); @@ -409,24 +399,6 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement return toModelName(type); } - @Override - public String toModelName(String type) { - if (type == null) { - LOGGER.warn("Model name can't be null. Defaul to 'UnknownModel'."); - type = "UnknownModel"; - } - - if (typeMapping.keySet().contains(type) || - typeMapping.values().contains(type) || - importMapping.values().contains(type) || - defaultIncludes.contains(type) || - languageSpecificPrimitives.contains(type)) { - return type; - } else { - return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1); - } - } - @Override public String toVarName(String name) { // sanitize name @@ -455,22 +427,6 @@ public class CppQt5QHttpEngineServerCodegen extends AbstractCppCodegen implement return toVarName(name); } - @Override - public String toApiName(String type) { - return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - @Override public String getTypeDeclaration(String str) { return str; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index 0d2a6c047f..e631fed989 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -157,7 +157,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { typeMapping.put("binary", "std::string"); typeMapping.put("number", "double"); typeMapping.put("UUID", "utility::string_t"); - typeMapping.put("ByteArray", "utility::string_t"); + typeMapping.put("ByteArray", "utility::string_t"); super.importMapping = new HashMap(); importMapping.put("std::vector", "#include "); @@ -200,6 +200,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { * Location to write model files. You can use the modelPackage() as defined * when the class is instantiated */ + @Override public String modelFileFolder() { return outputFolder + "/model"; } @@ -218,7 +219,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { if (importMapping.containsKey(name)) { return importMapping.get(name); } else { - return "#include \"" + name + ".h\""; + return "#include \"" + sanitizeName(name) + ".h\""; } } @@ -281,12 +282,12 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { @Override public String toModelFilename(String name) { - return initialCaps(name); + return sanitizeName(initialCaps(name)); } @Override public String toApiFilename(String name) { - return initialCaps(name) + "Api"; + return sanitizeName(initialCaps(name) + "Api"); } /** @@ -388,33 +389,6 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { return toModelName(type); } - @Override - public String toModelName(String type) { - if (typeMapping.keySet().contains(type) || typeMapping.values().contains(type) - || importMapping.values().contains(type) || defaultIncludes.contains(type) - || languageSpecificPrimitives.contains(type)) { - return type; - } else { - return Character.toUpperCase(type.charAt(0)) + type.substring(1); - } - } - - @Override - public String toApiName(String type) { - return Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - @Override public Map postProcessAllModels(final Map models) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index 317095f511..bb3ad82411 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -148,18 +148,6 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { additionalProperties.put("defaultInclude", defaultInclude); } - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle - * escaping those terms here. This logic is only called if a variable - * matches the reserved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - return "_" + name; // add an underscore to the name - } - /** * Location to write model files. You can use the modelPackage() as defined * when the class is instantiated @@ -361,33 +349,4 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { type = openAPIType; return toModelName(type); } - - @Override - public String toModelName(String type) { - if (typeMapping.keySet().contains(type) || typeMapping.values().contains(type) - || importMapping.values().contains(type) || defaultIncludes.contains(type) - || languageSpecificPrimitives.contains(type)) { - return type; - } else { - return Character.toUpperCase(type.charAt(0)) + type.substring(1); - } - } - - @Override - public String toApiName(String type) { - return Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java index 1e3f1a849f..049a906182 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java @@ -32,7 +32,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; -public class CppTizenClientCodegen extends DefaultCodegen implements CodegenConfig { +public class CppTizenClientCodegen extends AbstractCppCodegen implements CodegenConfig { protected static String PREFIX = "ArtikCloud"; protected String sourceFolder = "src"; protected String documentationFolder = "doc"; @@ -270,14 +270,6 @@ public class CppTizenClientCodegen extends DefaultCodegen implements CodegenConf return "" + paramName; } - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - @Override public String toOperationId(String operationId) { // throw exception if method name is empty @@ -293,16 +285,13 @@ public class CppTizenClientCodegen extends DefaultCodegen implements CodegenConf // add_pet_by_id => addPetById return camelize(operationId, true); } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); + /** + * Output the Getter name for boolean property, e.g. getActive + * + * @param name the name of the property + * @return getter name based on naming convention + */ + public String toBooleanGetter(String name) { + return "get" + getterAndSetterCapitalize(name); } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index a7bcb087b1..08172a2cdc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -377,8 +377,14 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore("call_" + operationId)); - return underscore("call_" + operationId); + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId))); + return underscore(sanitizeName("call_" + operationId)); + } + + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; } //return underscore(operationId).replaceAll("[^A-Za-z0-9_]", ""); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java new file mode 100644 index 0000000000..081041fa24 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java @@ -0,0 +1,285 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.models.properties.*; +import io.swagger.v3.oas.models.*; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.*; +import org.openapitools.codegen.*; + +import java.io.File; +import java.util.*; + +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.PathItem.HttpMethod; +import io.swagger.v3.oas.models.*; +import io.swagger.v3.oas.models.parameters.*; +import io.swagger.v3.core.util.Yaml; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class PhpLaravelServerCodegen extends AbstractPhpCodegen { + @SuppressWarnings("hiding") + protected String apiVersion = "1.0.0"; + protected String variableNamingConvention = "camelCase"; + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + public CodegenType getTag() { + return CodegenType.SERVER; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + public String getName() { + return "php-laravel"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + public String getHelp() { + return "Generates a PHP laravel server library."; + } + + /** + * Class constructor + */ + public PhpLaravelServerCodegen() { + super(); + + embeddedTemplateDir = templateDir = "php-laravel"; + + /* + * packPath + */ + invokerPackage = "php-laravel"; + packagePath = ""; + outputFolder = packagePath + File.separator + srcBasePath; + + /* + * Api Package. Optional, if needed, this can be used in templates + */ + apiPackage = "app.Http.Controllers"; + + /* + * Model Package. Optional, if needed, this can be used in templates + */ + modelPackage = "app.Models"; + + // template files want to be ignored + apiTestTemplateFiles.clear(); + apiDocTemplateFiles.clear(); + modelDocTemplateFiles.clear(); + + /* + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + + /* + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied + */ + supportingFiles.add(new SupportingFile("composer.mustache", outputFolder, "composer.json")); + supportingFiles.add(new SupportingFile("README.md", outputFolder, "README.md")); + supportingFiles.add(new SupportingFile("artisan", outputFolder, "artisan")); + supportingFiles.add(new SupportingFile("package.json", outputFolder, "package.json")); + supportingFiles.add(new SupportingFile("phpunit.xml", outputFolder, "phpunit.xml")); + supportingFiles.add(new SupportingFile("webpack.mix.js", outputFolder, "webpack.mix.js")); + supportingFiles.add(new SupportingFile(".env.example", outputFolder, ".env.example")); + supportingFiles.add(new SupportingFile("server.php", outputFolder, "server.php")); + + supportingFiles.add(new SupportingFile("bootstrap/cache/.gitignore", outputFolder + File.separator + "bootstrap" + File.separator + "cache", ".gitignore")); + supportingFiles.add(new SupportingFile("bootstrap/app.php", outputFolder + File.separator + "bootstrap", "app.php")); + supportingFiles.add(new SupportingFile("bootstrap/testingAutoload.php", outputFolder + File.separator + "bootstrap", "testingAutoload.php")); + + /* /public/ */ + supportingFiles.add(new SupportingFile("public/css/app.css", outputFolder + File.separator + "public" + File.separator + "css", "app.css")); + supportingFiles.add(new SupportingFile("public/js/app.js", outputFolder + File.separator + "public" + File.separator + "js", "app.js")); + supportingFiles.add(new SupportingFile("public/.htaccess", outputFolder + File.separator + "public", ".htaccess")); + supportingFiles.add(new SupportingFile("public/favicon.ico", outputFolder + File.separator + "public", "favicon.ico")); + supportingFiles.add(new SupportingFile("public/index.php", outputFolder + File.separator + "public", "index.php")); + supportingFiles.add(new SupportingFile("public/robots.txt", outputFolder + File.separator + "public", "robots.txt")); + supportingFiles.add(new SupportingFile("public/web.config", outputFolder + File.separator + "public", "web.config")); + + /* /routes/ */ + supportingFiles.add(new SupportingFile("routes/api.mustache", outputFolder + File.separator + "routes", "api.php")); + supportingFiles.add(new SupportingFile("routes/web.mustache", outputFolder + File.separator + "routes", "web.php")); + supportingFiles.add(new SupportingFile("routes/channels.mustache", outputFolder + File.separator + "routes", "channels.php")); + supportingFiles.add(new SupportingFile("routes/console.mustache", outputFolder + File.separator + "routes", "console.php")); + + /* /app/Http/Controllers/ */ + supportingFiles.add(new SupportingFile("app/Http/Kernel.php", outputFolder + File.separator + "app" + File.separator + "Http", "Kernel.php")); + supportingFiles.add(new SupportingFile("app/Http/Controllers/Controller.php", outputFolder + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers", "Controller.php")); + supportingFiles.add(new SupportingFile("app/Http/Middleware/EncryptCookies.php", outputFolder + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware", "EncryptCookies.php")); + supportingFiles.add(new SupportingFile("app/Http/Middleware/RedirectIfAuthenticated.php", outputFolder + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware", "RedirectIfAuthenticated.php")); + supportingFiles.add(new SupportingFile("app/Http/Middleware/TrimStrings.php", outputFolder + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware", "TrimStrings.php")); + supportingFiles.add(new SupportingFile("app/Http/Middleware/TrustProxies.php", outputFolder + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware", "TrustProxies.php")); + supportingFiles.add(new SupportingFile("app/Http/Middleware/VerifyCsrfToken.php", outputFolder + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware", "VerifyCsrfToken.php")); + + // /app/Console + supportingFiles.add(new SupportingFile("app/Console/Kernel.php", outputFolder + File.separator + "app" + File.separator + "Console", "Kernel.php")); + // /app/Exceptions + supportingFiles.add(new SupportingFile("app/Exceptions/Handler.php", outputFolder + File.separator + "app" + File.separator + "Exceptions", "Handler.php")); + // /app/Providers + supportingFiles.add(new SupportingFile("app/Providers/AppServiceProvider.php", outputFolder + File.separator + "app" + File.separator + "Providers", "AppServiceProvider.php")); + supportingFiles.add(new SupportingFile("app/Providers/AuthServiceProvider.php", outputFolder + File.separator + "app" + File.separator + "Providers", "AuthServiceProvider.php")); + supportingFiles.add(new SupportingFile("app/Providers/BroadcastServiceProvider.php", outputFolder + File.separator + "app" + File.separator + "Providers", "BroadcastServiceProvider.php")); + supportingFiles.add(new SupportingFile("app/Providers/EventServiceProvider.php", outputFolder + File.separator + "app" + File.separator + "Providers", "EventServiceProvider.php")); + supportingFiles.add(new SupportingFile("app/Providers/RouteServiceProvider.php", outputFolder + File.separator + "app" + File.separator + "Providers", "RouteServiceProvider.php")); + + // /database/ + supportingFiles.add(new SupportingFile("database/factories/UserFactory.php", outputFolder + File.separator + "database" + File.separator + "factories", "UserFactory.php")); + supportingFiles.add(new SupportingFile("database/migrations/2014_10_12_000000_create_users_table.php", outputFolder + File.separator + "database" + File.separator + "migrations", "2014_10_12_000000_create_users_table.php")); + supportingFiles.add(new SupportingFile("database/migrations/2014_10_12_100000_create_password_resets_table.php", outputFolder + File.separator + "database" + File.separator + "migrations", "2014_10_12_100000_create_password_resets_table.php")); + supportingFiles.add(new SupportingFile("database/seeds/DatabaseSeeder.php", outputFolder + File.separator + "database" + File.separator + "seeds", "DatabaseSeeder.php")); + supportingFiles.add(new SupportingFile("database/.gitignore", outputFolder + File.separator + "database", ".gitignore")); + + // /config/ + supportingFiles.add(new SupportingFile("config/app.php", outputFolder + File.separator + "config", "app.php")); + supportingFiles.add(new SupportingFile("config/auth.php", outputFolder + File.separator + "config", "auth.php")); + supportingFiles.add(new SupportingFile("config/broadcasting.php", outputFolder + File.separator + "config", "broadcasting.php")); + supportingFiles.add(new SupportingFile("config/cache.php", outputFolder + File.separator + "config", "cache.php")); + supportingFiles.add(new SupportingFile("config/database.php", outputFolder + File.separator + "config", "database.php")); + supportingFiles.add(new SupportingFile("config/filesystems.php", outputFolder + File.separator + "config", "filesystems.php")); + supportingFiles.add(new SupportingFile("config/hashing.php", outputFolder + File.separator + "config", "hashing.php")); + supportingFiles.add(new SupportingFile("config/logging.php", outputFolder + File.separator + "config", "logging.php")); + supportingFiles.add(new SupportingFile("config/mail.php", outputFolder + File.separator + "config", "mail.php")); + supportingFiles.add(new SupportingFile("config/queue.php", outputFolder + File.separator + "config", "queue.php")); + supportingFiles.add(new SupportingFile("config/services.php", outputFolder + File.separator + "config", "services.php")); + supportingFiles.add(new SupportingFile("config/session.php", outputFolder + File.separator + "config", "session.php")); + supportingFiles.add(new SupportingFile("config/view.php", outputFolder + File.separator + "config", "view.php")); + + // /resources/ + supportingFiles.add(new SupportingFile("resources/assets/js/components/ExampleComponent.vue", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "js" + File.separator + "components", "ExampleComponent.vue")); + supportingFiles.add(new SupportingFile("resources/assets/js/app.js", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "js", "app.js")); + supportingFiles.add(new SupportingFile("resources/assets/js/bootstrap.js", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "js", "bootstrap.js")); + supportingFiles.add(new SupportingFile("resources/assets/sass/_variables.scss", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "sass", "_variables.scss")); + supportingFiles.add(new SupportingFile("resources/assets/sass/app.scss", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "sass", "app.scss")); + supportingFiles.add(new SupportingFile("resources/lang/en/auth.php", outputFolder + File.separator + "resources" + File.separator + "lang" + File.separator + "en", "auth.php")); + supportingFiles.add(new SupportingFile("resources/lang/en/pagination.php", outputFolder + File.separator + "resources" + File.separator + "lang" + File.separator + "en", "pagination.php")); + supportingFiles.add(new SupportingFile("resources/lang/en/passwords.php", outputFolder + File.separator + "resources" + File.separator + "lang" + File.separator + "en", "passwords.php")); + supportingFiles.add(new SupportingFile("resources/lang/en/validation.php", outputFolder + File.separator + "resources" + File.separator + "lang" + File.separator + "en", "validation.php")); + supportingFiles.add(new SupportingFile("resources/views/welcome.blade.php", outputFolder + File.separator + "resources" + File.separator + "views", "welcome.blade.php")); + + // /storage/ + supportingFiles.add(new SupportingFile("storage/app/.gitignore", outputFolder + File.separator + "storage" + File.separator + "app", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/app/public/.gitignore", outputFolder + File.separator + "storage" + File.separator + "app" + File.separator + "public", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/framework/.gitignore", outputFolder + File.separator + "storage" + File.separator + "framework", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/framework/cache/.gitignore", outputFolder + File.separator + "storage" + File.separator + "framework" + File.separator + "cache", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/framework/sessions/.gitignore", outputFolder + File.separator + "storage" + File.separator + "framework" + File.separator + "sessions", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/framework/testing/.gitignore", outputFolder + File.separator + "storage" + File.separator + "framework" + File.separator + "testing", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/framework/views/.gitignore", outputFolder + File.separator + "storage" + File.separator + "framework" + File.separator + "views", ".gitignore")); + supportingFiles.add(new SupportingFile("storage/logs/.gitignore", outputFolder + File.separator + "storage" + File.separator + "logs", ".gitignore")); + + // /tests/ + supportingFiles.add(new SupportingFile("tests/Feature/ExampleTest.php", outputFolder + File.separator + "tests" + File.separator + "Feature", "ExampleTest.php")); + supportingFiles.add(new SupportingFile("tests/Unit/ExampleTest.php", outputFolder + File.separator + "tests" + File.separator + "Unit", "ExampleTest.php")); + supportingFiles.add(new SupportingFile("tests/CreatesApplication.php", outputFolder + File.separator + "tests", "CreatesApplication.php")); + supportingFiles.add(new SupportingFile("tests/TestCase.php", outputFolder + File.separator + "tests", "TestCase.php")); + } + + // override with any special post-processing + @Override + public Map postProcessOperations(Map objs) { + @SuppressWarnings("unchecked") + Map objectMap = (Map) objs.get("operations"); + @SuppressWarnings("unchecked") + List operations = (List) objectMap.get("operation"); + + for (CodegenOperation op : operations) { + op.httpMethod = op.httpMethod.toLowerCase(); + // check to see if the path contains ".", which is not supported by PHP laravel + // ref: https://github.com/swagger-api/swagger-codegen/issues/6897 + if (op.path != null && op.path.contains(".")) { + throw new IllegalArgumentException("'.' (dot) is not supported by PHP laravel. Please refer to https://github.com/swagger-api/swagger-codegen/issues/6897 for more info."); + } + + if (op.hasProduces) { + // need to escape */* values because they breakes current mustaches + List> c = op.produces; + for (Map mediaType : c) { + if ("*/*".equals(mediaType.get("mediaType"))) { + mediaType.put("mediaType", "*_/_*"); + } + } + } + } + + // sort the endpoints in ascending to avoid the route priority issure. + // https://github.com/swagger-api/swagger-codegen/issues/2643 + Collections.sort(operations, new Comparator() { + @Override + public int compare(CodegenOperation lhs, CodegenOperation rhs) { + return lhs.path.compareTo(rhs.path); + } + }); + + return objs; + } + + @Override + public String toApiName(String name) { + if (name.isEmpty()) { + return "DefaultController"; + } + + return camelize(name, false) + "Controller"; + } + + protected String controllerFileFolder() { + return (outputFolder + File.separator + srcBasePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers"); + } + + @Override + public String apiFilename(String templateName, String tag) { + String suffix = apiTemplateFiles().get(templateName); + if (templateName.equals("api.mustache")) { + return controllerFileFolder() + '/' + toControllerName(tag) + suffix; + } + + return apiFileFolder() + '/' + toApiFilename(tag) + suffix; + } + + protected String toControllerName(String name) { + if (name.isEmpty()) { + return "DefaultController"; + } + + return camelize(name, false) + "Controller"; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index cb829433f5..0789d6260d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -160,7 +160,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) - .defaultValue(Boolean.FALSE.toString())); + .defaultValue(Boolean.FALSE.toString())); supportedLibraries.put("urllib3", "urllib3-based client"); supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); @@ -224,7 +224,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); } - String readmePath ="README.md"; + String readmePath = "README.md"; String readmeTemplate = "README.mustache"; if (generateSourceCodeOnly) { readmePath = packageName + "_" + readmePath; @@ -232,7 +232,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig } supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); - if (!generateSourceCodeOnly){ + if (!generateSourceCodeOnly) { supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt")); @@ -552,6 +552,12 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig operationId = "call_" + operationId; } + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + return underscore(sanitizeName(operationId)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 74558b990b..b80b423311 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -462,6 +462,12 @@ public class RubyClientCodegen extends AbstractRubyCodegen { return newOperationId; } + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + return underscore(sanitizeName(operationId)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java index 3a8752df73..1c58af9123 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java @@ -19,7 +19,10 @@ package org.openapitools.codegen.languages; import java.text.SimpleDateFormat; + +import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.SupportingFile; import io.swagger.v3.oas.models.media.*; @@ -64,6 +67,8 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { protected String pidFolder = tmpFolder + File.separator + "pids"; protected String socketsFolder = tmpFolder + File.separator + "sockets"; protected String vendorFolder = "vendor"; + protected String databaseAdapter = "sqlite"; + public RubyOnRailsServerCodegen() { super(); @@ -87,6 +92,9 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { // remove modelPackage and apiPackage added by default cliOptions.clear(); + + cliOptions.add(new CliOption(CodegenConstants.DATABASE_ADAPTER, CodegenConstants.DATABASE_ADAPTER_DESC). + defaultValue("sqlite")); } @Override @@ -97,7 +105,24 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { //setModelPackage("models"); setApiPackage("app/controllers"); - supportingFiles.add(new SupportingFile("Gemfile", "", "Gemfile")); + // determine which db adapter to use + if (additionalProperties.containsKey(CodegenConstants.DATABASE_ADAPTER)) { + setDatabaseAdapter((String) additionalProperties.get(CodegenConstants.DATABASE_ADAPTER)); + } else { + // not set, pass the default value to template + additionalProperties.put(CodegenConstants.DATABASE_ADAPTER, databaseAdapter); + } + + if ("sqlite".equals(databaseAdapter)) { + additionalProperties.put("isDBSQLite", Boolean.TRUE); + } else if ("mysql".equals(databaseAdapter)) { + additionalProperties.put("isDBMySQL", Boolean.TRUE); + } else { + LOGGER.warn("Unknown database {}. Defaul to 'sqlite'.", databaseAdapter); + additionalProperties.put("isDBSQLite", Boolean.TRUE); + } + + supportingFiles.add(new SupportingFile("Gemfile.mustache", "", "Gemfile")); supportingFiles.add(new SupportingFile("README.md", "", "README.md")); supportingFiles.add(new SupportingFile("Rakefile", "", "Rakefile")); supportingFiles.add(new SupportingFile("config.ru", "", "config.ru")); @@ -130,7 +155,7 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile("application.rb", configFolder, "application.rb")); supportingFiles.add(new SupportingFile("boot.rb", configFolder, "boot.rb")); supportingFiles.add(new SupportingFile("cable.yml", configFolder, "cable.yml")); - supportingFiles.add(new SupportingFile("database.yml", configFolder, "database.yml")); + supportingFiles.add(new SupportingFile("database.mustache", configFolder, "database.yml")); supportingFiles.add(new SupportingFile("environment.rb", configFolder, "environment.rb")); supportingFiles.add(new SupportingFile("puma.rb", configFolder, "puma.rb")); supportingFiles.add(new SupportingFile("routes.mustache", configFolder, "routes.rb")); @@ -156,6 +181,8 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile(".keep", socketsFolder, ".keep")); supportingFiles.add(new SupportingFile("restart.txt", tmpFolder, "restart.txt")); supportingFiles.add(new SupportingFile(".keep", vendorFolder, ".keep")); + supportingFiles.add(new SupportingFile("Dockerfile", "", "Dockerfile")); + supportingFiles.add(new SupportingFile("docker-entrypoint.sh", "", "docker-entrypoint.sh")); } @Override @@ -225,12 +252,22 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { return underscore(name) + "_controller"; } + @Override + public String toApiVarName(String name) { + if (name.length() == 0) { + return "api"; + } + + // e.g. PhoneNumber => phone_number + return underscore(sanitizeName(name)); + } + @Override public String toApiName(String name) { if (name.length() == 0) { return "ApiController"; } - // e.g. phone_number_api => PhoneNumberApi + // e.g. phone_number_controller => PhoneNumberController return camelize(name) + "Controller"; } @@ -239,4 +276,8 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { generateYAMLSpecFile(objs); return super.postProcessSupportingFileData(objs); } + + public void setDatabaseAdapter(String databaseAdapter) { + this.databaseAdapter = databaseAdapter; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 2d4cb2b4da..63fd9d8091 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -1030,21 +1030,28 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); - if (cm.dataType != null && cm.dataType.equals("object")) { // Object isn't a sensible default. Instead, we set it to // 'null'. This ensures that we treat this model as a struct // with multiple parameters. cm.dataType = null; } else if (cm.dataType != null) { - // We need to hack about with single-parameter models to get - // them recognised correctly. - cm.isAlias = false; - cm.dataType = typeMapping.get(cm.dataType); + if (cm.dataType.equals("map")) { + // We don't yet support `additionalProperties`. We ignore + // the `additionalProperties` type ('map') and warn the + // user. This will produce code that compiles, but won't + // feature the `additionalProperties`. + cm.dataType = null; + LOGGER.warn("Ignoring unsupported additionalProperties (see https://github.com/OpenAPITools/openapi-generator/issues/318)"); + } else { + // We need to hack about with single-parameter models to + // get them recognised correctly. + cm.isAlias = false; + cm.dataType = typeMapping.get(cm.dataType); + } } } return super.postProcessModelsEnum(objs); - } private boolean paramHasXmlNamespace(CodegenParameter param, Map definitions) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index 0263f6cf32..3a0d2c78d9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -85,7 +85,9 @@ public class {{classname}} { {{/isDeprecated}} public class {{operationIdCamelCase}}Oper { + public static final String REQ_METHOD = "{{httpMethod}}"; public static final String REQ_URI = "{{path}}"; + public static final String SUMMARY = "{{{summary}}}"; private RequestSpecBuilder reqSpec; @@ -141,7 +143,7 @@ public class {{classname}} { {{#bodyParams}} /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper body({{{dataType}}} {{paramName}}) { @@ -154,7 +156,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_HEADER = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Header(String {{paramName}}) { @@ -167,7 +169,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_PATH = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Path(Object {{paramName}}) { @@ -180,7 +182,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_QUERY = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Query(Object... {{paramName}}) { @@ -194,7 +196,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_FORM = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Form(Object... {{paramName}}) { @@ -209,7 +211,7 @@ public class {{classname}} { /** * It will assume that the control name is file and the <content-type> is <application/octet-stream> * @see #reqSpec for customise - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}MultiPart({{{dataType}}} {{paramName}}) { @@ -241,4 +243,4 @@ public class {{classname}} { } {{/operation}} {{/operations}} -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 471a936ad5..11a042ab34 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -46,6 +46,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -542,8 +544,15 @@ public class ApiClient { } builder.queryParams(queryParams); } + + URI uri; + try { + uri = new URI(builder.build().toUriString()); + } catch(URISyntaxException ex) { + throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); + } - final BodyBuilder requestBuilder = RequestEntity.method(method, builder.build().toUri()); + final BodyBuilder requestBuilder = RequestEntity.method(method, uri); if(accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 1dfb88188d..a5c3d07b08 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -56,6 +56,7 @@ org.openapitools.codegen.languages.OpenAPIGenerator org.openapitools.codegen.languages.OpenAPIYamlGenerator org.openapitools.codegen.languages.PerlClientCodegen org.openapitools.codegen.languages.PhpClientCodegen +org.openapitools.codegen.languages.PhpLaravelServerCodegen org.openapitools.codegen.languages.PhpLumenServerCodegen org.openapitools.codegen.languages.PhpSlimServerCodegen org.openapitools.codegen.languages.PhpSilexServerCodegen diff --git a/modules/openapi-generator/src/main/resources/apex/Swagger.cls b/modules/openapi-generator/src/main/resources/apex/OAS.cls similarity index 97% rename from modules/openapi-generator/src/main/resources/apex/Swagger.cls rename to modules/openapi-generator/src/main/resources/apex/OAS.cls index 172c303811..d7f4c6053c 100644 --- a/modules/openapi-generator/src/main/resources/apex/Swagger.cls +++ b/modules/openapi-generator/src/main/resources/apex/OAS.cls @@ -1,4 +1,4 @@ -public class Swagger { +public class OAS { private static final String HEADER_CONTENT_TYPE = 'Content-Type'; private static final String HEADER_ACCEPT = 'Accept'; private static final String HEADER_ACCEPT_DELIMITER = ','; @@ -271,9 +271,7 @@ public class Swagger { @TestVisible protected virtual void applyAuthentication(List names, Map headers, List query) { - for (Authentication auth : getAuthMethods(names)) { - auth.apply(headers, query); - } + // TODO Check auth methods } @TestVisible @@ -298,7 +296,7 @@ public class Swagger { protected virtual String toEndpoint(String path, Map params, List queryParams) { String query = '?' + paramsToString(queryParams); - return '"callout:' + calloutName + toPath(path, params) + query.removeEnd('?') + '""'; + return 'callout:' + calloutName + toPath(path, params) + query.removeEnd('?'); } @TestVisible diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerResponseMock.cls b/modules/openapi-generator/src/main/resources/apex/OASResponseMock.cls similarity index 72% rename from samples/client/petstore/apex/force-app/main/default/classes/SwaggerResponseMock.cls rename to modules/openapi-generator/src/main/resources/apex/OASResponseMock.cls index 7d3acb1a91..a6931145c5 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerResponseMock.cls +++ b/modules/openapi-generator/src/main/resources/apex/OASResponseMock.cls @@ -1,9 +1,9 @@ @isTest -public class SwaggerResponseMock implements HttpCalloutMock { +public class OASResponseMock implements HttpCalloutMock { private final HttpResponse response; private HttpRequest request; - public SwaggerResponseMock(HttpResponse response) { + public OASResponseMock(HttpResponse response) { this.response = response; } diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerTest.cls b/modules/openapi-generator/src/main/resources/apex/OASTest.cls similarity index 82% rename from samples/client/petstore/apex/force-app/main/default/classes/SwaggerTest.cls rename to modules/openapi-generator/src/main/resources/apex/OASTest.cls index e3cec8831c..e1c73d185e 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerTest.cls +++ b/modules/openapi-generator/src/main/resources/apex/OASTest.cls @@ -1,19 +1,19 @@ @isTest -private class SwaggerTest { +private class OASTest { @isTest private static void Param_urlEncodeKeyValuePairUtf8() { String toEncodeLeft = 'Hello +%-_.!~*\'()@'; String toEncodeRight = 'World +%-_.!~*\'()@'; String expected = 'Hello+%2B%25-_.%21%7E*%27%28%29%40=World+%2B%25-_.%21%7E*%27%28%29%40'; - String result = new Swagger.Param(toEncodeLeft, toEncodeRight).toString(); + String result = new OAS.Param(toEncodeLeft, toEncodeRight).toString(); System.assertEquals(expected, result); } @isTest private static void ApiKeyHeaderAuth_keyInHeaderWithGivenName() { Map headers = new Map(); - List query = new List(); - Swagger.ApiKeyHeaderAuth auth = new Swagger.ApiKeyHeaderAuth('X-Authenticate'); + List query = new List(); + OAS.ApiKeyHeaderAuth auth = new OAS.ApiKeyHeaderAuth('X-Authenticate'); auth.setApiKey('foo-bar-api-key'); auth.apply(headers, query); @@ -25,8 +25,8 @@ private class SwaggerTest { @isTest private static void ApiKeyQueryAuth_keyInQueryParamWithGivenName() { Map headers = new Map(); - List query = new List(); - Swagger.ApiKeyQueryAuth auth = new Swagger.ApiKeyQueryAuth('auth_token'); + List query = new List(); + OAS.ApiKeyQueryAuth auth = new OAS.ApiKeyQueryAuth('auth_token'); auth.setApiKey('foo-bar-api-key'); auth.apply(headers, query); @@ -38,8 +38,8 @@ private class SwaggerTest { @isTest private static void ApiClient_returnAuthenticationMatchingInput() { MockApiClient client = new MockApiClient(); - Swagger.ApiKeyHeaderAuth auth1 = new Swagger.ApiKeyHeaderAuth('foo'); - Swagger.ApiKeyQueryAuth auth2 = new Swagger.ApiKeyQueryAuth('foo'); + OAS.ApiKeyHeaderAuth auth1 = new OAS.ApiKeyHeaderAuth('foo'); + OAS.ApiKeyQueryAuth auth2 = new OAS.ApiKeyQueryAuth('foo'); client.authentications.put('auth1', auth1); client.authentications.put('auth2', auth2); @@ -51,8 +51,8 @@ private class SwaggerTest { @isTest private static void ApiClient_oneKeyValuePairForEachValueInList() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParams('foo', values); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParams('foo', values); System.assertEquals(5, params.size()); System.assertEquals('foo=bar', params.get(0).toString()); @@ -64,8 +64,8 @@ private class SwaggerTest { @isTest private static void ApiClient_nullMultiValuesListToEmptyParamsList() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParams('foo', null); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParams('foo', null); System.assert(params.isEmpty()); } @@ -73,8 +73,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSingleCsvKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'csv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'csv'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar%2C4%2Cfalse%2C12.4%2C', params.get(0).toString()); @@ -83,8 +83,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSingleSsvKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'ssv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'ssv'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar+4+false+12.4+', params.get(0).toString()); @@ -93,8 +93,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSingleTsvKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'tsv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'tsv'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar%094%09false%0912.4%09', params.get(0).toString()); @@ -103,8 +103,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSinglePipeSeparatedKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'pipes'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'pipes'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar%7C4%7Cfalse%7C12.4%7C', params.get(0).toString()); @@ -112,16 +112,16 @@ private class SwaggerTest { @isTest private static void ApiClient_nullValuesListToEmptyParamsList() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', null, 'csv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', null, 'csv'); System.assert(params.isEmpty()); } @isTest private static void ApiClient_paramsFromAnyPrimitiveTypeDiscardNull() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = new List(); + OAS.ApiClient client = new OAS.ApiClient(); + List params = new List(); params.addAll(client.makeParam('foo', 'bar')); params.addAll(client.makeParam('foo', 10)); params.addAll(client.makeParam('foo', 12.6)); @@ -141,13 +141,13 @@ private class SwaggerTest { @isTest private static void ApiClient_requiredParameterPasses() { - Swagger.ApiClient client = new Swagger.ApiClient(); + OAS.ApiClient client = new OAS.ApiClient(); client.assertNotNull('foo', 'bar'); } @isTest private static void ApiClient_requiredParameterFails() { - Swagger.ApiClient client = new Swagger.ApiClient(); + OAS.ApiClient client = new OAS.ApiClient(); try { client.assertNotNull(null, 'bar'); } catch (NullPointerException e) { @@ -217,7 +217,7 @@ private class SwaggerTest { '"bat":false' }; Set actual1 = new Set(client - .toBody('application/json', body1, new List()) + .toBody('application/json', body1, new List()) .removeStart('{') .removeEnd('}') .split(',') @@ -225,12 +225,12 @@ private class SwaggerTest { System.assertEquals(expected1, actual1); String body2 = 'Hello, World!'; - String actual2 = client.toBody('text/plain', body2, new List()); + String actual2 = client.toBody('text/plain', body2, new List()); System.assertEquals(body2, actual2); - List form = new List{ - new Swagger.Param('hello', 'world'), - new Swagger.Param('date', '2017-01-01 15:00:00') + List form = new List{ + new OAS.Param('hello', 'world'), + new OAS.Param('date', '2017-01-01 15:00:00') }; String expected3 = 'hello=world&date=2017-01-01+15%3A00%3A00'; String actual3 = client.toBody('application/x-www-form-urlencoded', '', form); @@ -288,11 +288,11 @@ private class SwaggerTest { MockApiClient client = new MockApiClient(); String path = '/departments/{department}'; Map params = new Map{'department' => 'finance'}; - List queryParams = new List{ - new Swagger.Param('foo', 'bar'), - new Swagger.Param('bat', '123') + List queryParams = new List{ + new OAS.Param('foo', 'bar'), + new OAS.Param('bat', '123') }; - String expected = 'https://www.mccombs.utexas.edu/departments/finance?foo=bar&bat=123'; + String expected = 'callout:Winkelmeyer/departments/finance?foo=bar&bat=123'; String actual = client.toEndpoint(path, params, queryParams); System.assertEquals(expected, actual); } @@ -301,7 +301,7 @@ private class SwaggerTest { private static void ApiClient_returnParsedBody() { MockApiClient client = new MockApiClient(); HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); + OASResponseMock mock = new OASResponseMock(res); Test.setMock(HttpCalloutMock.class, mock); res.setStatus('OK'); @@ -314,8 +314,8 @@ private class SwaggerTest { Address a = (Address) client.invoke( 'GET', '/address', '', - new List(), - new List(), + new List(), + new List(), new Map(), new Map(), new List{'application/json'}, @@ -337,7 +337,7 @@ private class SwaggerTest { private static void ApiClient_noReturnTypeReturnsNull() { MockApiClient client = new MockApiClient(); HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); + OASResponseMock mock = new OASResponseMock(res); Test.setMock(HttpCalloutMock.class, mock); res.setStatus('OK'); @@ -345,8 +345,8 @@ private class SwaggerTest { Object o = client.invoke( 'POST', '/address', '', - new List(), - new List(), + new List(), + new List(), new Map(), new Map(), new List{'application/json'}, @@ -358,9 +358,10 @@ private class SwaggerTest { System.assertEquals(null, o); } - private class MockApiClient extends Swagger.ApiClient { + private class MockApiClient extends OAS.ApiClient { public MockApiClient() { - basePath = 'https://www.mccombs.utexas.edu'; + basePath = 'https://blog.winkelmeyer.com'; + calloutName = 'Winkelmeyer'; } } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache index 53f2bf4fc1..6faaa3e55f 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache @@ -116,7 +116,7 @@ HttpBasicAuth {{{name}}} = (HttpBasicAuth) client.getAuthentication('{{{name}}}' ApiKeyAuth {{{name}}} = (ApiKeyAuth) client.getAuthentication('{{{name}}}'); {{{name}}}.setApiKey('YOUR API KEY');{{/isApiKey}}{{#isOAuth}} // Configure OAuth2 access token for authorization: {{{name}}} -Swagger.OAuth {{{name}}} = (Swagger.OAuth) client.getAuthentication('{{{name}}}'); +OAS.OAuth {{{name}}} = (OAS.OAuth) client.getAuthentication('{{{name}}}'); {{{name}}}.setAccessToken('YOUR ACCESS TOKEN');{{/isOAuth}} {{/authMethods}} {{/hasAuthMethods}} @@ -135,7 +135,7 @@ try { {{#returnType}} System.debug(result); {{/returnType}} -} catch (Swagger.ApiException e) { +} catch (OAS.ApiException e) { // ...handle your exceptions }{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} ``` diff --git a/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache b/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache index 50f428b512..82628bae77 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache @@ -67,7 +67,7 @@ try { {{#returnType}} System.debug(result); {{/returnType}} -} catch (Swagger.ApiException e) { +} catch (OAS.ApiException e) { // ...handle your exceptions }{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} ``` @@ -100,7 +100,7 @@ Class | Method | HTTP request | Description {{/isBasic}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} -- **Authorizatoin URL**: {{authorizationUrl}} +- **Authorization URL**: {{authorizationUrl}} - **Scopes**: {{^scopes}}N/A{{/scopes}} {{#scopes}} - {{scope}}: {{description}} {{/scopes}} diff --git a/modules/openapi-generator/src/main/resources/apex/api.mustache b/modules/openapi-generator/src/main/resources/apex/api.mustache index ebbef7283f..7cd21f0ea7 100644 --- a/modules/openapi-generator/src/main/resources/apex/api.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api.mustache @@ -25,7 +25,7 @@ public class {{classname}} { {{#returnType}} * @return {{{returnType}}} {{/returnType}} - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#hasParams}}Map params{{/hasParams}}) { {{#allParams}} @@ -33,7 +33,7 @@ public class {{classname}} { client.assertNotNull(params.get('{{paramName}}'), '{{paramName}}'); {{/required}} {{/allParams}} - List query = new List(); + List query = new List(); {{#hasQueryParams}} // cast query params to verify their expected type @@ -54,7 +54,7 @@ public class {{classname}} { {{/hasMore}} {{/queryParams}} - List form = new List(); + List form = new List(); {{#hasFormParams}} // cast form params to verify their expected type @@ -88,13 +88,13 @@ public class {{classname}} { {{/headerParams}} }{{/hasHeaderParams}}{{^hasHeaderParams}}(){{/hasHeaderParams}}, {{#hasProduces}} - new List{ {{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}} }, + new List{ {{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}} {{^hasProduces}} new List(), {{/hasProduces}} {{#hasConsumes}} - new List{ {{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}} }, + new List{ {{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}} }, {{/hasConsumes}} {{^hasConsumes}} new List(), diff --git a/modules/openapi-generator/src/main/resources/apex/api_doc.mustache b/modules/openapi-generator/src/main/resources/apex/api_doc.mustache index 5a639d2950..947c560702 100644 --- a/modules/openapi-generator/src/main/resources/apex/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api_doc.mustache @@ -35,7 +35,7 @@ HttpBasicAuth {{{name}}} = (HttpBasicAuth) client.getAuthentication('{{{name}}}' ApiKeyAuth {{{name}}} = (ApiKeyAuth) client.getAuthentication('{{{name}}}'); {{{name}}}.setApiKey('YOUR API KEY');{{/isApiKey}}{{#isOAuth}} // Configure OAuth2 access token for authorization: {{{name}}} -Swagger.OAuth {{{name}}} = (Swagger.OAuth) client.getAuthentication('{{{name}}}'); +OAS.OAuth {{{name}}} = (OAS.OAuth) client.getAuthentication('{{{name}}}'); {{{name}}}.setAccessToken('YOUR ACCESS TOKEN');{{/isOAuth}} {{/authMethods}} {{/hasAuthMethods}} @@ -54,7 +54,7 @@ try { {{#returnType}} System.debug(result); {{/returnType}} -} catch (Swagger.ApiException e) { +} catch (OAS.ApiException e) { // ...handle your exceptions } ``` diff --git a/modules/openapi-generator/src/main/resources/apex/api_test.mustache b/modules/openapi-generator/src/main/resources/apex/api_test.mustache index f7a3cf0a63..440abb9d70 100644 --- a/modules/openapi-generator/src/main/resources/apex/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api_test.mustache @@ -18,7 +18,7 @@ private class {{classname}}Test { res.setStatusCode(200); res.setStatus('OK'); {{/restfulCreate}} - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); {{#hasParams}} Map params = new Map{ @@ -34,18 +34,19 @@ private class {{classname}}Test { {{{returnType}}} response; {{{returnType}}} expectedResponse; {{/returnType}} + String js = ''; {{#authMethods}} client = new {{classPrefix}}Client(); api = new {{classname}}(client);{{#isApiKey}} - ((Swagger.ApiKeyAuth){{/isApiKey}} client.getAuthentication('{{name}}'); - {{#isApiKey}} - client.setApiKey('foo-bar-api-key'); + ((OAS.ApiKeyAuth)client.getAuthentication('{{name}}')).setApiKey('foo-bar-api-key'); {{/isApiKey}} {{#examples}} + + js = JSON.serialize({{{deserializedExample}}}); res.setHeader('Content-Type', '{{contentType}}'); - res.setBody('{{{example}}}'); + res.setBody(js); expectedResponse = {{{deserializedExample}}}; response = ({{{returnType}}}) api.{{operationId}}({{#hasParams}}params{{/hasParams}}); System.assertEquals(expectedResponse, response); @@ -59,8 +60,9 @@ private class {{classname}}Test { api = new {{classname}}(new {{classPrefix}}Client()); {{#examples}} + js = JSON.serialize({{{deserializedExample}}}); res.setHeader('Content-Type', '{{contentType}}'); - res.setBody('{{{example}}}'); + res.setBody(js); expectedResponse = {{{deserializedExample}}}; response = ({{{returnType}}}) api.{{operationId}}({{#hasParams}}params{{/hasParams}}); System.assertEquals(expectedResponse, response); diff --git a/modules/openapi-generator/src/main/resources/apex/build.mustache b/modules/openapi-generator/src/main/resources/apex/build.mustache index beb0fd0b32..31496fae35 100644 --- a/modules/openapi-generator/src/main/resources/apex/build.mustache +++ b/modules/openapi-generator/src/main/resources/apex/build.mustache @@ -62,7 +62,7 @@ {{classname}}Test {{/model}} {{/models}} - SwaggerTest + OASTest @@ -92,7 +92,7 @@ {{classname}}Test {{/model}} {{/models}} - SwaggerTest + OASTest diff --git a/modules/openapi-generator/src/main/resources/apex/client.mustache b/modules/openapi-generator/src/main/resources/apex/client.mustache index fe5ba4f77b..d2daf5f44f 100644 --- a/modules/openapi-generator/src/main/resources/apex/client.mustache +++ b/modules/openapi-generator/src/main/resources/apex/client.mustache @@ -1,4 +1,4 @@ -public class {{classPrefix}}Client extends Swagger.ApiClient { +public class {{classPrefix}}Client extends OAS.ApiClient { {{#hasAuthMethods}} public {{classPrefix}}Client() { basePath = '{{basePath}}'; @@ -6,10 +6,10 @@ public class {{classPrefix}}Client extends Swagger.ApiClient { {{#authMethods}} {{#isApiKey}} {{#isKeyInQuery}} - authentications.put('{{name}}', new Swagger.ApiKeyQueryAuth('{{keyParamName}}')); + authentications.put('{{name}}', new OAS.ApiKeyQueryAuth('{{keyParamName}}')); {{/isKeyInQuery}} {{^isKeyInQuery}} - authentications.put('{{name}}', new Swagger.ApiKeyHeaderAuth('{{keyParamName}}')); + authentications.put('{{name}}', new OAS.ApiKeyHeaderAuth('{{keyParamName}}')); {{/isKeyInQuery}} {{/isApiKey}} {{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache index 8a32e53995..1de48af66e 100644 --- a/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 OAS-petstore-perl "minor update" git_user_id=$1 git_repo_id=$2 @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache index 335db1c593..dbb69eb642 100644 --- a/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache @@ -5,7 +5,7 @@ * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ diff --git a/modules/openapi-generator/src/main/resources/apex/model_test.mustache b/modules/openapi-generator/src/main/resources/apex/model_test.mustache index 7b22a41e55..3aef0d6557 100644 --- a/modules/openapi-generator/src/main/resources/apex/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/apex/model_test.mustache @@ -45,15 +45,6 @@ private class {{classname}}Test { System.assert({{classVarName}}4.equals({{classVarName}}3)); } - @isTest - private static void notEqualsUnlikeInstance() { - {{classname}} {{classVarName}}1 = {{classname}}.getExample(); - {{classname}} {{classVarName}}2 = new {{classname}}(); - - System.assertEquals(false, {{classVarName}}1.equals({{classVarName}}2)); - System.assertEquals(false, {{classVarName}}2.equals({{classVarName}}1)); - } - @isTest private static void notEqualsDifferentType() { {{classname}} {{classVarName}}1 = {{classname}}.getExample(); diff --git a/modules/openapi-generator/src/main/resources/apex/package.mustache b/modules/openapi-generator/src/main/resources/apex/package.mustache index e05b18ab7e..cee1920838 100644 --- a/modules/openapi-generator/src/main/resources/apex/package.mustache +++ b/modules/openapi-generator/src/main/resources/apex/package.mustache @@ -3,7 +3,7 @@ {{appName}} API Client Client library for calling the {{appName}} API.{{#appDescription}} {{{appDescription}}}{{/appDescription}} -Generated with OpenAPI Generator (https://openapi-generator.tech) +Generated with OAS Codegen (github.com/OAS-api/OAS-codegen) {{#apiInfo}} {{#apis}} @@ -18,9 +18,9 @@ Generated with OpenAPI Generator (https://openapi-generator.tech) {{/model}} {{/models}} {{classPrefix}}Client - Swagger - SwaggerTest - SwaggerResponseMock + OAS + OASTest + OASResponseMock ApexClass diff --git a/modules/openapi-generator/src/main/resources/apex/pojo.mustache b/modules/openapi-generator/src/main/resources/apex/pojo.mustache index c26649e959..320b90922d 100644 --- a/modules/openapi-generator/src/main/resources/apex/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/pojo.mustache @@ -6,13 +6,15 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfac {{#isEnum}} {{^isContainer}} {{>modelInnerEnum}} - {{/isContainer}} - {{#isContainer}} - {{#mostInnerItems}} -{{>modelInnerEnum}} - {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} + {{#items.isEnum}} + {{#items}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{/items}} + {{/items.isEnum}} /** {{#description}} * {{{description}}} @@ -58,16 +60,17 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfac public static {{classname}} getExample() { {{classname}} {{classVarName}} = new {{classname}}(); {{#vars}} - {{classVarName}}.{{name}} = {{{example}}}; + {{#example}}{{classVarName}}.{{name}} = {{{example}}};{{/example}} {{/vars}} return {{classVarName}}; } public Boolean equals(Object obj) { - if (obj instanceof {{classname}}) { + if (obj instanceof {{classname}}) { {{#hasVars}} {{classname}} {{classVarName}} = ({{classname}}) obj; return {{#vars}}this.{{name}} == {{classVarName}}.{{name}}{{#hasMore}} - && {{/hasMore}}{{/vars}}; + && {{/hasMore}}{{/vars}};{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} } return false; } diff --git a/modules/openapi-generator/src/main/resources/apex/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/apex/pojo_doc.mustache index 07b73cc6f5..0e4c074986 100644 --- a/modules/openapi-generator/src/main/resources/apex/pojo_doc.mustache +++ b/modules/openapi-generator/src/main/resources/apex/pojo_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#readOnly}} [readonly]{{/readOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#readOnly}} [readonly]{{/readOnly}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/apex/sfdx-project-scratch-def.json b/modules/openapi-generator/src/main/resources/apex/sfdx-project-scratch-def.json new file mode 100644 index 0000000000..36aace5526 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/apex/sfdx-project-scratch-def.json @@ -0,0 +1,8 @@ +{ + "orgName": "muenzpraeger - René Winkelmeyer", + "edition": "Developer", + "orgPreferences": { + "enabled": ["S1DesktopEnabled"], + "disabled": ["S1EncryptedStoragePref2"] + } +} diff --git a/modules/openapi-generator/src/main/resources/apex/sfdx-project.json.mustache b/modules/openapi-generator/src/main/resources/apex/sfdx-project.json.mustache new file mode 100644 index 0000000000..08ac49c0ce --- /dev/null +++ b/modules/openapi-generator/src/main/resources/apex/sfdx-project.json.mustache @@ -0,0 +1,11 @@ +{ + "packageDirectories": [ + { + "path": "force-app", + "default": true + } + ], + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "{{apiVersion}}" +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/apex/sfdx.mustache b/modules/openapi-generator/src/main/resources/apex/sfdx.mustache deleted file mode 100644 index f63e2e3611..0000000000 --- a/modules/openapi-generator/src/main/resources/apex/sfdx.mustache +++ /dev/null @@ -1,10 +0,0 @@ -{ - "sfdxSource": true, - "version": "1.0.0", - "sourceFolder": "src/", - "folders": [ - "src/classes" - ], - "files": [ - ] -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apihandler.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apihandler.h.mustache index e37a99bd7b..991b3ff8d1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apihandler.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apihandler.h.mustache @@ -1,6 +1,6 @@ {{>licenseInfo}} -#ifndef _{{prefix}}_{{classname}}Handler_H_ -#define _{{prefix}}_{{classname}}Handler_H_ +#ifndef {{prefix}}_{{classname}}Handler_H +#define {{prefix}}_{{classname}}Handler_H #include @@ -30,4 +30,4 @@ public slots: } {{/cppNamespaceDeclarations}} -#endif // _{{prefix}}_{{classname}}Handler_H_ +#endif // {{prefix}}_{{classname}}Handler_H diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache index e9430f5b25..4fa84629c3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache @@ -13,6 +13,10 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} {{classname}}Request::{{classname}}Request(QHttpEngine::Socket *s, {{classname}}Handler* hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } } {{classname}}Request::~{{classname}}Request(){ @@ -21,16 +25,23 @@ namespace {{this}} { } QMap -{{classname}}Request::getDefaultHeaders(){ - return defaultHeaders; +{{classname}}Request::getRequestHeaders() const { + return requestHeaders; } +void {{classname}}Request::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + QHttpEngine::Socket* {{classname}}Request::getRawSocket(){ return socket; } {{#operations}}{{#operation}} -void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}}QString {{{paramName}}}str{{/pathParams}}{{/hasPathParams}}){ +void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}}const QString& {{{paramName}}}str{{#hasMore}}, {{/hasMore}}{{/pathParams}}{{/hasPathParams}}){ qDebug() << "{{{basePathWithoutHost}}}{{{path}}}"; connect(this, &{{classname}}Request::{{nickname}}, handler, &{{classname}}Handler::{{nickname}}); @@ -64,10 +75,10 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} {{/isListContainer}} {{^isListContainer}} {{^isMapContainer}} - {{#isPrimitive}} + {{#isPrimitiveType}} {{{dataType}}} {{paramName}}; ::{{cppNamespace}}::fromStringValue((QString(socket->readAll()), {{paramName}}); - {{/isPrimitive}} + {{/isPrimitiveType}} {{/isMapContainer}} {{#isMapContainer}} QJsonDocument doc; @@ -81,13 +92,13 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} } {{/isMapContainer}} {{^isMapContainer}} - {{^isPrimitive}} + {{^isPrimitiveType}} QJsonDocument doc; socket->readJson(doc); QJsonObject obj = doc.object(); {{{dataType}}} {{paramName}}; ::{{cppNamespace}}::fromJsonValue({{paramName}}, obj); - {{/isPrimitive}} + {{/isPrimitiveType}} {{/isMapContainer}} {{/isListContainer}} {{/bodyParam}}{{/bodyParams}} @@ -97,27 +108,42 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} {{/operation}}{{/operations}} -{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}{{{returnType}}} res{{/returnType}}){ - socket->setStatusCode(QHttpEngine::Socket::OK); +{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}){ + writeResponseHeaders();{{#returnType}}{{^isPrimitiveType}} + QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).to{{^isListContainer}}Object{{/isListContainer}}{{#isListContainer}}Array{{/isListContainer}}());{{/isPrimitiveType}} + socket->writeJson(resDoc);{{#isPrimitiveType}} + socket->write({{#isListContainer}}QString("["+{{/isListContainer}}::{{cppNamespace}}::toStringValue(res){{#isListContainer}}+"]"){{/isListContainer}}.toUtf8());{{/isPrimitiveType}}{{/returnType}}{{^returnType}} + socket->setStatusCode(QHttpEngine::Socket::OK);{{/returnType}} if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -{{/operation}}{{/operations}} -{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}{{{returnType}}} res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); +{{/operation}}{{/operations}} +{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders();{{#returnType}} + Q_UNUSED(error_str); // response will be used instead of error string{{^isPrimitiveType}} + QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).to{{^isListContainer}}Object{{/isListContainer}}{{#isListContainer}}Array{{/isListContainer}}());{{/isPrimitiveType}} + socket->writeJson(resDoc);{{#isPrimitiveType}} + socket->write({{#isListContainer}}QString("["+{{/isListContainer}}::{{cppNamespace}}::toStringValue(res){{#isListContainer}}+"]"){{/isListContainer}}.toUtf8());{{/isPrimitiveType}}{{/returnType}}{{^returnType}} socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8());{{/returnType}} if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + {{/operation}}{{/operations}} - - +void {{classname}}Request::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} + +void {{classname}}Request::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} {{#cppNamespaceDeclarations}} } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache index 994f68350c..ed7339278a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache @@ -1,9 +1,10 @@ {{>licenseInfo}} -#ifndef _{{prefix}}_{{classname}}Request_H_ -#define _{{prefix}}_{{classname}}Request_H_ +#ifndef {{prefix}}_{{classname}}Request_H +#define {{prefix}}_{{classname}}Request_H #include #include +#include #include #include @@ -24,30 +25,47 @@ public: {{classname}}Request(QHttpEngine::Socket *s, {{classname}}Handler* handler); virtual ~{{classname}}Request(); - {{#operations}}{{#operation}}void {{nickname}}Request({{#hasPathParams}}{{#pathParams}}QString {{{paramName}}}{{/pathParams}}{{/hasPathParams}}); + {{#operations}}{{#operation}}void {{nickname}}Request({{#hasPathParams}}{{#pathParams}}const QString& {{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}{{/hasPathParams}}); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}Response({{#returnType}}{{{returnType}}} res{{/returnType}}); + {{#operations}}{{#operation}}void {{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}Error({{#returnType}}{{{returnType}}} res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); + {{#operations}}{{#operation}}void {{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); {{/operation}}{{/operations}} - QMap getDefaultHeaders(); + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + QHttpEngine::Socket* getRawSocket(); + void setResponseHeaders(const QMultiMap& headers); + signals: {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}}{{/operations}} private: - QMap defaultHeaders; + QMap requestHeaders; + QMap responseHeaders; QHttpEngine::Socket *socket; {{classname}}Handler *handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } }; {{#cppNamespaceDeclarations}} } {{/cppNamespaceDeclarations}} -#endif // _{{prefix}}_{{classname}}Request_H_ +#endif // {{prefix}}_{{classname}}Request_H diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.cpp.mustache index e789b68a2b..be6c0bb072 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.cpp.mustache @@ -58,10 +58,8 @@ void ApiRouter::setUpRoutes() { void ApiRouter::processRequest(QHttpEngine::Socket *socket){ if (Routes.contains(socket->path())) { - auto itr = Routes.find(socket->path()); - while (itr != Routes.end() && itr.key() == socket->path()) { - itr.value().operator()(socket); - ++itr; + for(auto endpoints : Routes.values(socket->path())) { + endpoints.operator()(socket); } } else { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#pathParams}} @@ -77,7 +75,7 @@ void ApiRouter::processRequest(QHttpEngine::Socket *socket){ if ((toQHttpEngineMethod("{{httpMethod}}") == socket->method()) && match.hasMatch() ) { QString pathparam = match.captured(1); auto reqObj = new {{classname}}Request(socket, {{classname}}ApiHandler); - reqObj->{{nickname}}Request({{#hasPathParams}}{{#pathParams}}pathparam{{/pathParams}}{{/hasPathParams}});; + reqObj->{{nickname}}Request({{#hasPathParams}}{{#pathParams}}pathparam{{/pathParams}}{{/hasPathParams}}); return; } }{{/pathParams}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache index 92f0b96c17..167676df65 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache @@ -28,23 +28,17 @@ namespace {{this}} { QString toStringValue(const double &value); template - QList toStringValue(const QList &val) { - QList strArray; + QString toStringValue(const QList &val) { + QString strArray; for(auto item : val) { - strArray.append(toStringValue(item)); + strArray.append(toStringValue(item) + ","); + } + if(val.count() > 0) { + strArray.chop(1); } return strArray; } - template - QMap toStringValue(const QMap &val) { - QMap strMap; - for(auto itemkey : val.keys()) { - strMap.insert(itemkey, toStringValue(val.value(itemkey))); - } - return strMap; - } - QJsonValue toJsonValue(const QString &value); QJsonValue toJsonValue(const QDateTime &value); QJsonValue toJsonValue(const QByteArray &value); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache index f95bbcffec..c030bcb47f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache @@ -72,6 +72,7 @@ int main(int argc, char * argv[]) QSharedPointer<{{cppNamespace}}::RequestHandler> handler(new {{cppNamespace}}::RequestHandler()); {{cppNamespace}}::ApiRouter router; + router.setUpRoutes(); QObject::connect(handler.data(), &{{cppNamespace}}::RequestHandler::requestReceived, [&](QHttpEngine::Socket *socket) { router.processRequest(socket); }); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache index 6ba6d398b0..b83b21a012 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache @@ -90,7 +90,7 @@ QJsonObject {{#vars}} {{{dataType}}} -{{classname}}::{{getter}}() { +{{classname}}::{{getter}}() const { return {{name}}; } void diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache index 8050d281ec..4c8ec537f8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache @@ -5,8 +5,8 @@ * {{description}} */ -#ifndef {{classname}}_H_ -#define {{classname}}_H_ +#ifndef {{classname}}_H +#define {{classname}}_H #include @@ -35,7 +35,7 @@ public: void fromJson(QString jsonString) override; {{#vars}} - {{{dataType}}} {{getter}}(); + {{{dataType}}} {{getter}}() const; void {{setter}}(const {{{dataType}}} &{{name}}); {{/vars}} @@ -53,6 +53,6 @@ private: } {{/cppNamespaceDeclarations}} -#endif /* {{classname}}_H_ */ +#endif // {{classname}}_H {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/.env.example b/modules/openapi-generator/src/main/resources/php-laravel/.env.example new file mode 100644 index 0000000000..ec44a1259f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/.env.example @@ -0,0 +1,39 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=homestead +DB_USERNAME=homestead +DB_PASSWORD=secret + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +SESSION_DRIVER=file +SESSION_LIFETIME=120 +QUEUE_DRIVER=sync + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/modules/openapi-generator/src/main/resources/php-laravel/README.md b/modules/openapi-generator/src/main/resources/php-laravel/README.md new file mode 100644 index 0000000000..76ceb65d21 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/README.md @@ -0,0 +1,23 @@ +# OpenAPI generated server + +## Overview +This server was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a PHP server. + +This example uses the [laravel Framework](http://laravel.com/). To see how to make this your own, please take a look at the template here: + +## Installation & Usage +### Composer + +Using `composer install` to install the framework and dependencies via [Composer](http://getcomposer.org/). + +### post installation steps + +Change into application folder and execute following commands to get started: + +```sh +cp .env.example .env +php artisan key:generate +php artisan serve +``` \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-laravel/api.mustache b/modules/openapi-generator/src/main/resources/php-laravel/api.mustache new file mode 100644 index 0000000000..d81fa2b9ff --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/api.mustache @@ -0,0 +1,128 @@ +licenseInfo}} + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +{{#operations}}class {{classname}} extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + {{#operation}} + /** + * Operation {{{operationId}}} + * + * {{{summary}}}. + * + {{#pathParams}} * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/pathParams}} * + * @return Http response + */ + public function {{operationId}}({{#pathParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) + { + $input = Request::all(); + + //path params validation + {{#pathParams}} + {{#hasValidation}} + {{#maxLength}} + if (strlen(${{paramName}}) > {{maxLength}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + } + {{/maxLength}} + {{#minLength}} + if (strlen(${{paramName}}) < {{minLength}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if (${{paramName}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) { + throw new \InvalidArgumentException('invalid value for ${{paramName}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if (${{paramName}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) { + throw new \InvalidArgumentException('invalid value for ${{paramName}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if (!preg_match("{{{pattern}}}", ${{paramName}})) { + throw new \InvalidArgumentException('invalid value for ${{paramName}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.'); + } + {{/pattern}} + {{#maxItems}} + if (count(${{paramName}}) > {{maxItems}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + } + {{/maxItems}} + {{#minItems}} + if (count(${{paramName}}) < {{minItems}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + {{/hasValidation}} + {{/pathParams}} + + + //not path params validation + {{#allParams}} + {{^pathParams}} + {{#required}} + if (!isset($input['{{paramName}}'])) { + throw new \InvalidArgumentException('Missing the required parameter ${{paramName}} when calling {{operationId}}'); + } + {{/required}} + {{#hasValidation}} + {{#maxLength}} + if (strlen($input['{{paramName}}']) > {{maxLength}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + } + {{/maxLength}} + {{#minLength}} + if (strlen($input['{{paramName}}']) < {{minLength}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if ($input['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) { + throw new \InvalidArgumentException('invalid value for ${{paramName}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if ($input['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) { + throw new \InvalidArgumentException('invalid value for ${{paramName}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if (!preg_match("{{{pattern}}}", $input['{{paramName}}'])) { + throw new \InvalidArgumentException('invalid value for ${{paramName}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.'); + } + {{/pattern}} + {{#maxItems}} + if (count($input['{{paramName}}']) > {{maxItems}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + } + {{/maxItems}} + {{#minItems}} + if (count($input['{{paramName}}']) < {{minItems}}) { + throw new \InvalidArgumentException('invalid length for ${{paramName}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + {{/hasValidation}} + ${{paramName}} = $input['{{paramName}}']; + + {{/pathParams}} + {{/allParams}} + + return response('How about implementing {{nickname}} as a {{httpMethod}} method ?'); + } + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/app/Console/Kernel.php b/modules/openapi-generator/src/main/resources/php-laravel/app/Console/Kernel.php new file mode 100644 index 0000000000..a8c5158593 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/app/Console/Kernel.php @@ -0,0 +1,42 @@ +command('inspire') + // ->hourly(); + } + + /** + * Register the commands for the application. + * + * @return void + */ + protected function commands() + { + $this->load(__DIR__.'/Commands'); + + require base_path('routes/console.php'); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/app/Exceptions/Handler.php b/modules/openapi-generator/src/main/resources/php-laravel/app/Exceptions/Handler.php new file mode 100644 index 0000000000..043cad6bcc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/app/Exceptions/Handler.php @@ -0,0 +1,51 @@ + [ + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + // \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + + 'api' => [ + 'throttle:60,1', + 'bindings', + ], + ]; + + /** + * The application's route middleware. + * + * These middleware may be assigned to groups or used individually. + * + * @var array + */ + protected $routeMiddleware = [ + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + ]; +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/app/Http/Middleware/EncryptCookies.php b/modules/openapi-generator/src/main/resources/php-laravel/app/Http/Middleware/EncryptCookies.php new file mode 100644 index 0000000000..033136ad12 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/app/Http/Middleware/EncryptCookies.php @@ -0,0 +1,17 @@ +check()) { + return redirect('/home'); + } + + return $next($request); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/app/Http/Middleware/TrimStrings.php b/modules/openapi-generator/src/main/resources/php-laravel/app/Http/Middleware/TrimStrings.php new file mode 100644 index 0000000000..5a50e7b5c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/app/Http/Middleware/TrimStrings.php @@ -0,0 +1,18 @@ + 'App\Policies\ModelPolicy', + ]; + + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + // + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/app/Providers/BroadcastServiceProvider.php b/modules/openapi-generator/src/main/resources/php-laravel/app/Providers/BroadcastServiceProvider.php new file mode 100644 index 0000000000..352cce44a3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/app/Providers/BroadcastServiceProvider.php @@ -0,0 +1,21 @@ + [ + 'App\Listeners\EventListener', + ], + ]; + + /** + * Register any events for your application. + * + * @return void + */ + public function boot() + { + parent::boot(); + + // + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/app/Providers/RouteServiceProvider.php b/modules/openapi-generator/src/main/resources/php-laravel/app/Providers/RouteServiceProvider.php new file mode 100644 index 0000000000..b36415e85f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/app/Providers/RouteServiceProvider.php @@ -0,0 +1,72 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + + // + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->namespace) + ->group(base_path('routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/artisan b/modules/openapi-generator/src/main/resources/php-laravel/artisan new file mode 100644 index 0000000000..5c23e2e24f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/artisan @@ -0,0 +1,53 @@ +#!/usr/bin/env php +make(Illuminate\Contracts\Console\Kernel::class); + +$status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput +); + +/* +|-------------------------------------------------------------------------- +| Shutdown The Application +|-------------------------------------------------------------------------- +| +| Once Artisan has finished running, we will fire off the shutdown events +| so that any final work may be done by the application before we shut +| down the process. This is the last thing to happen to the request. +| +*/ + +$kernel->terminate($input, $status); + +exit($status); diff --git a/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/app.php b/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/app.php new file mode 100644 index 0000000000..f2801adf6f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/app.php @@ -0,0 +1,55 @@ +singleton( + Illuminate\Contracts\Http\Kernel::class, + App\Http\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +/* +|-------------------------------------------------------------------------- +| Return The Application +|-------------------------------------------------------------------------- +| +| This script returns the application instance. The instance is given to +| the calling script so we can separate the building of the instances +| from the actual running of the application and sending responses. +| +*/ + +return $app; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/cache/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/cache/.gitignore new file mode 100755 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/testingAutoload.php b/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/testingAutoload.php new file mode 100644 index 0000000000..30a59f187e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/bootstrap/testingAutoload.php @@ -0,0 +1,6 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services your application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ + + 'locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ + + 'fallback_locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ + + 'key' => env('APP_KEY'), + + 'cipher' => 'AES-256-CBC', + + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ + + 'providers' => [ + + /* + * Laravel Framework Service Providers... + */ + Illuminate\Auth\AuthServiceProvider::class, + Illuminate\Broadcasting\BroadcastServiceProvider::class, + Illuminate\Bus\BusServiceProvider::class, + Illuminate\Cache\CacheServiceProvider::class, + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + Illuminate\Cookie\CookieServiceProvider::class, + Illuminate\Database\DatabaseServiceProvider::class, + Illuminate\Encryption\EncryptionServiceProvider::class, + Illuminate\Filesystem\FilesystemServiceProvider::class, + Illuminate\Foundation\Providers\FoundationServiceProvider::class, + Illuminate\Hashing\HashServiceProvider::class, + Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, + Illuminate\Pagination\PaginationServiceProvider::class, + Illuminate\Pipeline\PipelineServiceProvider::class, + Illuminate\Queue\QueueServiceProvider::class, + Illuminate\Redis\RedisServiceProvider::class, + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + Illuminate\Session\SessionServiceProvider::class, + Illuminate\Translation\TranslationServiceProvider::class, + Illuminate\Validation\ValidationServiceProvider::class, + Illuminate\View\ViewServiceProvider::class, + + /* + * Package Service Providers... + */ + + /* + * Application Service Providers... + */ + App\Providers\AppServiceProvider::class, + App\Providers\AuthServiceProvider::class, + // App\Providers\BroadcastServiceProvider::class, + App\Providers\EventServiceProvider::class, + App\Providers\RouteServiceProvider::class, + + ], + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ + + 'aliases' => [ + + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Notification' => Illuminate\Support\Facades\Notification::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/auth.php b/modules/openapi-generator/src/main/resources/php-laravel/config/auth.php new file mode 100644 index 0000000000..7817501025 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/auth.php @@ -0,0 +1,102 @@ + [ + 'guard' => 'web', + 'passwords' => 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\User::class, + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => 'password_resets', + 'expire' => 60, + ], + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/broadcasting.php b/modules/openapi-generator/src/main/resources/php-laravel/config/broadcasting.php new file mode 100644 index 0000000000..3ca45eaa85 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/broadcasting.php @@ -0,0 +1,59 @@ + env('BROADCAST_DRIVER', 'null'), + + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | + */ + + 'connections' => [ + + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'encrypted' => true, + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/cache.php b/modules/openapi-generator/src/main/resources/php-laravel/config/cache.php new file mode 100644 index 0000000000..fa12e5e4f7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/cache.php @@ -0,0 +1,94 @@ + env('CACHE_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + */ + + 'stores' => [ + + 'apc' => [ + 'driver' => 'apc', + ], + + 'array' => [ + 'driver' => 'array', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', + 'connection' => null, + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ + + 'prefix' => env( + 'CACHE_PREFIX', + str_slug(env('APP_NAME', 'laravel'), '_').'_cache' + ), + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/database.php b/modules/openapi-generator/src/main/resources/php-laravel/config/database.php new file mode 100644 index 0000000000..cab5d068f7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/database.php @@ -0,0 +1,120 @@ + env('DB_CONNECTION', 'mysql'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ + + 'connections' => [ + + 'sqlite' => [ + 'driver' => 'sqlite', + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'strict' => true, + 'engine' => null, + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | + */ + + 'migrations' => 'migrations', + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer set of commands than a typical key-value systems + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ + + 'redis' => [ + + 'client' => 'predis', + + 'default' => [ + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', 6379), + 'database' => 0, + ], + + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/filesystems.php b/modules/openapi-generator/src/main/resources/php-laravel/config/filesystems.php new file mode 100644 index 0000000000..77fa5ded1d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/filesystems.php @@ -0,0 +1,69 @@ + env('FILESYSTEM_DRIVER', 'local'), + + /* + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | + */ + + 'cloud' => env('FILESYSTEM_CLOUD', 's3'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'public', + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + ], + + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/hashing.php b/modules/openapi-generator/src/main/resources/php-laravel/config/hashing.php new file mode 100644 index 0000000000..d3c8e2fb22 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/hashing.php @@ -0,0 +1,52 @@ + 'bcrypt', + + /* + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'bcrypt' => [ + 'rounds' => env('BCRYPT_ROUNDS', 10), + ], + + /* + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'argon' => [ + 'memory' => 1024, + 'threads' => 2, + 'time' => 2, + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/logging.php b/modules/openapi-generator/src/main/resources/php-laravel/config/logging.php new file mode 100644 index 0000000000..400bc7f464 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/logging.php @@ -0,0 +1,81 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | + */ + + 'channels' => [ + 'stack' => [ + 'driver' => 'stack', + 'channels' => ['single'], + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 7, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => 'Laravel Log', + 'emoji' => ':boom:', + 'level' => 'critical', + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'with' => [ + 'stream' => 'php://stderr', + ], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => 'debug', + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => 'debug', + ], + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/mail.php b/modules/openapi-generator/src/main/resources/php-laravel/config/mail.php new file mode 100644 index 0000000000..bb92224c59 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/mail.php @@ -0,0 +1,123 @@ + env('MAIL_DRIVER', 'smtp'), + + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Mailgun mail service which will provide reliable deliveries. + | + */ + + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to deliver e-mails to + | users of the application. Like the host we have set this value to + | stay compatible with the Mailgun e-mail application by default. + | + */ + + 'port' => env('MAIL_PORT', 587), + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], + + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ + + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ + + 'username' => env('MAIL_USERNAME'), + + 'password' => env('MAIL_PASSWORD'), + + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ + + 'sendmail' => '/usr/sbin/sendmail -bs', + + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ + + 'markdown' => [ + 'theme' => 'default', + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/queue.php b/modules/openapi-generator/src/main/resources/php-laravel/config/queue.php new file mode 100644 index 0000000000..391304f363 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/queue.php @@ -0,0 +1,86 @@ + env('QUEUE_DRIVER', 'sync'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('SQS_KEY', 'your-public-key'), + 'secret' => env('SQS_SECRET', 'your-secret-key'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'region' => env('SQS_REGION', 'us-east-1'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => null, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ + + 'failed' => [ + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/services.php b/modules/openapi-generator/src/main/resources/php-laravel/config/services.php new file mode 100644 index 0000000000..aa1f7f82ca --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/services.php @@ -0,0 +1,38 @@ + [ + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), + ], + + 'ses' => [ + 'key' => env('SES_KEY'), + 'secret' => env('SES_SECRET'), + 'region' => env('SES_REGION', 'us-east-1'), + ], + + 'sparkpost' => [ + 'secret' => env('SPARKPOST_SECRET'), + ], + + 'stripe' => [ + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), + 'secret' => env('STRIPE_SECRET'), + ], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/session.php b/modules/openapi-generator/src/main/resources/php-laravel/config/session.php new file mode 100644 index 0000000000..736fb3c79e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/session.php @@ -0,0 +1,197 @@ + env('SESSION_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | + */ + + 'lifetime' => env('SESSION_LIFETIME', 120), + + 'expire_on_close' => false, + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | + */ + + 'encrypt' => false, + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => null, + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | + */ + + 'table' => 'sessions', + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using the "apc" or "memcached" session drivers, you may specify a + | cache store that should be used for these sessions. This value must + | correspond with one of the application's configured cache stores. + | + */ + + 'store' => null, + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + str_slug(env('APP_NAME', 'laravel'), '_').'_session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | + */ + + 'path' => '/', + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | + */ + + 'domain' => env('SESSION_DOMAIN', null), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE', false), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | + */ + + 'http_only' => true, + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | do not enable this as other CSRF protection services are in place. + | + | Supported: "lax", "strict" + | + */ + + 'same_site' => null, + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/config/view.php b/modules/openapi-generator/src/main/resources/php-laravel/config/view.php new file mode 100644 index 0000000000..2acfd9cc9c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/config/view.php @@ -0,0 +1,33 @@ + [ + resource_path('views'), + ], + + /* + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | + */ + + 'compiled' => realpath(storage_path('framework/views')), + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/database/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/database/.gitignore new file mode 100644 index 0000000000..9b1dffd90f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/database/.gitignore @@ -0,0 +1 @@ +*.sqlite diff --git a/modules/openapi-generator/src/main/resources/php-laravel/database/factories/UserFactory.php b/modules/openapi-generator/src/main/resources/php-laravel/database/factories/UserFactory.php new file mode 100644 index 0000000000..facf2337b9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/database/factories/UserFactory.php @@ -0,0 +1,23 @@ +define(App\User::class, function (Faker $faker) { + return [ + 'name' => $faker->name, + 'email' => $faker->unique()->safeEmail, + 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret + 'remember_token' => str_random(10), + ]; +}); diff --git a/modules/openapi-generator/src/main/resources/php-laravel/database/migrations/2014_10_12_000000_create_users_table.php b/modules/openapi-generator/src/main/resources/php-laravel/database/migrations/2014_10_12_000000_create_users_table.php new file mode 100644 index 0000000000..689cbeea47 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/database/migrations/2014_10_12_000000_create_users_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->string('name'); + $table->string('email')->unique(); + $table->string('password'); + $table->rememberToken(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('users'); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php b/modules/openapi-generator/src/main/resources/php-laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php new file mode 100644 index 0000000000..0d5cb84502 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -0,0 +1,32 @@ +string('email')->index(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('password_resets'); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/database/seeds/DatabaseSeeder.php b/modules/openapi-generator/src/main/resources/php-laravel/database/seeds/DatabaseSeeder.php new file mode 100644 index 0000000000..91cb6d1c2d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/database/seeds/DatabaseSeeder.php @@ -0,0 +1,16 @@ +call(UsersTableSeeder::class); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache new file mode 100644 index 0000000000..e4782c78fc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache @@ -0,0 +1,15 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Source files are located at: + * + * > swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ diff --git a/modules/openapi-generator/src/main/resources/php-laravel/model.mustache b/modules/openapi-generator/src/main/resources/php-laravel/model.mustache new file mode 100644 index 0000000000..94fd28ef53 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/model.mustache @@ -0,0 +1,18 @@ + + + + + ./tests/Feature + + + + ./tests/Unit + + + + + ./app + + + + + + + + + + + diff --git a/modules/openapi-generator/src/main/resources/php-laravel/public/.htaccess b/modules/openapi-generator/src/main/resources/php-laravel/public/.htaccess new file mode 100644 index 0000000000..b75525bedc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/public/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Handle Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/modules/openapi-generator/src/main/resources/php-laravel/public/css/app.css b/modules/openapi-generator/src/main/resources/php-laravel/public/css/app.css new file mode 100644 index 0000000000..8b4dc7e9e9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/public/css/app.css @@ -0,0 +1,6 @@ +@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);/*! + * Bootstrap v4.0.0 (https://getbootstrap.com) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:"Raleway",sans-serif;--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:Raleway,sans-serif;font-size:.9rem;font-weight:400;line-height:1.6;color:#212529;text-align:left;background-color:#f5f8fa}[tabindex="-1"]:focus{outline:0!important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{font-style:normal;line-height:inherit}address,dl,ol,ul{margin-bottom:1rem}dl,ol,ul{margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]),a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.25rem}.h2,h2{font-size:1.8rem}.h3,h3{font-size:1.575rem}.h4,h4{font-size:1.35rem}.h5,h5{font-size:1.125rem}.h6,h6{font-size:.9rem}.lead{font-size:1.125rem;font-weight:300}.display-1{font-size:6rem}.display-1,.display-2{font-weight:300;line-height:1.2}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-3,.display-4{font-weight:300;line-height:1.2}.display-4{font-size:3.5rem}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.125rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer:before{content:"\2014 \A0"}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#f5f8fa;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-auto,.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-auto,.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-auto,.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1,.col-auto{-webkit-box-flex:0}.col-1{-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-2{-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-2,.col-3{-webkit-box-flex:0}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-4,.col-5{-webkit-box-flex:0}.col-5{-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-6,.col-7{-webkit-box-flex:0}.col-7{-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-8{-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-8,.col-9{-webkit-box-flex:0}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-10,.col-11{-webkit-box-flex:0}.col-11{-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table .table{background-color:#f5f8fa}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover,.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover,.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover,.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover,.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover,.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover,.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#f5f8fa;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#f5f8fa;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:hsla(0,0%,100%,.05)}.table-dark.table-hover tbody tr:hover{background-color:hsla(0,0%,100%,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:.9rem;line-height:1.6;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder,.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.19rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.6}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.125rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.7875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.6;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.input-group-append>.form-control-plaintext.btn,.input-group-lg>.input-group-append>.form-control-plaintext.input-group-text,.input-group-lg>.input-group-prepend>.form-control-plaintext.btn,.input-group-lg>.input-group-prepend>.form-control-plaintext.input-group-text,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.input-group-append>.form-control-plaintext.btn,.input-group-sm>.input-group-append>.form-control-plaintext.input-group-text,.input-group-sm>.input-group-prepend>.form-control-plaintext.btn,.input-group-sm>.input-group-prepend>.form-control-plaintext.input-group-text{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.7875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.68125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.125rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.6875rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(40,167,69,.8);border-radius:.2rem}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.25);box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{background-color:#71dd8a}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{-webkit-box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(40,167,69,.25);box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(40,167,69,.25)}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label:before,.was-validated .custom-file-input:valid~.custom-file-label:before{border-color:inherit}.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip{display:block}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.25);box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(220,53,69,.8);border-radius:.2rem}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.25);box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label:before,.was-validated .custom-control-input:invalid~.custom-control-label:before{background-color:#efa2a9}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid:checked~.custom-control-label:before,.was-validated .custom-control-input:invalid:checked~.custom-control-label:before{background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label:before,.was-validated .custom-control-input:invalid:focus~.custom-control-label:before{-webkit-box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(220,53,69,.25);box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(220,53,69,.25)}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label:before,.was-validated .custom-file-input:invalid~.custom-file-label:before{border-color:inherit}.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip{display:block}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.25);box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .form-group,.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;align-items:center;margin-bottom:0}.form-inline .form-group{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:.9rem;line-height:1.6;border-radius:.25rem;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}.btn:not(:disabled):not(.disabled).active,.btn:not(:disabled):not(.disabled):active{background-image:none}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-primary{color:#007bff;background-color:transparent;background-image:none;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;background-color:transparent;background-image:none;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-outline-success{color:#28a745;background-color:transparent;background-image:none;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;background-color:transparent;background-image:none;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;background-color:transparent;background-image:none;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;background-color:transparent;background-image:none;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;background-color:transparent}.btn-link:hover{color:#0056b3;background-color:transparent}.btn-link.focus,.btn-link:focus,.btn-link:hover{text-decoration:underline;border-color:transparent}.btn-link.focus,.btn-link:focus{-webkit-box-shadow:none;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.125rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.7875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.show{opacity:1}.collapse{display:none}.collapse.show{display:block}tr.collapse.show{display:table-row}tbody.collapse.show{display:table-row-group}.collapsing{height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}.collapsing,.dropdown,.dropup{position:relative}.dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:.9rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropup .dropdown-menu{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-menu{margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-toggle:after{vertical-align:0}.dropleft .dropdown-menu{margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropleft .dropdown-toggle:before{display:inline-block;width:0;height:0;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty:after{margin-left:0}.dropleft .dropdown-toggle:before{vertical-align:0}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.7875rem;color:#6c757d;white-space:nowrap}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group,.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split:after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio],.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file:focus,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label:before{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:first-child) .custom-file-label:before{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:.9rem;font-weight:400;line-height:1.6;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.6rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label:before{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-label:before{-webkit-box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:active~.custom-control-label:before{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label:before{background-color:#e9ecef}.custom-control-label{margin-bottom:0}.custom-control-label:before{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#dee2e6}.custom-control-label:after,.custom-control-label:before{position:absolute;top:.3rem;left:0;display:block;width:1rem;height:1rem;content:""}.custom-control-label:after{background-repeat:no-repeat;background-position:50%;background-size:50% 50%}.custom-checkbox .custom-control-label:before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label:before{background-color:#007bff}.custom-checkbox .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:before{background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label:before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label:before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(2.19rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.6;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 5px rgba(128,189,255,.5);box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 5px rgba(128,189,255,.5)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.68125rem + 2px);font-size:75%}.custom-select-lg,.custom-select-sm{padding-top:.375rem;padding-bottom:.375rem}.custom-select-lg{height:calc(2.6875rem + 2px);font-size:125%}.custom-file{display:inline-block;margin-bottom:0}.custom-file,.custom-file-input{position:relative;width:100%;height:calc(2.19rem + 2px)}.custom-file-input{z-index:2;margin:0;opacity:0}.custom-file-input:focus~.custom-file-control{border-color:#80bdff;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:focus~.custom-file-control:before{border-color:#80bdff}.custom-file-input:lang(en)~.custom-file-label:after{content:"Browse"}.custom-file-label{left:0;z-index:1;height:calc(2.19rem + 2px);background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label,.custom-file-label:after{position:absolute;top:0;right:0;padding:.375rem .75rem;line-height:1.6;color:#495057}.custom-file-label:after{bottom:0;z-index:3;display:block;height:calc((2.19rem + 2px) - 1px * 2);content:"Browse";background-color:#e9ecef;border-left:1px solid #ced4da;border-radius:0 .25rem .25rem 0}.nav{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#f5f8fa;border-color:#dee2e6 #dee2e6 #f5f8fa}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar,.navbar>.container,.navbar>.container-fluid{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.32rem;padding-bottom:.32rem;margin-right:1rem;font-size:1.125rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.125rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler:not(:disabled):not(.disabled){cursor:pointer}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat 50%;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm,.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md,.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg,.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl,.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .dropup .dropdown-menu{top:auto;bottom:100%}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .dropup .dropdown-menu{top:auto;bottom:100%}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:hsla(0,0%,100%,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:hsla(0,0%,100%,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:hsla(0,0%,100%,.5);border-color:hsla(0,0%,100%,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem}.card-subtitle,.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.75rem;border-bottom:0}.card-header-pills,.card-header-tabs{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-webkit-box-orient:horizontal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck,.card-deck .card{-webkit-box-direction:normal}.card-deck .card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:first-child .card-header,.card-group>.card:first-child .card-img-top{border-top-right-radius:0}.card-group>.card:first-child .card-footer,.card-group>.card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:last-child .card-header,.card-group>.card:last-child .card-img-top{border-top-left-radius:0}.card-group>.card:last-child .card-footer,.card-group>.card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.25rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child),.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item:before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover:before{text-decoration:underline;text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-link:not(:disabled):not(.disabled){cursor:pointer}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.125rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.7875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#6c757d}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#545b62}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#212529;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#212529;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3.85rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}.progress{height:1rem;overflow:hidden;font-size:.675rem;background-color:#e9ecef;border-radius:.25rem}.progress,.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex}.progress-bar{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;background-color:#007bff;-webkit-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{z-index:1;text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.35rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}.close:not(:disabled):not(.disabled){cursor:pointer}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}.modal,.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;outline:0}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translateY(-25%);transform:translateY(-25%)}.modal.show .modal-dialog{-webkit-transform:translate(0);transform:translate(0)}.modal-dialog-centered{-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-content,.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex}.modal-content{position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.6}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.7875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow:before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow:before,.bs-tooltip-top .arrow:before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow:before,.bs-tooltip-right .arrow:before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow:before,.bs-tooltip-bottom .arrow:before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow:before,.bs-tooltip-left .arrow:before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{top:0;left:0;z-index:1060;max-width:276px;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.7875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover,.popover .arrow{position:absolute;display:block}.popover .arrow{width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow:after,.popover .arrow:before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow:after,.bs-popover-auto[x-placement^=top] .arrow:before,.bs-popover-top .arrow:after,.bs-popover-top .arrow:before{border-width:.5rem .5rem 0}.bs-popover-auto[x-placement^=top] .arrow:before,.bs-popover-top .arrow:before{bottom:0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top] .arrow:after,.bs-popover-top .arrow:after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right] .arrow:after,.bs-popover-auto[x-placement^=right] .arrow:before,.bs-popover-right .arrow:after,.bs-popover-right .arrow:before{border-width:.5rem .5rem .5rem 0}.bs-popover-auto[x-placement^=right] .arrow:before,.bs-popover-right .arrow:before{left:0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right] .arrow:after,.bs-popover-right .arrow:after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow:after,.bs-popover-auto[x-placement^=bottom] .arrow:before,.bs-popover-bottom .arrow:after,.bs-popover-bottom .arrow:before{border-width:0 .5rem .5rem}.bs-popover-auto[x-placement^=bottom] .arrow:before,.bs-popover-bottom .arrow:before{top:0;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom] .arrow:after,.bs-popover-bottom .arrow:after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header:before,.bs-popover-bottom .popover-header:before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left] .arrow:after,.bs-popover-auto[x-placement^=left] .arrow:before,.bs-popover-left .arrow:after,.bs-popover-left .arrow:before{border-width:.5rem 0 .5rem .5rem}.bs-popover-auto[x-placement^=left] .arrow:before,.bs-popover-left .arrow:before{right:0;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left] .arrow:after,.bs-popover-left .arrow:after{right:1px;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:.9rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;-webkit-transition:-webkit-transform .6s ease;transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateZ(0);transform:translateZ(0)}}.active.carousel-item-right,.carousel-item-next{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-right,.carousel-item-next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat 50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:hsla(0,0%,100%,.5)}.carousel-indicators li:before{top:-10px}.carousel-indicators li:after,.carousel-indicators li:before{position:absolute;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li:after{bottom:-10px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important}.rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0!important}.clearfix:after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive:before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9:before{padding-top:42.85714286%}.embed-responsive-16by9:before{padding-top:56.25%}.embed-responsive-4by3:before{padding-top:75%}.embed-responsive-1by1:before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-column,.flex-row{-webkit-box-direction:normal!important}.flex-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-webkit-box-orient:horizontal!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse,.flex-row-reverse{-webkit-box-direction:reverse!important}.flex-column-reverse{-webkit-box-orient:vertical!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column,.flex-sm-row{-webkit-box-direction:normal!important}.flex-sm-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column,.flex-md-row{-webkit-box-direction:normal!important}.flex-md-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column,.flex-lg-row{-webkit-box-direction:normal!important}.flex-lg-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column,.flex-xl-row{-webkit-box-direction:normal!important}.flex-xl-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{top:0}.fixed-bottom,.fixed-top{position:fixed;right:0;left:0;z-index:1030}.fixed-bottom{bottom:0}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;-webkit-clip-path:inset(50%);clip-path:inset(50%);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;-webkit-clip-path:none;clip-path:none}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#545b62!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-muted{color:#6c757d!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,:after,:before{text-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]:after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}.container,body{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.navbar-laravel{background-color:#fff;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.04);box-shadow:0 2px 4px rgba(0,0,0,.04)} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-laravel/public/favicon.ico b/modules/openapi-generator/src/main/resources/php-laravel/public/favicon.ico new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/openapi-generator/src/main/resources/php-laravel/public/index.php b/modules/openapi-generator/src/main/resources/php-laravel/public/index.php new file mode 100644 index 0000000000..4584cbcd6a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/public/index.php @@ -0,0 +1,60 @@ + + */ + +define('LARAVEL_START', microtime(true)); + +/* +|-------------------------------------------------------------------------- +| Register The Auto Loader +|-------------------------------------------------------------------------- +| +| Composer provides a convenient, automatically generated class loader for +| our application. We just need to utilize it! We'll simply require it +| into the script here so that we don't have to worry about manual +| loading any of our classes later on. It feels great to relax. +| +*/ + +require __DIR__.'/../vendor/autoload.php'; + +/* +|-------------------------------------------------------------------------- +| Turn On The Lights +|-------------------------------------------------------------------------- +| +| We need to illuminate PHP development, so let us turn on the lights. +| This bootstraps the framework and gets it ready for use, then it +| will load up this application so that we can run it and send +| the responses back to the browser and delight our users. +| +*/ + +$app = require_once __DIR__.'/../bootstrap/app.php'; + +/* +|-------------------------------------------------------------------------- +| Run The Application +|-------------------------------------------------------------------------- +| +| Once we have the application, we can handle the incoming request +| through the kernel, and send the associated response back to +| the client's browser allowing them to enjoy the creative +| and wonderful application we have prepared for them. +| +*/ + +$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); + +$response = $kernel->handle( + $request = Illuminate\Http\Request::capture() +); + +$response->send(); + +$kernel->terminate($request, $response); diff --git a/modules/openapi-generator/src/main/resources/php-laravel/public/js/app.js b/modules/openapi-generator/src/main/resources/php-laravel/public/js/app.js new file mode 100644 index 0000000000..c5d3189712 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/public/js/app.js @@ -0,0 +1 @@ +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=n(5),i=n(19),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(o)}),t.exports=u}).call(e,n(6))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n="undefined"!=typeof window&&"undefined"!=typeof document,r=["Edge","Trident","Firefox"],i=0,o=0;o=0){i=1;break}var a=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},i))}};function s(t){return t&&"[object Function]"==={}.toString.call(t)}function u(t,e){if(1!==t.nodeType)return[];var n=getComputedStyle(t,null);return e?n[e]:n}function c(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function l(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=u(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/(auto|scroll)/.test(n+i+r)?t:l(c(t))}function f(t){var e=t&&t.offsetParent,n=e&&e.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(e.nodeName)&&"static"===u(e,"position")?f(e):e:t?t.ownerDocument.documentElement:document.documentElement}function p(t){return null!==t.parentNode?p(t.parentNode):t}function d(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,i=n?e:t,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,u=o.commonAncestorContainer;if(t!==u&&e!==u||r.contains(i))return"BODY"===(s=(a=u).nodeName)||"HTML"!==s&&f(a.firstElementChild)!==a?f(u):u;var c=p(t);return c.host?d(c.host,e):d(t,p(e).host)}function h(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var r=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||r)[e]}return t[e]}function v(t,e){var n="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+r+"Width"],10)}var g=void 0,m=function(){return void 0===g&&(g=-1!==navigator.appVersion.indexOf("MSIE 10")),g};function y(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],m()?n["offset"+t]+r["margin"+("Height"===t?"Top":"Left")]+r["margin"+("Height"===t?"Bottom":"Right")]:0)}function _(){var t=document.body,e=document.documentElement,n=m()&&getComputedStyle(e);return{height:y("Height",t,e,n),width:y("Width",t,e,n)}}var b=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=h(e,"top"),i=h(e,"left"),o=n?-1:1;return t.top+=r*o,t.bottom+=r*o,t.left+=i*o,t.right+=i*o,t}(p,e)),p}function S(t,e,n,r){var i,o,a,s,f,p,v,g={top:0,left:0},m=d(t,e);if("viewport"===r)o=(i=m).ownerDocument.documentElement,a=A(i,o),s=Math.max(o.clientWidth,window.innerWidth||0),f=Math.max(o.clientHeight,window.innerHeight||0),p=h(o),v=h(o,"left"),g=T({top:p-a.top+a.marginTop,left:v-a.left+a.marginLeft,width:s,height:f});else{var y=void 0;"scrollParent"===r?"BODY"===(y=l(c(e))).nodeName&&(y=t.ownerDocument.documentElement):y="window"===r?t.ownerDocument.documentElement:r;var b=A(y,m);if("HTML"!==y.nodeName||function t(e){var n=e.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===u(e,"position")||t(c(e)))}(m))g=b;else{var w=_(),x=w.height,C=w.width;g.top+=b.top-b.marginTop,g.bottom=x+b.top,g.left+=b.left-b.marginLeft,g.right=C+b.left}}return g.left+=n,g.top+=n,g.right-=n,g.bottom-=n,g}function k(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=S(n,r,o,i),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},u=Object.keys(s).map(function(t){return C({key:t},s[t],{area:(e=s[t],e.width*e.height)});var e}).sort(function(t,e){return e.area-t.area}),c=u.filter(function(t){var e=t.width,r=t.height;return e>=n.clientWidth&&r>=n.clientHeight}),l=c.length>0?c[0].key:u[0].key,f=t.split("-")[1];return l+(f?"-"+f:"")}function O(t,e,n){return A(n,d(e,n))}function D(t){var e=getComputedStyle(t),n=parseFloat(e.marginTop)+parseFloat(e.marginBottom),r=parseFloat(e.marginLeft)+parseFloat(e.marginRight);return{width:t.offsetWidth+r,height:t.offsetHeight+n}}function I(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function N(t,e,n){n=n.split("-")[0];var r=D(t),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",c=o?"width":"height";return i[a]=e[a]+e[u]/2-r[u]/2,i[s]=n===s?e[s]-r[c]:e[I(s)],i}function j(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function L(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var r=j(t,function(t){return t[e]===n});return t.indexOf(r)}(t,"name",n))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&s(n)&&(e.offsets.popper=T(e.offsets.popper),e.offsets.reference=T(e.offsets.reference),e=n(e,t))}),e}function $(t,e){return t.some(function(t){var n=t.name;return t.enabled&&n===e})}function R(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=U.indexOf(t),r=U.slice(n+1).concat(U.slice(0,n));return e?r.reverse():r}var V={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function K(t,e,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=t.split(/(\+|\-)/).map(function(t){return t.trim()}),s=a.indexOf(j(a,function(t){return-1!==t.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(c=c.map(function(t,r){var i=(1===r?!o:o)?"height":"width",a=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)},[]).map(function(t){return function(t,e,n,r){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return t;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return T(s)[e]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(t,i,e,n)})})).forEach(function(t,e){t.forEach(function(n,r){H(n)&&(i[e]+=n*("-"===t[r-1]?-1:1))})}),i}var Q={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",c=s?"width":"height",l={start:x({},u,o[u]),end:x({},u,o[u]+o[c]-a[c])};t.offsets.popper=C({},a,l[r])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,r=t.placement,i=t.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return u=H(+n)?[+n,0]:K(n,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||f(t.instance.popper);t.instance.reference===n&&(n=f(n));var r=S(t.instance.popper,t.instance.reference,e.padding,n);e.boundaries=r;var i=e.priority,o=t.offsets.popper,a={primary:function(t){var n=o[t];return o[t]r[t]&&!e.escapeWithReference&&(i=Math.min(o[n],r[t]-("right"===t?o.width:o.height))),x({},n,i)}};return i.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";o=C({},o,a[e](t))}),t.offsets.popper=o,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(t.offsets.popper[u]=o(r[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!W(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if("string"==typeof r){if(!(r=t.instance.popper.querySelector(r)))return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],o=t.offsets,a=o.popper,s=o.reference,c=-1!==["left","right"].indexOf(i),l=c?"height":"width",f=c?"Top":"Left",p=f.toLowerCase(),d=c?"left":"top",h=c?"bottom":"right",v=D(r)[l];s[h]-va[h]&&(t.offsets.popper[p]+=s[p]+v-a[h]),t.offsets.popper=T(t.offsets.popper);var g=s[p]+s[l]/2-v/2,m=u(t.instance.popper),y=parseFloat(m["margin"+f],10),_=parseFloat(m["border"+f+"Width"],10),b=g-t.offsets.popper[p]-y-_;return b=Math.max(Math.min(a[l]-v,b),0),t.arrowElement=r,t.offsets.arrow=(x(n={},p,Math.round(b)),x(n,d,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if($(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=S(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement),r=t.placement.split("-")[0],i=I(r),o=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case V.FLIP:a=[r,i];break;case V.CLOCKWISE:a=z(r);break;case V.COUNTERCLOCKWISE:a=z(r,!0);break;default:a=e.behavior}return a.forEach(function(s,u){if(r!==s||a.length===u+1)return t;r=t.placement.split("-")[0],i=I(r);var c,l=t.offsets.popper,f=t.offsets.reference,p=Math.floor,d="left"===r&&p(l.right)>p(f.left)||"right"===r&&p(l.left)p(f.top)||"bottom"===r&&p(l.top)p(n.right),g=p(l.top)p(n.bottom),y="left"===r&&h||"right"===r&&v||"top"===r&&g||"bottom"===r&&m,_=-1!==["top","bottom"].indexOf(r),b=!!e.flipVariations&&(_&&"start"===o&&h||_&&"end"===o&&v||!_&&"start"===o&&g||!_&&"end"===o&&m);(d||y||b)&&(t.flipped=!0,(d||y)&&(r=a[u+1]),b&&(o="end"===(c=o)?"start":"start"===c?"end":c),t.placement=r+(o?"-"+o:""),t.offsets.popper=C({},t.offsets.popper,N(t.instance.popper,t.offsets.reference,t.placement)),t=L(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),t.placement=I(e),t.offsets.popper=T(i),t}},hide:{order:800,enabled:!0,fn:function(t){if(!W(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=j(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};b(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=C({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(C({},t.Defaults.modifiers,i.modifiers)).forEach(function(e){r.options.modifiers[e]=C({},t.Defaults.modifiers[e]||{},i.modifiers?i.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return C({name:t},r.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&s(t.onLoad)&&t.onLoad(r.reference,r.popper,r.options,t,r.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return w(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=O(this.state,this.popper,this.reference),t.placement=k(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.offsets.popper=N(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position="absolute",t=L(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,$(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[R("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=M(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),t}();G.Utils=("undefined"!=typeof window?window:t).PopperUtils,G.placements=q,G.Defaults=Q,e.default=G}.call(e,n(1))},function(t,e,n){var r;!function(e,n){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],a=n.document,s=Object.getPrototypeOf,u=o.slice,c=o.concat,l=o.push,f=o.indexOf,p={},d=p.toString,h=p.hasOwnProperty,v=h.toString,g=v.call(Object),m={};function y(t,e){var n=(e=e||a).createElement("script");n.text=t,e.head.appendChild(n).parentNode.removeChild(n)}var _=function(t,e){return new _.fn.init(t,e)},b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^-ms-/,x=/-([a-z])/g,C=function(t,e){return e.toUpperCase()};function T(t){var e=!!t&&"length"in t&&t.length,n=_.type(t);return"function"!==n&&!_.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}_.fn=_.prototype={jquery:"3.2.1",constructor:_,length:0,toArray:function(){return u.call(this)},get:function(t){return null==t?u.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),U=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),z=new RegExp(F),V=new RegExp("^"+P+"$"),K={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+$+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),tt=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,nt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},rt=function(){p()},it=yt(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{N.apply(O=j.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(t){N={apply:O.length?function(t,e){I.apply(t,j.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function ot(t,e,r,i){var o,s,c,l,f,h,m,y=e&&e.ownerDocument,x=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return r;if(!i&&((e?e.ownerDocument||e:w)!==d&&p(e),e=e||d,v)){if(11!==x&&(f=X.exec(t)))if(o=f[1]){if(9===x){if(!(c=e.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(y&&(c=y.getElementById(o))&&_(e,c)&&c.id===o)return r.push(c),r}else{if(f[2])return N.apply(r,e.getElementsByTagName(t)),r;if((o=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return N.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!A[t+" "]&&(!g||!g.test(t))){if(1!==x)y=e,m=t;else if("object"!==e.nodeName.toLowerCase()){for((l=e.getAttribute("id"))?l=l.replace(et,nt):e.setAttribute("id",l=b),s=(h=a(t)).length;s--;)h[s]="#"+l+" "+mt(h[s]);m=h.join(","),y=J.test(t)&&vt(e.parentNode)||e}if(m)try{return N.apply(r,y.querySelectorAll(m)),r}catch(t){}finally{l===b&&e.removeAttribute("id")}}}return u(t.replace(B,"$1"),e,r,i)}function at(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function st(t){return t[b]=!0,t}function ut(t){var e=d.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ct(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function lt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function dt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&it(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ht(t){return st(function(e){return e=+e,st(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}n=ot.support={},o=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},p=ot.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:w;return a!==d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,v=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",rt,!1):i.attachEvent&&i.attachEvent("onunload",rt)),n.attributes=ut(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=ut(function(t){return t.appendChild(d.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(d.getElementsByClassName),n.getById=ut(function(t){return h.appendChild(t).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&v)return e.getElementsByClassName(t)},m=[],g=[],(n.qsa=Y.test(d.querySelectorAll))&&(ut(function(t){h.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+R+"*(?:value|"+$+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]")}),ut(function(t){t.innerHTML="";var e=d.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Y.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ut(function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),m.push("!=",F)}),g=g.length&&new RegExp(g.join("|")),m=m.length&&new RegExp(m.join("|")),e=Y.test(h.compareDocumentPosition),_=e||Y.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},S=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t===d||t.ownerDocument===w&&_(w,t)?-1:e===d||e.ownerDocument===w&&_(w,e)?1:l?L(l,t)-L(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t===d?-1:e===d?1:i?-1:o?1:l?L(l,t)-L(l,e):0;if(i===o)return lt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?lt(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==d&&p(t),e=e.replace(U,"='$1']"),n.matchesSelector&&v&&!A[e+" "]&&(!m||!m.test(e))&&(!g||!g.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){}return ot(e,d,null,[t]).length>0},ot.contains=function(t,e){return(t.ownerDocument||t)!==d&&p(t),_(t,e)},ot.attr=function(t,e){(t.ownerDocument||t)!==d&&p(t);var i=r.attrHandle[e.toLowerCase()],o=i&&k.call(r.attrHandle,e.toLowerCase())?i(t,e,!v):void 0;return void 0!==o?o:n.attributes||!v?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ot.escape=function(t){return(t+"").replace(et,nt)},ot.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ot.uniqueSort=function(t){var e,r=[],i=0,o=0;if(f=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort(S),f){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return l=null,t},i=ot.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=ot.selectors={cacheLength:50,createPseudo:st,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,tt),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return K.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&z.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=T[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&T(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var i=ot.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var c,l,f,p,d,h,v=o!==a?"nextSibling":"previousSibling",g=e.parentNode,m=s&&e.nodeName.toLowerCase(),y=!u&&!s,_=!1;if(g){if(o){for(;v;){for(p=e;p=p[v];)if(s?p.nodeName.toLowerCase()===m:1===p.nodeType)return!1;h=v="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(_=(d=(c=(l=(f=(p=g)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[t]||[])[0]===x&&c[1])&&c[2],p=d&&g.childNodes[d];p=++d&&p&&p[v]||(_=d=0)||h.pop();)if(1===p.nodeType&&++_&&p===e){l[t]=[x,d,_];break}}else if(y&&(_=d=(c=(l=(f=(p=e)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[t]||[])[0]===x&&c[1]),!1===_)for(;(p=++d&&p&&p[v]||(_=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==m:1!==p.nodeType)||!++_||(y&&((l=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[t]=[x,_]),p!==e)););return(_-=i)===r||_%r==0&&_/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||ot.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?st(function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=L(t,o[a])]=!(n[r]=o[a])}):function(t){return i(t,0,n)}):i}},pseudos:{not:st(function(t){var e=[],n=[],r=s(t.replace(B,"$1"));return r[b]?st(function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:st(function(t){return function(e){return ot(t,e).length>0}}),contains:st(function(t){return t=t.replace(Z,tt),function(e){return(e.textContent||e.innerText||i(e)).indexOf(t)>-1}}),lang:st(function(t){return V.test(t||"")||ot.error("unsupported lang: "+t),t=t.replace(Z,tt).toLowerCase(),function(e){var n;do{if(n=v?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:dt(!1),disabled:dt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return G.test(t.nodeName)},input:function(t){return Q.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:ht(function(){return[0]}),last:ht(function(t,e){return[e-1]}),eq:ht(function(t,e,n){return[n<0?n+e:n]}),even:ht(function(t,e){for(var n=0;n=0;)t.push(r);return t}),gt:ht(function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function bt(t,e,n,r,i){for(var o,a=[],s=0,u=t.length,c=null!=e;s-1&&(o[c]=!(a[c]=f))}}else m=bt(m===a?m.splice(h,m.length):m),i?i(null,a,m,u):N.apply(a,m)})}function xt(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],u=a?1:0,l=yt(function(t){return t===e},s,!0),f=yt(function(t){return L(e,t)>-1},s,!0),p=[function(t,n,r){var i=!a&&(r||n!==c)||((e=n).nodeType?l(t,n,r):f(t,n,r));return e=null,i}];u1&&_t(p),u>1&&mt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(B,"$1"),n,u0,u=i.length>0,l=function(t,e,n,a,l){var f,h,g,m=0,y="0",_=t&&[],b=[],w=c,C=t||u&&r.find.TAG("*",l),T=x+=null==w?1:Math.random()||.1,E=C.length;for(l&&(c=e===d||e||l);y!==E&&null!=(f=C[y]);y++){if(u&&f){for(h=0,e||f.ownerDocument===d||(p(f),n=!v);g=i[h++];)if(g(f,e||d,n)){a.push(f);break}l&&(x=T)}s&&((f=!g&&f)&&m--,t&&_.push(f))}if(m+=y,s&&y!==m){for(h=0;g=o[h++];)g(_,b,e,n);if(t){if(m>0)for(;y--;)_[y]||b[y]||(b[y]=D.call(a));b=bt(b)}N.apply(a,b),l&&!t&&b.length>0&&m+o.length>1&&ot.uniqueSort(a)}return l&&(x=T,c=w),_},s?st(l):l))).selector=t}return g},u=ot.select=function(t,e,n,i){var o,u,c,l,f,p="function"==typeof t&&t,d=!i&&a(t=p.selector||t);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&9===e.nodeType&&v&&r.relative[u[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(Z,tt),e)||[])[0]))return n;p&&(e=e.parentNode),t=t.slice(u.shift().value.length)}for(o=K.needsContext.test(t)?0:u.length;o--&&(c=u[o],!r.relative[l=c.type]);)if((f=r.find[l])&&(i=f(c.matches[0].replace(Z,tt),J.test(u[0].type)&&vt(e.parentNode)||e))){if(u.splice(o,1),!(t=i.length&&mt(u)))return N.apply(n,i),n;break}}return(p||s(t,d))(i,e,!v,n,!e||J.test(t)&&vt(e.parentNode)||e),n},n.sortStable=b.split("").sort(S).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ut(function(t){return 1&t.compareDocumentPosition(d.createElement("fieldset"))}),ut(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||ct("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&ut(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ct("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ut(function(t){return null==t.getAttribute("disabled")})||ct($,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),ot}(n);_.find=E,_.expr=E.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=E.uniqueSort,_.text=E.getText,_.isXMLDoc=E.isXML,_.contains=E.contains,_.escapeSelector=E.escape;var A=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&_(t).is(n))break;r.push(t)}return r},S=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},k=_.expr.match.needsContext;function O(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,I=/^.[^:#\[\.,]*$/;function N(t,e,n){return _.isFunction(e)?_.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?_.grep(t,function(t){return t===e!==n}):"string"!=typeof e?_.grep(t,function(t){return f.call(e,t)>-1!==n}):I.test(e)?_.filter(e,t,n):(e=_.filter(e,t),_.grep(t,function(t){return f.call(e,t)>-1!==n&&1===t.nodeType}))}_.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?_.find.matchesSelector(r,t)?[r]:[]:_.find.matches(t,_.grep(e,function(t){return 1===t.nodeType}))},_.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(_(t).filter(function(){for(e=0;e1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(N(this,t||[],!1))},not:function(t){return this.pushStack(N(this,t||[],!0))},is:function(t){return!!N(this,"string"==typeof t&&k.test(t)?_(t):t||[],!1).length}});var j,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||j,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:L.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:a,!0)),D.test(r[1])&&_.isPlainObject(e))for(r in e)_.isFunction(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):_.isFunction(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,j=_(a);var $=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function P(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&_.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?f.call(_(t),this[0]):f.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return A(t,"parentNode")},parentsUntil:function(t,e,n){return A(t,"parentNode",n)},next:function(t){return P(t,"nextSibling")},prev:function(t){return P(t,"previousSibling")},nextAll:function(t){return A(t,"nextSibling")},prevAll:function(t){return A(t,"previousSibling")},nextUntil:function(t,e,n){return A(t,"nextSibling",n)},prevUntil:function(t,e,n){return A(t,"previousSibling",n)},siblings:function(t){return S((t.parentNode||{}).firstChild,t)},children:function(t){return S(t.firstChild)},contents:function(t){return O(t,"iframe")?t.contentDocument:(O(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},function(t,e){_.fn[t]=function(n,r){var i=_.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=_.filter(r,i)),this.length>1&&(R[t]||_.uniqueSort(i),$.test(t)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function F(t){return t}function H(t){throw t}function B(t,e,n,r){var i;try{t&&_.isFunction(i=t.promise)?i.call(t).done(e).fail(n):t&&_.isFunction(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){var e,n;t="string"==typeof t?(e=t,n={},_.each(e.match(M)||[],function(t,e){n[e]=!0}),n):_.extend({},t);var r,i,o,a,s=[],u=[],c=-1,l=function(){for(a=a||t.once,o=r=!0;u.length;c=-1)for(i=u.shift();++c-1;)s.splice(n,1),n<=c&&c--}),this},has:function(t){return t?_.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=i="",this},disabled:function(){return!s},lock:function(){return a=u=[],i||r||(s=i=""),this},locked:function(){return!!a},fireWith:function(t,e){return a||(e=[t,(e=e||[]).slice?e.slice():e],u.push(e),r||l()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return _.Deferred(function(n){_.each(e,function(e,r){var i=_.isFunction(t[r[4]])&&t[r[4]];o[r[1]](function(){var t=i&&i.apply(this,arguments);t&&_.isFunction(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,u=arguments,c=function(){var n,c;if(!(t=o&&(r!==H&&(s=void 0,u=[n]),e.rejectWith(s,u))}};t?l():(_.Deferred.getStackHook&&(l.stackTrace=_.Deferred.getStackHook()),n.setTimeout(l))}}return _.Deferred(function(n){e[0][3].add(a(0,n,_.isFunction(i)?i:F,n.notifyWith)),e[1][3].add(a(0,n,_.isFunction(t)?t:F)),e[2][3].add(a(0,n,_.isFunction(r)?r:H))}).promise()},promise:function(t){return null!=t?_.extend(t,i):i}},o={};return _.each(e,function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},e[3-t][2].disable,e[0][2].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=u.call(arguments),o=_.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?u.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(B(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||_.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)B(i[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&W.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout(function(){throw t})};var q=_.Deferred();function U(){a.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),_.ready()}_.fn.ready=function(t){return q.then(t).catch(function(t){_.readyException(t)}),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||q.resolveWith(a,[_]))}}),_.ready.then=q.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(_.ready):(a.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var z=function(t,e,n,r,i,o,a){var s=0,u=t.length,c=null==n;if("object"===_.type(n)){i=!0;for(s in n)z(t,e,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,_.isFunction(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each(function(){G.remove(this,t)})}}),_.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Q.get(t,e),n&&(!r||Array.isArray(n)?r=Q.access(t,e,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),r=n.length,i=n.shift(),o=_._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,function(){_.dequeue(t,e)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Q.get(t,n)||Q.access(t,n,{empty:_.Callbacks("once memory").add(function(){Q.remove(t,[e+"queue",n])})})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]+)/i,ct=/^$|\/(?:java|ecma)script/i,lt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ft(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&O(t,e)?_.merge([t],n):n}function pt(t,e){for(var n=0,r=t.length;n-1)i&&i.push(o);else if(c=_.contains(o.ownerDocument,o),a=ft(f.appendChild(o),"script"),c&&pt(a),n)for(l=0;o=a[l++];)ct.test(o.type||"")&&n.push(o);return f}dt=a.createDocumentFragment().appendChild(a.createElement("div")),(ht=a.createElement("input")).setAttribute("type","radio"),ht.setAttribute("checked","checked"),ht.setAttribute("name","t"),dt.appendChild(ht),m.checkClone=dt.cloneNode(!0).cloneNode(!0).lastChild.checked,dt.innerHTML="",m.noCloneChecked=!!dt.cloneNode(!0).lastChild.defaultValue;var mt=a.documentElement,yt=/^key/,_t=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,bt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function xt(){return!1}function Ct(){try{return a.activeElement}catch(t){}}function Tt(t,e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=void 0);for(s in e)Tt(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=xt;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return _().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=_.guid++)),t.each(function(){_.event.add(this,e,i,r,n)})}_.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,c,l,f,p,d,h,v,g=Q.get(t);if(g)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&_.find.matchesSelector(mt,i),n.guid||(n.guid=_.guid++),(u=g.events)||(u=g.events={}),(a=g.handle)||(a=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(M)||[""]).length;c--;)d=v=(s=bt.exec(e[c])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=_.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=_.event.special[d]||{},l=_.extend({type:d,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&_.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,l):p.push(l),_.event.global[d]=!0)},remove:function(t,e,n,r,i){var o,a,s,u,c,l,f,p,d,h,v,g=Q.hasData(t)&&Q.get(t);if(g&&(u=g.events)){for(c=(e=(e||"").match(M)||[""]).length;c--;)if(d=v=(s=bt.exec(e[c])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=_.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)l=p[o],!i&&v!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(o,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(t,l));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(t,h,g.handle)||_.removeEvent(t,d,g.handle),delete u[d])}else for(d in u)_.event.remove(t,d+e[c],n,r,!0);_.isEmptyObject(u)&&Q.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=_.event.fix(t),u=new Array(arguments.length),c=(Q.get(this,"events")||{})[s.type]||[],l=_.event.special[s.type]||{};for(u[0]=s,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:_.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,At=/\s*$/g;function Dt(t,e){return O(t,"table")&&O(11!==e.nodeType?e:e.firstChild,"tr")&&_(">tbody",t)[0]||t}function It(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Nt(t){var e=kt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function jt(t,e){var n,r,i,o,a,s,u,c;if(1===e.nodeType){if(Q.hasData(t)&&(o=Q.access(t),a=Q.set(e,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(n=0,r=c[i].length;n1&&"string"==typeof h&&!m.checkClone&&St.test(h))return t.each(function(i){var o=t.eq(i);v&&(e[0]=h.call(this,i,o.html())),Lt(o,e,n,r)});if(p&&(o=(i=gt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=_.map(ft(i,"script"),It)).length;f")},clone:function(t,e,n){var r,i,o,a,s,u,c,l=t.cloneNode(!0),f=_.contains(t.ownerDocument,t);if(!(m.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||_.isXMLDoc(t)))for(a=ft(l),r=0,i=(o=ft(t)).length;r0&&pt(a,!f&&ft(t,"script")),l},cleanData:function(t){for(var e,n,r,i=_.event.special,o=0;void 0!==(n=t[o]);o++)if(V(n)){if(e=n[Q.expando]){if(e.events)for(r in e.events)i[r]?_.event.remove(n,r):_.removeEvent(n,r,e.handle);n[Q.expando]=void 0}n[G.expando]&&(n[G.expando]=void 0)}}}),_.fn.extend({detach:function(t){return $t(this,t,!0)},remove:function(t){return $t(this,t)},text:function(t){return z(this,function(t){return void 0===t?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Lt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Dt(this,t).appendChild(t)})},prepend:function(){return Lt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Dt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Lt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Lt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(ft(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return _.clone(this,t,e)})},html:function(t){return z(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!lt[(ut.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n1)}}),_.Tween=Xt,Xt.prototype={constructor:Xt,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var t=Xt.propHooks[this.prop];return t&&t.get?t.get(this):Xt.propHooks._default.get(this)},run:function(t){var e,n=Xt.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Xt.propHooks._default.set(this),this}},Xt.prototype.init.prototype=Xt.prototype,Xt.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[_.cssProps[t.prop]]&&!_.cssHooks[t.prop]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},Xt.propHooks.scrollTop=Xt.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=Xt.prototype.init,_.fx.step={};var Jt,Zt,te,ee,ne=/^(?:toggle|show|hide)$/,re=/queueHooks$/;function ie(){Zt&&(!1===a.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ie):n.setTimeout(ie,_.fx.interval),_.fx.tick())}function oe(){return n.setTimeout(function(){Jt=void 0}),Jt=_.now()}function ae(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=et[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function se(t,e,n){for(var r,i=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each(function(){_.removeAttr(this,t)})}}),_.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?_.prop(t,e,n):(1===o&&_.isXMLDoc(t)||(i=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&O(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(M);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(t,e){var n=le[e]||_.find.attr;le[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=le[a],le[a]=i,i=null!=n(t,e,r)?a:null,le[a]=o),i}});var fe=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function de(t){return(t.match(M)||[]).join(" ")}function he(t){return t.getAttribute&&t.getAttribute("class")||""}_.fn.extend({prop:function(t,e){return z(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[_.propFix[t]||t]})}}),_.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(t)||(e=_.propFix[e]||e,i=_.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):fe.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(_.isFunction(t))return this.each(function(e){_(this).addClass(t.call(this,e,he(this)))});if("string"==typeof t&&t)for(e=t.match(M)||[];n=this[u++];)if(i=he(n),r=1===n.nodeType&&" "+de(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=de(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(_.isFunction(t))return this.each(function(e){_(this).removeClass(t.call(this,e,he(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(M)||[];n=this[u++];)if(i=he(n),r=1===n.nodeType&&" "+de(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=de(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):_.isFunction(t)?this.each(function(n){_(this).toggleClass(t.call(this,n,he(this),e),e)}):this.each(function(){var e,r,i,o;if("string"===n)for(r=0,i=_(this),o=t.match(M)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else void 0!==t&&"boolean"!==n||((e=he(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Q.get(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+de(he(n))+" ").indexOf(e)>-1)return!0;return!1}});var ve=/\r/g;_.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=_.isFunction(t),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,_(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=_.map(i,function(t){return null==t?"":t+""})),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))})):i?(e=_.valHooks[i.type]||_.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ve,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:de(_.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},m.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var ge=/^(?:focusinfocus|focusoutblur)$/;_.extend(_.event,{trigger:function(t,e,r,i){var o,s,u,c,l,f,p,d=[r||a],v=h.call(t,"type")?t.type:t,g=h.call(t,"namespace")?t.namespace.split("."):[];if(s=u=r=r||a,3!==r.nodeType&&8!==r.nodeType&&!ge.test(v+_.event.triggered)&&(v.indexOf(".")>-1&&(v=(g=v.split(".")).shift(),g.sort()),l=v.indexOf(":")<0&&"on"+v,(t=t[_.expando]?t:new _.Event(v,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:_.makeArray(e,[t]),p=_.event.special[v]||{},i||!p.trigger||!1!==p.trigger.apply(r,e))){if(!i&&!p.noBubble&&!_.isWindow(r)){for(c=p.delegateType||v,ge.test(c+v)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(r.ownerDocument||a)&&d.push(u.defaultView||u.parentWindow||n)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)t.type=o>1?c:p.bindType||v,(f=(Q.get(s,"events")||{})[t.type]&&Q.get(s,"handle"))&&f.apply(s,e),(f=l&&s[l])&&f.apply&&V(s)&&(t.result=f.apply(s,e),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(d.pop(),e)||!V(r)||l&&_.isFunction(r[v])&&!_.isWindow(r)&&((u=r[l])&&(r[l]=null),_.event.triggered=v,r[v](),_.event.triggered=void 0,u&&(r[l]=u)),t.result}},simulate:function(t,e,n){var r=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(r,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each(function(){_.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){_.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),_.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),m.focusin="onfocusin"in n,m.focusin||_.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=Q.access(r,e);i||r.addEventListener(t,n,!0),Q.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Q.access(r,e)-1;i?Q.access(r,e,i):(r.removeEventListener(t,n,!0),Q.remove(r,e))}}});var me=n.location,ye=_.now(),_e=/\?/;_.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+t),e};var be=/\[\]$/,we=/\r?\n/g,xe=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;function Te(t,e,n,r){var i;if(Array.isArray(e))_.each(e,function(e,i){n||be.test(t)?r(t,i):Te(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)});else if(n||"object"!==_.type(e))r(t,e);else for(i in e)Te(t+"["+i+"]",e[i],n,r)}_.param=function(t,e){var n,r=[],i=function(t,e){var n=_.isFunction(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,function(){i(this.name,this.value)});else for(n in t)Te(n,t[n],e,i);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&Ce.test(this.nodeName)&&!xe.test(t)&&(this.checked||!st.test(t))}).map(function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(t){return{name:e.name,value:t.replace(we,"\r\n")}}):{name:e.name,value:n.replace(we,"\r\n")}}).get()}});var Ee=/%20/g,Ae=/#.*$/,Se=/([?&])_=[^&]*/,ke=/^(.*?):[ \t]*([^\r\n]*)$/gm,Oe=/^(?:GET|HEAD)$/,De=/^\/\//,Ie={},Ne={},je="*/".concat("*"),Le=a.createElement("a");function $e(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(M)||[];if(_.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Re(t,e,n,r){var i={},o=t===Ne;function a(s){var u;return i[s]=!0,_.each(t[s]||[],function(t,s){var c=s(e,n,r);return"string"!=typeof c||o||i[c]?o?!(u=c):void 0:(e.dataTypes.unshift(c),a(c),!1)}),u}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Pe(t,e){var n,r,i=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&_.extend(!0,t,r),t}Le.href=me.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:me.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(me.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Pe(Pe(t,_.ajaxSettings),e):Pe(_.ajaxSettings,t)},ajaxPrefilter:$e(Ie),ajaxTransport:$e(Ne),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,s,u,c,l,f,p,d,h=_.ajaxSetup({},e),v=h.context||h,g=h.context&&(v.nodeType||v.jquery)?_(v):_.event,m=_.Deferred(),y=_.Callbacks("once memory"),b=h.statusCode||{},w={},x={},C="canceled",T={readyState:0,getResponseHeader:function(t){var e;if(l){if(!s)for(s={};e=ke.exec(o);)s[e[1].toLowerCase()]=e[2];e=s[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(t,e){return null==l&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)T.always(t[T.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),E(0,e),this}};if(m.promise(T),h.url=((t||h.url||me.href)+"").replace(De,me.protocol+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){c=a.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Le.protocol+"//"+Le.host!=c.protocol+"//"+c.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=_.param(h.data,h.traditional)),Re(Ie,h,e,T),l)return T;(f=_.event&&h.global)&&0==_.active++&&_.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Oe.test(h.type),i=h.url.replace(Ae,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Ee,"+")):(d=h.url.slice(i.length),h.data&&(i+=(_e.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(Se,"$1"),d=(_e.test(i)?"&":"?")+"_="+ye+++d),h.url=i+d),h.ifModified&&(_.lastModified[i]&&T.setRequestHeader("If-Modified-Since",_.lastModified[i]),_.etag[i]&&T.setRequestHeader("If-None-Match",_.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&T.setRequestHeader("Content-Type",h.contentType),T.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+je+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)T.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(v,T,h)||l))return T.abort();if(C="abort",y.add(h.complete),T.done(h.success),T.fail(h.error),r=Re(Ne,h,e,T)){if(T.readyState=1,f&&g.trigger("ajaxSend",[T,h]),l)return T;h.async&&h.timeout>0&&(u=n.setTimeout(function(){T.abort("timeout")},h.timeout));try{l=!1,r.send(w,E)}catch(t){if(l)throw t;E(-1,t)}}else E(-1,"No Transport");function E(t,e,a,s){var c,p,d,w,x,C=e;l||(l=!0,u&&n.clearTimeout(u),r=void 0,o=s||"",T.readyState=t>0?4:0,c=t>=200&&t<300||304===t,a&&(w=function(t,e,n){for(var r,i,o,a,s=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(h,T,a)),w=function(t,e,n,r){var i,o,a,s,u,c={},l=t.dataTypes.slice();if(l[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=c[u+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(h,w,T,c),c?(h.ifModified&&((x=T.getResponseHeader("Last-Modified"))&&(_.lastModified[i]=x),(x=T.getResponseHeader("etag"))&&(_.etag[i]=x)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=w.state,p=w.data,c=!(d=w.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(e||C)+"",c?m.resolveWith(v,[p,C,T]):m.rejectWith(v,[T,C,d]),T.statusCode(b),b=void 0,f&&g.trigger(c?"ajaxSuccess":"ajaxError",[T,h,c?p:d]),y.fireWith(v,[T,C]),f&&(g.trigger("ajaxComplete",[T,h]),--_.active||_.event.trigger("ajaxStop")))}return T},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],function(t,e){_[e]=function(t,n,r,i){return _.isFunction(n)&&(i=i||r,r=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:i,data:n,success:r},_.isPlainObject(t)&&t))}}),_._evalUrl=function(t){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(_.isFunction(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return _.isFunction(t)?this.each(function(e){_(this).wrapInner(t.call(this,e))}):this.each(function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=_.isFunction(t);return this.each(function(n){_(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Me={0:200,1223:204},Fe=_.ajaxSettings.xhr();m.cors=!!Fe&&"withCredentials"in Fe,m.ajax=Fe=!!Fe,_.ajaxTransport(function(t){var e,r;if(m.cors||Fe&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Me[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){e&&r()})},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),_.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),_.ajaxTransport("script",function(t){var e,n;if(t.crossDomain)return{send:function(r,i){e=_(" diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/assets/sass/_variables.scss b/modules/openapi-generator/src/main/resources/php-laravel/resources/assets/sass/_variables.scss new file mode 100644 index 0000000000..70ecfdb39d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/assets/sass/_variables.scss @@ -0,0 +1,8 @@ + +// Body +$body-bg: #f5f8fa; + +// Typography +$font-family-sans-serif: "Raleway", sans-serif; +$font-size-base: 0.9rem; +$line-height-base: 1.6; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/assets/sass/app.scss b/modules/openapi-generator/src/main/resources/php-laravel/resources/assets/sass/app.scss new file mode 100644 index 0000000000..0077cb141b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/assets/sass/app.scss @@ -0,0 +1,14 @@ + +// Fonts +@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); + +// Variables +@import "variables"; + +// Bootstrap +@import '~bootstrap/scss/bootstrap'; + +.navbar-laravel { + background-color: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/auth.php b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/auth.php new file mode 100644 index 0000000000..e5506df290 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/auth.php @@ -0,0 +1,19 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/pagination.php b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/pagination.php new file mode 100644 index 0000000000..d481411877 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/pagination.php @@ -0,0 +1,19 @@ + '« Previous', + 'next' => 'Next »', + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/passwords.php b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/passwords.php new file mode 100644 index 0000000000..e5544d2016 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/passwords.php @@ -0,0 +1,22 @@ + 'Passwords must be at least six characters and match the confirmation.', + 'reset' => 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that e-mail address.", + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/validation.php b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/validation.php new file mode 100644 index 0000000000..0d47547aa9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/lang/en/validation.php @@ -0,0 +1,146 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'email' => 'The :attribute must be a valid email address.', + 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'gt' => [ + 'numeric' => 'The :attribute must be greater than :value.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'string' => 'The :attribute must be greater than :value characters.', + 'array' => 'The :attribute must have more than :value items.', + ], + 'gte' => [ + 'numeric' => 'The :attribute must be greater than or equal :value.', + 'file' => 'The :attribute must be greater than or equal :value kilobytes.', + 'string' => 'The :attribute must be greater than or equal :value characters.', + 'array' => 'The :attribute must have :value items or more.', + ], + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'ipv4' => 'The :attribute must be a valid IPv4 address.', + 'ipv6' => 'The :attribute must be a valid IPv6 address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'lt' => [ + 'numeric' => 'The :attribute must be less than :value.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'string' => 'The :attribute must be less than :value characters.', + 'array' => 'The :attribute must have less than :value items.', + ], + 'lte' => [ + 'numeric' => 'The :attribute must be less than or equal :value.', + 'file' => 'The :attribute must be less than or equal :value kilobytes.', + 'string' => 'The :attribute must be less than or equal :value characters.', + 'array' => 'The :attribute must not have more than :value items.', + ], + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimetypes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'present' => 'The :attribute field must be present.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'url' => 'The :attribute format is invalid.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/resources/views/welcome.blade.php b/modules/openapi-generator/src/main/resources/php-laravel/resources/views/welcome.blade.php new file mode 100644 index 0000000000..a246e106a5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/resources/views/welcome.blade.php @@ -0,0 +1,95 @@ + + + + + + + + Laravel + + + + + + + + +
+ @if (Route::has('login')) + + @endif + +
+
+ Laravel +
+ + +
+
+ + diff --git a/modules/openapi-generator/src/main/resources/php-laravel/routes/api.mustache b/modules/openapi-generator/src/main/resources/php-laravel/routes/api.mustache new file mode 100644 index 0000000000..686bdda970 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/routes/api.mustache @@ -0,0 +1,19 @@ +licenseInfo}} +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +/** + * {{httpMethod}} {{operationId}} + * Summary: {{summary}} + * Notes: {{notes}} +{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}} + */ +Route::{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', '{{classname}}@{{operationId}}'); +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + diff --git a/modules/openapi-generator/src/main/resources/php-laravel/routes/channels.mustache b/modules/openapi-generator/src/main/resources/php-laravel/routes/channels.mustache new file mode 100644 index 0000000000..d404b93807 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/routes/channels.mustache @@ -0,0 +1,7 @@ +licenseInfo}} + +Broadcast::channel('App.User.{id}', function ($user, $id) { + return (int) $user->id === (int) $id; +}); diff --git a/modules/openapi-generator/src/main/resources/php-laravel/routes/console.mustache b/modules/openapi-generator/src/main/resources/php-laravel/routes/console.mustache new file mode 100644 index 0000000000..97991b490e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/routes/console.mustache @@ -0,0 +1,7 @@ +licenseInfo}} + +Artisan::command('inspire', function () { + $this->comment(Inspiring::quote()); +})->describe('Display an inspiring quote'); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-laravel/routes/web.mustache b/modules/openapi-generator/src/main/resources/php-laravel/routes/web.mustache new file mode 100644 index 0000000000..3214729b37 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/routes/web.mustache @@ -0,0 +1,5 @@ +licenseInfo}} + +Route::get('/', 'Controller@welcome'); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-laravel/server.php b/modules/openapi-generator/src/main/resources/php-laravel/server.php new file mode 100644 index 0000000000..5fb6379e71 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/server.php @@ -0,0 +1,21 @@ + + */ + +$uri = urldecode( + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) +); + +// This file allows us to emulate Apache's "mod_rewrite" functionality from the +// built-in PHP web server. This provides a convenient way to test a Laravel +// application without having installed a "real" web server software here. +if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { + return false; +} + +require_once __DIR__.'/public/index.php'; diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/app/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/app/.gitignore new file mode 100644 index 0000000000..8f4803c056 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/app/.gitignore @@ -0,0 +1,3 @@ +* +!public/ +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/app/public/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/app/public/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/.gitignore new file mode 100644 index 0000000000..b02b700f1b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/.gitignore @@ -0,0 +1,8 @@ +config.php +routes.php +schedule-* +compiled.php +services.json +events.scanned.php +routes.scanned.php +down diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/cache/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/cache/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/sessions/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/sessions/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/sessions/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/testing/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/testing/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/testing/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/views/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/views/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/storage/logs/.gitignore b/modules/openapi-generator/src/main/resources/php-laravel/storage/logs/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-laravel/tests/CreatesApplication.php b/modules/openapi-generator/src/main/resources/php-laravel/tests/CreatesApplication.php new file mode 100644 index 0000000000..547152f6a9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/tests/CreatesApplication.php @@ -0,0 +1,22 @@ +make(Kernel::class)->bootstrap(); + + return $app; + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/tests/Feature/ExampleTest.php b/modules/openapi-generator/src/main/resources/php-laravel/tests/Feature/ExampleTest.php new file mode 100644 index 0000000000..f31e495ca3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/tests/Feature/ExampleTest.php @@ -0,0 +1,21 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/tests/TestCase.php b/modules/openapi-generator/src/main/resources/php-laravel/tests/TestCase.php new file mode 100644 index 0000000000..2932d4a69d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/tests/TestCase.php @@ -0,0 +1,10 @@ +assertTrue(true); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-laravel/webpack.mix.js b/modules/openapi-generator/src/main/resources/php-laravel/webpack.mix.js new file mode 100644 index 0000000000..72fdbb16d6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-laravel/webpack.mix.js @@ -0,0 +1,15 @@ +let mix = require('laravel-mix'); + +/* + |-------------------------------------------------------------------------- + | Mix Asset Management + |-------------------------------------------------------------------------- + | + | Mix provides a clean, fluent API for defining some Webpack build steps + | for your Laravel application. By default, we are compiling the Sass + | file for the application as well as bundling up all the JS files. + | + */ + +mix.js('resources/assets/js/app.js', 'public/js') + .sass('resources/assets/sass/app.scss', 'public/css'); diff --git a/modules/openapi-generator/src/main/resources/php-slim-server/README.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/README.mustache index 4f701ed192..e7b73f219b 100644 --- a/modules/openapi-generator/src/main/resources/php-slim-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim-server/README.mustache @@ -7,4 +7,16 @@ is an example of building a PHP Slim server. This example uses the [Slim Framework](http://www.slimframework.com/). To see how to make this your own, please take a look at the template here: -[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/slim/) +[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/php-slim-server/) + +{{#authMethods}} +{{^hasMore}} +## Authentication +{{/hasMore}} +{{/authMethods}} +{{#authMethods}} +{{#isBasic}} +> Important! To make Basic Authentication work you need to implement `authenticator` function in [SlimRouter]({{srcBasePath}}/SlimRouter.php) class. +> Documentation [tuupola/slim-basic-auth](https://github.com/tuupola/slim-basic-auth) +{{/isBasic}} +{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache index 7636cab3e0..11eb61d5ac 100644 --- a/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache @@ -39,6 +39,7 @@ use {{apiPackage}}\{{classname}}; use Slim\App; use Psr\Container\ContainerInterface; use InvalidArgumentException; +use Tuupola\Middleware\HttpBasicAuthentication; /** * SlimRouter Class Doc Comment @@ -66,10 +67,29 @@ class SlimRouter { public function __construct($container = []) { $app = new App($container); + $basicAuth = new HttpBasicAuthentication([ + "secure" => false, + "authenticator" => function ($arguments) { + $user = $arguments["user"]; + $password = $arguments["password"]; + return false; + } + ]); + {{#apis}} {{#operations}} {{#operation}} - $app->{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', {{classname}}::class . ':{{operationId}}'); + $app->{{httpMethod}}( + '{{{basePathWithoutHost}}}{{{path}}}', {{classname}}::class . ':{{operationId}}' +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} + )->add( + $basicAuth +{{/isBasic}} +{{/authMethods}} +{{/hasAuthMethods}} + ); {{/operation}} {{/operations}} {{/apis}} diff --git a/modules/openapi-generator/src/main/resources/php-slim-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/composer.mustache index e3e22cf148..a27e79ec42 100644 --- a/modules/openapi-generator/src/main/resources/php-slim-server/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim-server/composer.mustache @@ -2,7 +2,8 @@ "minimum-stability": "RC", "require": { "php": ">=5.5", - "slim/slim": "3.*" + "slim/slim": "3.*", + "tuupola/slim-basic-auth": "^3.0.0" }, "require-dev": { "phpunit/phpunit": "^4.8" diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache index 33feac7acd..31ed22373a 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache @@ -238,7 +238,7 @@ module {{moduleName}} tempfile.write(chunk) end request.on_complete do |response| - tempfile.close + tempfile.close if tempfile @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ "will be deleted automatically with GC. It's also recommended to delete the temp file "\ diff --git a/modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache b/modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache index 9bc9d341d8..98c7e3c7e5 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache @@ -136,7 +136,7 @@ Style/UnneededPercentQ: # Align `end` with the matching keyword or starting expression except for # assignments, where it should be aligned with the LHS. -Lint/EndAlignment: +Layout/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable AutoCorrect: true diff --git a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Dockerfile b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Dockerfile new file mode 100644 index 0000000000..d53cf3aacd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Dockerfile @@ -0,0 +1,29 @@ +FROM ruby:2.5-alpine + +ENV BUILD_PACKAGES="curl-dev ruby-dev build-base" \ + DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev sqlite-dev" \ + RUBY_PACKAGES="ruby-json yaml nodejs" + +RUN apk update && \ + apk upgrade && \ + apk add --no-cache --update\ + $BUILD_PACKAGES \ + $DEV_PACKAGES \ + $RUBY_PACKAGES && \ + mkdir -p /usr/src/myapp + +WORKDIR /usr/src/myapp + +COPY Gemfile ./ +RUN gem install bundler +RUN bundle config build.nokogiri --use-system-libraries && \ + bundle install --jobs=4 --retry=10 --clean + +COPY . ./ +RUN chmod +x bin/rails + +COPY docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-entrypoint.sh +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["bin/rails", "s", "-b", "0.0.0.0"] diff --git a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Gemfile b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Gemfile.mustache similarity index 90% rename from modules/openapi-generator/src/main/resources/ruby-on-rails-server/Gemfile rename to modules/openapi-generator/src/main/resources/ruby-on-rails-server/Gemfile.mustache index a46942406d..ea808507a7 100644 --- a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Gemfile +++ b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/Gemfile.mustache @@ -3,8 +3,14 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' +{{#isDBSQLite}} +# Use sqlite as the database for Active Record +gem 'sqlite3', '~> 1.3' +{{/isDBSQLite}} +{{#isDBMySQL}} # Use mysql as the database for Active Record gem 'mysql2', '>= 0.3.18', '< 0.5' +{{/isDBMySQL}} # Use Puma as the app server gem 'puma', '~> 3.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder @@ -33,4 +39,4 @@ group :development do end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/database.yml b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/database.mustache similarity index 72% rename from modules/openapi-generator/src/main/resources/ruby-on-rails-server/database.yml rename to modules/openapi-generator/src/main/resources/ruby-on-rails-server/database.mustache index e536d9f37d..170b64b24f 100644 --- a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/database.yml +++ b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/database.mustache @@ -1,3 +1,4 @@ +{{#isDBMySQL}} # MySQL. Versions 5.0 and up are supported. # # Install the MySQL driver @@ -52,3 +53,28 @@ production: database: api_demo_production username: api_demo password: <%= ENV['API_DEMO_DATABASE_PASSWORD'] %> +{{/isDBMySQL}} +{{#isDBSQLite}} +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 +{{/isDBSQLite}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ruby-on-rails-server/docker-entrypoint.sh b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/docker-entrypoint.sh new file mode 100644 index 0000000000..93372e8393 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-on-rails-server/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +if [ "$1" = 'bin/rails' ] && [ "$2" = 's' ]; then + rm -f /myapp/tmp/pids/server.pid + bin/rails db:migrate +fi + +exec "$@" diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache index 21b1b469f8..ec0c88692d 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache @@ -43,6 +43,14 @@ use {Api{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, }; use models; +define_encode_set! { + /// This encode set is used for object IDs + /// + /// Aside from the special characters defined in the `PATH_SEGMENT_ENCODE_SET`, + /// the vertical bar (|) is encoded. + pub ID_ENCODE_SET = [PATH_SEGMENT_ENCODE_SET] | {'|'} +} + /// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result { // First convert to Uri, since a base path is a subset of Uri. @@ -246,7 +254,7 @@ impl Api for Client where let uri = format!( "{}{{{basePathWithoutHost}}}{{path}}{{#queryParams}}{{#-first}}?{{/-first}}{{=<% %>=}}{<% paramName %>}<%={{ }}=%>{{/queryParams}}", - self.base_path{{#pathParams}}, {{{baseName}}}=utf8_percent_encode(¶m_{{{paramName}}}.to_string(), PATH_SEGMENT_ENCODE_SET){{/pathParams}}{{#queryParams}}, + self.base_path{{#pathParams}}, {{{baseName}}}=utf8_percent_encode(¶m_{{{paramName}}}.to_string(), ID_ENCODE_SET){{/pathParams}}{{#queryParams}}, {{{paramName}}}=utf8_percent_encode(&query_{{{paramName}}}, QUERY_ENCODE_SET){{/queryParams}} ); diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index 371962bf6d..bca0608ecf 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -19,6 +19,9 @@ extern crate hyper; extern crate swagger; +#[macro_use] +extern crate url; + use futures::Stream; use std::io::Error; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientCodegenTest.java index 96f49448ce..40b4cb9c52 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientCodegenTest.java @@ -17,11 +17,17 @@ package org.openapitools.codegen.perl; -import org.testng.Assert; -import org.testng.annotations.Test; +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.parser.core.models.ParseOptions; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.languages.PerlClientCodegen; +import org.openapitools.codegen.utils.ModelUtils; +import org.testng.Assert; +import org.testng.annotations.Test; public class PerlClientCodegenTest { @@ -54,4 +60,14 @@ public class PerlClientCodegenTest { Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); } + @Test + public void testIssue677() { + final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/issue677.yaml", null, new ParseOptions()).getOpenAPI(); + final PerlClientCodegen codegen = new PerlClientCodegen(); + + Operation operation = openAPI.getPaths().get("/issue677").getPost(); + CodegenOperation co = codegen.fromOperation("/issue677", "POST", operation, ModelUtils.getSchemas(openAPI), openAPI); + Assert.assertNotNull(co); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java new file mode 100644 index 0000000000..30ffd00434 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.php; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.PhpLaravelServerCodegen; + +public class PhpLaravelServerCodegenTest { + + @Test + public void testInitialConfigValues() throws Exception { + final PhpLaravelServerCodegen codegen = new PhpLaravelServerCodegen(); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); + } + + @Test + public void testSettersForConfigValues() throws Exception { + final PhpLaravelServerCodegen codegen = new PhpLaravelServerCodegen(); + codegen.setHideGenerationTimestamp(false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + } + + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + final PhpLaravelServerCodegen codegen = new PhpLaravelServerCodegen(); + codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java new file mode 100644 index 0000000000..5183502601 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java @@ -0,0 +1,19 @@ +package org.openapitools.codegen.typescript.typescriptnode; + +import org.openapitools.codegen.languages.TypeScriptNodeClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TypeScriptNodeClientCodegenTest { + + @Test + public void convertVarName() throws Exception { + TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); + Assert.assertEquals(codegen.toVarName("name"), "name"); + Assert.assertEquals(codegen.toVarName("$name"), "$name"); + Assert.assertEquals(codegen.toVarName("nam$$e"), "nam$$e"); + Assert.assertEquals(codegen.toVarName("user-name"), "userName"); + Assert.assertEquals(codegen.toVarName("user_name"), "userName"); + Assert.assertEquals(codegen.toVarName("user|name"), "userName"); + } +} diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 7661071966..5fc7ebf070 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -929,8 +929,8 @@ paths: tags: - "$another-fake?" summary: To test special tags - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags consumes: - application/json produces: diff --git a/modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml b/modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml new file mode 100644 index 0000000000..b1874cc158 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml @@ -0,0 +1,21 @@ +swagger: '2.0' +info: + description: "This spec is for testing rust-server-specific things" + version: 1.0.0 + title: rust-server-test +schemes: + - http +paths: + /dummy: + get: + summary: A dummy endpoint to make the spec valid. + responses: + '200': + description: Success +definitions: + additionalPropertiesObject: + description: An additionalPropertiesObject + type: object + additionalProperties: + type: string + example: "foo" diff --git a/modules/openapi-generator/src/test/resources/3_0/issue677.yaml b/modules/openapi-generator/src/test/resources/3_0/issue677.yaml new file mode 100644 index 0000000000..1aa5a1c6d7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue677.yaml @@ -0,0 +1,21 @@ +openapi: 3.0.1 +info: + title: My title + description: API under test + version: 1.0.7 +servers: +- url: https://localhost:9999/root +paths: + /issue677: + post: + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + responses: + 201: + description: OK +components: {} diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index bda4b8071d..78ba11aaeb 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -898,8 +898,8 @@ paths: tags: - $another-fake? summary: To test special tags - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags responses: '200': description: successful operation diff --git a/pom.xml b/pom.xml index 8665e878c6..13ddbd76f6 100644 --- a/pom.xml +++ b/pom.xml @@ -1054,7 +1054,7 @@ - 2.0.1 + 2.0.2-OpenAPITools.org-1 2.0.1 2.11.1 3.3.0 diff --git a/samples/client/petstore/apex/.gitignore b/samples/client/petstore/apex/.gitignore deleted file mode 100644 index c206f2e86e..0000000000 --- a/samples/client/petstore/apex/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -*DS_Store* - -/Referenced Packages -/salesforce.schema - -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# Eclipse -.project -.externalToolBuilders/ -*.launch - -*.iml -.idea - -*.sublime* -config diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 096bf47efe..4395ff5923 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/apex/README.md b/samples/client/petstore/apex/README.md index f0f31cf669..a1481aea07 100644 --- a/samples/client/petstore/apex/README.md +++ b/samples/client/petstore/apex/README.md @@ -1,119 +1,59 @@ -# Swagger Petstore API Client +# OpenAPI Petstore API Client -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. ## Requirements -- [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) -- [Apache Ant](http://ant.apache.org/) version 1.6 or later -- [Force.com Migration Tool](https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_install.htm) - - The `ant-salesforce.jar` file included with the Force.com Migration Tool must be placed in the root directory of this project (in the same directory as this README and `build.xml`) -- `ANT_HOME` and `JAVA_HOME` environment variables must be set accordingly - - On Windows, `JAVA_HOME` will probably look something like this: +- [Salesforce DX](https://www.salesforce.com/products/platform/products/salesforce-dx/) - ``` - JAVA_HOME = C:\Program Files\Java\jdk1.8.0_121 - ``` - -- The `bin` directory from Ant must be on your `PATH` If everything is set correctly: -- Running `java -version` in a command prompt should output something like: +- Running `sfdx version` in a command prompt should output something like: ```bash - java version "1.8.0_121" - Java(TM) SE Runtime Environment (build 1.8.0_121-b13) - Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) + sfdx-cli/5.7.5-05549de (darwin-amd64) go1.7.5 sfdxstable ``` -- Running `ant -version` should output something like: - - ```bash - Apache Ant(TM) version 1.10.1 compiled on February 2 2017 - ``` - -For more information, see ## Installation +1. Copy the output into your Salesforce DX folder - or alternatively deploy the output directly into the workspace. +2. Deploy the code via Salesforce DX to your Scratch Org -1. Clone the repo from GitHub + ```bash + $ sfdx force:source:push + ``` +3. If the API needs authentication update the Named Credential in Setup. +4. Run your Apex tests using ```bash - $ git clone git@github.com:GIT_USER_ID/GIT_REPO_ID.git + $ sfdx sfdx force:apex:test:run ``` +5. Retrieve the job id from the console and check the test results. - Or, [download](https://github.com/GIT_USER_ID/GIT_REPO_ID/archive/master.zip) the repo as a ZIP and extract it to `GIT_REPO_ID` + ```bash + $ sfdx force:apex:test:report -i theJobId + ``` -1. Set the `SF_USERNAME` and `SF_PASSWORD` environment variables to your Salesforce username and password. Alternatively, they may be set in `build.properties`. Environment variables will override the values in `build.properties` if set. - - `SF_SESSIONID` may also be set instead of `SF_USERNAME` and `SF_PASSWORD` (more info in `build.properties`) - -2. Open up a command prompt in the root project directory `GIT_REPO_ID` (the same directory as this README and `build.xml`) -3. Deploy to your Salesforce org - - ```bash - $ ant deploy - ``` - - This command will: - - - deploy all classes in the `deploy/classes` directory to your Salesforce org - - create a new [unmanaged package](https://help.salesforce.com/articleView?id=sharing_apps.htm) called **Swagger Petstore API Client** - - execute all of the unit tests included in this package (at least 75% code coverage required) - - create a new [remote site](https://help.salesforce.com/articleView?id=configuring_remoteproxy.htm) called **Swagger_Petstore** configured for the endpoint: - - rolls back any changes upon any error - - A successful deployment will look like this: - - ```bash - [sf:deploy] Request Status: Succeeded - [sf:deploy] *********** DEPLOYMENT SUCCEEDED *********** - [sf:deploy] Finished request 0Af7A00000Ebd5oSAB successfully. - - BUILD SUCCESSFUL - Total time: 34 seconds - ``` - -### Test deployment only - -To perform a test deployment without committing changes: - -```bash -$ ant deployCheckOnly -``` - -All of the included tests will run as if it were a real deployment. Tests and other validations will report back while leaving your org untouched, allowing you to verify that a deployment will succeed without affecting anything in the org. - -### Uninstallation - -```bash -$ ant undeploy -``` - -Removes all classes and the Remote Site created by this package. ## Getting Started Please follow the [installation](#installation) instruction and execute the following Apex code: ```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); +OASPetApi api = new OASPetApi(); +OASClient client = api.getClient(); -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); Map params = new Map{ - 'body' => SwagPet.getExample() + 'oaSPet' => OASPet.getExample() }; try { // cross your fingers api.addPet(params); -} catch (Swagger.ApiException e) { +} catch (OAS.ApiException e) { // ...handle your exceptions } ``` @@ -124,36 +64,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SwagPetApi* | [**addPet**](docs/SwagPetApi.md#addPet) | **POST** /pet | Add a new pet to the store -*SwagPetApi* | [**deletePet**](docs/SwagPetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -*SwagPetApi* | [**findPetsByStatus**](docs/SwagPetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -*SwagPetApi* | [**findPetsByTags**](docs/SwagPetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -*SwagPetApi* | [**getPetById**](docs/SwagPetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -*SwagPetApi* | [**updatePet**](docs/SwagPetApi.md#updatePet) | **PUT** /pet | Update an existing pet -*SwagPetApi* | [**updatePetWithForm**](docs/SwagPetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -*SwagPetApi* | [**uploadFile**](docs/SwagPetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SwagStoreApi* | [**deleteOrder**](docs/SwagStoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SwagStoreApi* | [**getInventory**](docs/SwagStoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*SwagStoreApi* | [**getOrderById**](docs/SwagStoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -*SwagStoreApi* | [**placeOrder**](docs/SwagStoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet -*SwagUserApi* | [**createUser**](docs/SwagUserApi.md#createUser) | **POST** /user | Create user -*SwagUserApi* | [**createUsersWithArrayInput**](docs/SwagUserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -*SwagUserApi* | [**createUsersWithListInput**](docs/SwagUserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -*SwagUserApi* | [**deleteUser**](docs/SwagUserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -*SwagUserApi* | [**getUserByName**](docs/SwagUserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -*SwagUserApi* | [**loginUser**](docs/SwagUserApi.md#loginUser) | **GET** /user/login | Logs user into the system -*SwagUserApi* | [**logoutUser**](docs/SwagUserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -*SwagUserApi* | [**updateUser**](docs/SwagUserApi.md#updateUser) | **PUT** /user/{username} | Updated user +*OASPetApi* | [**addPet**](OASPetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*OASPetApi* | [**deletePet**](OASPetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*OASPetApi* | [**findPetsByStatus**](OASPetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*OASPetApi* | [**findPetsByTags**](OASPetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*OASPetApi* | [**getPetById**](OASPetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*OASPetApi* | [**updatePet**](OASPetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*OASPetApi* | [**updatePetWithForm**](OASPetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*OASPetApi* | [**uploadFile**](OASPetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*OASStoreApi* | [**deleteOrder**](OASStoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*OASStoreApi* | [**getInventory**](OASStoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*OASStoreApi* | [**getOrderById**](OASStoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*OASStoreApi* | [**placeOrder**](OASStoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*OASUserApi* | [**createUser**](OASUserApi.md#createUser) | **POST** /user | Create user +*OASUserApi* | [**createUsersWithArrayInput**](OASUserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*OASUserApi* | [**createUsersWithListInput**](OASUserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*OASUserApi* | [**deleteUser**](OASUserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*OASUserApi* | [**getUserByName**](OASUserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*OASUserApi* | [**loginUser**](OASUserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*OASUserApi* | [**logoutUser**](OASUserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*OASUserApi* | [**updateUser**](OASUserApi.md#updateUser) | **PUT** /user/{username} | Updated user ## Documentation for Models - - [SwagApiResponse](docs/SwagApiResponse.md) - - [SwagCategory](docs/SwagCategory.md) - - [SwagOrder](docs/SwagOrder.md) - - [SwagPet](docs/SwagPet.md) - - [SwagTag](docs/SwagTag.md) - - [SwagUser](docs/SwagUser.md) + - [OASApiResponse](OASApiResponse.md) + - [OASCategory](OASCategory.md) + - [OASOrder](OASOrder.md) + - [OASPet](OASPet.md) + - [OASTag](OASTag.md) + - [OASUser](OASUser.md) ## Documentation for Authorization @@ -169,7 +109,7 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - write:pets: modify pets in your account - read:pets: read your pets @@ -177,5 +117,5 @@ Authentication schemes defined for the API: ## Author -apiteam@swagger.io + diff --git a/samples/client/petstore/apex/build.properties b/samples/client/petstore/apex/build.properties deleted file mode 100644 index 93b38a78f5..0000000000 --- a/samples/client/petstore/apex/build.properties +++ /dev/null @@ -1,37 +0,0 @@ -# build.properties -# - -# The first three properties (SF_USERNAME, SF_PASSWORD, SF_SESSIONID) may either be specified below -# or set from environment variables of the same names. The remaining non-uppercase properties, which -# have the "sf." prefix (e.g.: sf.serverurl) may only be specified in this file and not from -# environment variables. - -# Required if sessionId isn’t specified. The Salesforce username for login. The username associated -# with this connection must have the “Modify All Data” permission. Typically, this is only enabled -# for System Administrator users. -# -# SF_USERNAME = username@example.com - -# Required if sessionId isn’t specified. The password you use to log in to the org associated with -# this project. If you are using a security token, paste the 25-digit token value to the end of your -# password. -# -# SF_PASSWORD = password123 - -# Required if username and password aren’t specified. The ID of an active Salesforce session or the -# OAuth access token. A session is created after a user logs in to Salesforce successfully with a -# username and password. Use a session ID for logging in to an existing session instead of creating -# a new session. Alternatively, use an access token for OAuth authentication. For more information, -# see Authenticating Apps with OAuth in the Salesforce Help. -# -# SF_SESSIONID = 0000... - -# Optional. The Salesforce server URL (if blank, defaults to login.salesforce.com). To connect to a -# sandbox instance, change this to test.salesforce.com. -# -sf.serverurl = test.salesforce.com - -# Optional. Defaults to 200. The number of times to poll the server for the results of the deploy -# request. Note that deployment can succeed even if you stop waiting. -# -sf.maxPoll = 200 diff --git a/samples/client/petstore/apex/build.xml b/samples/client/petstore/apex/build.xml deleted file mode 100644 index b6c2b20175..0000000000 --- a/samples/client/petstore/apex/build.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SwagPetApiTest - SwagStoreApiTest - SwagUserApiTest - SwagApiResponseTest - SwagCategoryTest - SwagOrderTest - SwagPetTest - SwagTagTest - SwagUserTest - SwaggerTest - - - - - - - - - - - - - SwagPetApiTest - SwagStoreApiTest - SwagUserApiTest - SwagApiResponseTest - SwagCategoryTest - SwagOrderTest - SwagPetTest - SwagTagTest - SwagUserTest - SwaggerTest - - - diff --git a/samples/client/petstore/apex/config/project-scratch-def.json b/samples/client/petstore/apex/config/project-scratch-def.json new file mode 100644 index 0000000000..36aace5526 --- /dev/null +++ b/samples/client/petstore/apex/config/project-scratch-def.json @@ -0,0 +1,8 @@ +{ + "orgName": "muenzpraeger - René Winkelmeyer", + "edition": "Developer", + "orgPreferences": { + "enabled": ["S1DesktopEnabled"], + "disabled": ["S1EncryptedStoragePref2"] + } +} diff --git a/samples/client/petstore/apex/deploy/classes/SwagApiResponse.cls b/samples/client/petstore/apex/deploy/classes/SwagApiResponse.cls deleted file mode 100644 index 8f87c98fd1..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagApiResponse.cls +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Describes the result of uploading an image resource - */ -public class SwagApiResponse implements Swagger.MappedProperties { - /** - * Get code - * @return code - */ - public Integer code { get; set; } - - /** - * Get r_type - * @return r_type - */ - public String r_type { get; set; } - - /** - * Get message - * @return message - */ - public String message { get; set; } - - private static final Map propertyMappings = new Map{ - 'type' => 'r_type' - }; - - public Map getPropertyMappings() { - return propertyMappings; - } - - public static SwagApiResponse getExample() { - SwagApiResponse apiResponse = new SwagApiResponse(); - apiResponse.code = 123; - apiResponse.r_type = 'aeiou'; - apiResponse.message = 'aeiou'; - return apiResponse; - } - - public Boolean equals(Object obj) { - if (obj instanceof SwagApiResponse) { - SwagApiResponse apiResponse = (SwagApiResponse) obj; - return this.code == apiResponse.code - && this.r_type == apiResponse.r_type - && this.message == apiResponse.message; - } - return false; - } - - public Integer hashCode() { - Integer hashCode = 43; - hashCode = (17 * hashCode) + (code == null ? 0 : System.hashCode(code)); - hashCode = (17 * hashCode) + (r_type == null ? 0 : System.hashCode(r_type)); - hashCode = (17 * hashCode) + (message == null ? 0 : System.hashCode(message)); - return hashCode; - } -} - diff --git a/samples/client/petstore/apex/deploy/classes/SwagCategory.cls b/samples/client/petstore/apex/deploy/classes/SwagCategory.cls deleted file mode 100644 index b9e0e81b13..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagCategory.cls +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * A category for a pet - */ -public class SwagCategory { - /** - * Get id - * @return id - */ - public Long id { get; set; } - - /** - * Get name - * @return name - */ - public String name { get; set; } - - public static SwagCategory getExample() { - SwagCategory category = new SwagCategory(); - category.id = 123456789L; - category.name = 'aeiou'; - return category; - } - - public Boolean equals(Object obj) { - if (obj instanceof SwagCategory) { - SwagCategory category = (SwagCategory) obj; - return this.id == category.id - && this.name == category.name; - } - return false; - } - - public Integer hashCode() { - Integer hashCode = 43; - hashCode = (17 * hashCode) + (id == null ? 0 : System.hashCode(id)); - hashCode = (17 * hashCode) + (name == null ? 0 : System.hashCode(name)); - return hashCode; - } -} - diff --git a/samples/client/petstore/apex/deploy/classes/SwagCategoryTest.cls b/samples/client/petstore/apex/deploy/classes/SwagCategoryTest.cls deleted file mode 100644 index 8689ece6dc..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagCategoryTest.cls +++ /dev/null @@ -1,80 +0,0 @@ -@isTest -private class SwagCategoryTest { - @isTest - private static void equalsSameInstance() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = category1; - SwagCategory category3 = new SwagCategory(); - SwagCategory category4 = category3; - - System.assert(category1.equals(category2)); - System.assert(category2.equals(category1)); - System.assert(category1.equals(category1)); - System.assert(category3.equals(category4)); - System.assert(category4.equals(category3)); - System.assert(category3.equals(category3)); - } - - @isTest - private static void equalsIdenticalInstance() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = SwagCategory.getExample(); - SwagCategory category3 = new SwagCategory(); - SwagCategory category4 = new SwagCategory(); - - System.assert(category1.equals(category2)); - System.assert(category2.equals(category1)); - System.assert(category3.equals(category4)); - System.assert(category4.equals(category3)); - } - - @isTest - private static void notEqualsUnlikeInstance() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); - - System.assertEquals(false, category1.equals(category2)); - System.assertEquals(false, category2.equals(category1)); - } - - @isTest - private static void notEqualsDifferentType() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); - - System.assertEquals(false, category1.equals('foo')); - System.assertEquals(false, category2.equals('foo')); - } - - @isTest - private static void notEqualsNull() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); - SwagCategory category3; - - System.assertEquals(false, category1.equals(category3)); - System.assertEquals(false, category2.equals(category3)); - } - - @isTest - private static void consistentHashCodeValue() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); - - System.assertEquals(category1.hashCode(), category1.hashCode()); - System.assertEquals(category2.hashCode(), category2.hashCode()); - } - - @isTest - private static void equalInstancesHaveSameHashCode() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = SwagCategory.getExample(); - SwagCategory category3 = new SwagCategory(); - SwagCategory category4 = new SwagCategory(); - - System.assert(category1.equals(category2)); - System.assert(category3.equals(category4)); - System.assertEquals(category1.hashCode(), category2.hashCode()); - System.assertEquals(category3.hashCode(), category4.hashCode()); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagClient.cls b/samples/client/petstore/apex/deploy/classes/SwagClient.cls deleted file mode 100644 index 97804910ed..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagClient.cls +++ /dev/null @@ -1,7 +0,0 @@ -public class SwagClient extends Swagger.ApiClient { - public SwagClient() { - basePath = 'http://petstore.swagger.io/v2'; - authentications.put('api_key', new Swagger.ApiKeyHeaderAuth('api_key')); - authentications.put('petstore_auth', new Swagger.OAuth2()); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagClient.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagClient.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagClient.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagOrder.cls b/samples/client/petstore/apex/deploy/classes/SwagOrder.cls deleted file mode 100644 index 775081a55c..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagOrder.cls +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * An order for a pets from the pet store - */ -public class SwagOrder { - /** - * Get id - * @return id - */ - public Long id { get; set; } - - /** - * Get petId - * @return petId - */ - public Long petId { get; set; } - - /** - * Get quantity - * @return quantity - */ - public Integer quantity { get; set; } - - /** - * Get shipDate - * @return shipDate - */ - public Datetime shipDate { get; set; } - - /** - * Order Status - */ - public enum StatusEnum { - PLACED, - APPROVED, - DELIVERED - } - - /** - * Order Status - * @return status - */ - public StatusEnum status { get; set; } - - /** - * Get complete - * @return complete - */ - public Boolean complete { get; set; } - - public SwagOrder() { - complete = false; - } - - public static SwagOrder getExample() { - SwagOrder order = new SwagOrder(); - order.id = 123456789L; - order.petId = 123456789L; - order.quantity = 123; - order.shipDate = Datetime.newInstanceGmt(2000, 1, 23, 4, 56, 7); - order.status = StatusEnum.PLACED; - order.complete = true; - return order; - } - - public Boolean equals(Object obj) { - if (obj instanceof SwagOrder) { - SwagOrder order = (SwagOrder) obj; - return this.id == order.id - && this.petId == order.petId - && this.quantity == order.quantity - && this.shipDate == order.shipDate - && this.status == order.status - && this.complete == order.complete; - } - return false; - } - - public Integer hashCode() { - Integer hashCode = 43; - hashCode = (17 * hashCode) + (id == null ? 0 : System.hashCode(id)); - hashCode = (17 * hashCode) + (petId == null ? 0 : System.hashCode(petId)); - hashCode = (17 * hashCode) + (quantity == null ? 0 : System.hashCode(quantity)); - hashCode = (17 * hashCode) + (shipDate == null ? 0 : System.hashCode(shipDate)); - hashCode = (17 * hashCode) + (status == null ? 0 : System.hashCode(status)); - hashCode = (17 * hashCode) + (complete == null ? 0 : System.hashCode(complete)); - return hashCode; - } -} - diff --git a/samples/client/petstore/apex/deploy/classes/SwagOrder.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagOrder.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagOrder.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagOrderTest.cls b/samples/client/petstore/apex/deploy/classes/SwagOrderTest.cls deleted file mode 100644 index 090eea45e5..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagOrderTest.cls +++ /dev/null @@ -1,91 +0,0 @@ -@isTest -private class SwagOrderTest { - @isTest - private static void equalsSameInstance() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = order1; - SwagOrder order3 = new SwagOrder(); - SwagOrder order4 = order3; - - System.assert(order1.equals(order2)); - System.assert(order2.equals(order1)); - System.assert(order1.equals(order1)); - System.assert(order3.equals(order4)); - System.assert(order4.equals(order3)); - System.assert(order3.equals(order3)); - } - - @isTest - private static void equalsIdenticalInstance() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = SwagOrder.getExample(); - SwagOrder order3 = new SwagOrder(); - SwagOrder order4 = new SwagOrder(); - - System.assert(order1.equals(order2)); - System.assert(order2.equals(order1)); - System.assert(order3.equals(order4)); - System.assert(order4.equals(order3)); - } - - @isTest - private static void notEqualsUnlikeInstance() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); - - System.assertEquals(false, order1.equals(order2)); - System.assertEquals(false, order2.equals(order1)); - } - - @isTest - private static void notEqualsDifferentType() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); - - System.assertEquals(false, order1.equals('foo')); - System.assertEquals(false, order2.equals('foo')); - } - - @isTest - private static void notEqualsNull() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); - SwagOrder order3; - - System.assertEquals(false, order1.equals(order3)); - System.assertEquals(false, order2.equals(order3)); - } - - @isTest - private static void consistentHashCodeValue() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); - - System.assertEquals(order1.hashCode(), order1.hashCode()); - System.assertEquals(order2.hashCode(), order2.hashCode()); - } - - @isTest - private static void equalInstancesHaveSameHashCode() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = SwagOrder.getExample(); - SwagOrder order3 = new SwagOrder(); - SwagOrder order4 = new SwagOrder(); - - System.assert(order1.equals(order2)); - System.assert(order3.equals(order4)); - System.assertEquals(order1.hashCode(), order2.hashCode()); - System.assertEquals(order3.hashCode(), order4.hashCode()); - } - - @isTest - private static void defaultValuesPopulated() { - SwagOrder order = new SwagOrder(); - System.assertEquals(false, order.complete); - System.assertEquals(null, order.id); - System.assertEquals(null, order.petId); - System.assertEquals(null, order.quantity); - System.assertEquals(null, order.shipDate); - System.assertEquals(null, order.status); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagOrderTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagOrderTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagOrderTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagPet.cls b/samples/client/petstore/apex/deploy/classes/SwagPet.cls deleted file mode 100644 index 4c0b2346a8..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPet.cls +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * A pet for sale in the pet store - */ -public class SwagPet { - /** - * Get id - * @return id - */ - public Long id { get; set; } - - /** - * Get category - * @return category - */ - public SwagCategory category { get; set; } - - /** - * Get name - * @return name - */ - public String name { get; set; } - - /** - * Get photoUrls - * @return photoUrls - */ - public List photoUrls { get; set; } - - /** - * Get tags - * @return tags - */ - public List tags { get; set; } - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE, - PENDING, - SOLD - } - - /** - * pet status in the store - * @return status - */ - public StatusEnum status { get; set; } - - public SwagPet() { - photoUrls = new List(); - tags = new List(); - } - - public static SwagPet getExample() { - SwagPet pet = new SwagPet(); - pet.id = 123456789L; - pet.category = SwagCategory.getExample(); - pet.name = 'doggie'; - pet.photoUrls = new List{'aeiou'}; - pet.tags = new List{SwagTag.getExample()}; - pet.status = StatusEnum.AVAILABLE; - return pet; - } - - public Boolean equals(Object obj) { - if (obj instanceof SwagPet) { - SwagPet pet = (SwagPet) obj; - return this.id == pet.id - && this.category == pet.category - && this.name == pet.name - && this.photoUrls == pet.photoUrls - && this.tags == pet.tags - && this.status == pet.status; - } - return false; - } - - public Integer hashCode() { - Integer hashCode = 43; - hashCode = (17 * hashCode) + (id == null ? 0 : System.hashCode(id)); - hashCode = (17 * hashCode) + (category == null ? 0 : System.hashCode(category)); - hashCode = (17 * hashCode) + (name == null ? 0 : System.hashCode(name)); - hashCode = (17 * hashCode) + (photoUrls == null ? 0 : System.hashCode(photoUrls)); - hashCode = (17 * hashCode) + (tags == null ? 0 : System.hashCode(tags)); - hashCode = (17 * hashCode) + (status == null ? 0 : System.hashCode(status)); - return hashCode; - } -} - diff --git a/samples/client/petstore/apex/deploy/classes/SwagPet.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagPet.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPet.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagPetApi.cls b/samples/client/petstore/apex/deploy/classes/SwagPetApi.cls deleted file mode 100644 index 059b7bdcd7..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPetApi.cls +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -public class SwagPetApi { - SwagClient client; - - public SwagPetApi(SwagClient client) { - this.client = client; - } - - public SwagPetApi() { - this.client = new SwagClient(); - } - - public SwagClient getClient() { - return this.client; - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void addPet(Map params) { - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - client.invoke( - 'POST', '/pet', - (SwagPet) params.get('body'), - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'petstore_auth' }, - null - ); - } - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @throws Swagger.ApiException if fails to make API call - */ - public void deletePet(Map params) { - client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); - - client.invoke( - 'DELETE', '/pet/{petId}', '', - query, form, - new Map{ - 'petId' => (Long) params.get('petId') - }, - new Map{ - 'api_key' => (String) params.get('apiKey') - }, - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'petstore_auth' }, - null - ); - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return List - * @throws Swagger.ApiException if fails to make API call - */ - public List findPetsByStatus(Map params) { - client.assertNotNull(params.get('status'), 'status'); - List query = new List(); - - // cast query params to verify their expected type - query.addAll(client.makeParam('status', (List) params.get('status'), 'csv')); - - List form = new List(); - - return (List) client.invoke( - 'GET', '/pet/findByStatus', '', - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'petstore_auth' }, - List.class - ); - } - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return List - * @throws Swagger.ApiException if fails to make API call - */ - public List findPetsByTags(Map params) { - client.assertNotNull(params.get('tags'), 'tags'); - List query = new List(); - - // cast query params to verify their expected type - query.addAll(client.makeParam('tags', (List) params.get('tags'), 'csv')); - - List form = new List(); - - return (List) client.invoke( - 'GET', '/pet/findByTags', '', - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'petstore_auth' }, - List.class - ); - } - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return SwagPet - * @throws Swagger.ApiException if fails to make API call - */ - public SwagPet getPetById(Map params) { - client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); - - return (SwagPet) client.invoke( - 'GET', '/pet/{petId}', '', - query, form, - new Map{ - 'petId' => (Long) params.get('petId') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'api_key' }, - SwagPet.class - ); - } - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void updatePet(Map params) { - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - client.invoke( - 'PUT', '/pet', - (SwagPet) params.get('body'), - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'petstore_auth' }, - null - ); - } - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @throws Swagger.ApiException if fails to make API call - */ - public void updatePetWithForm(Map params) { - client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); - - // cast form params to verify their expected type - form.addAll(client.makeParam('name', (String) params.get('name'))); - form.addAll(client.makeParam('status', (String) params.get('status'))); - - client.invoke( - 'POST', '/pet/{petId}', '', - query, form, - new Map{ - 'petId' => (Long) params.get('petId') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/x-www-form-urlencoded' }, - new List { 'petstore_auth' }, - null - ); - } - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return SwagApiResponse - * @throws Swagger.ApiException if fails to make API call - */ - public SwagApiResponse uploadFile(Map params) { - client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); - - // cast form params to verify their expected type - form.addAll(client.makeParam('additionalMetadata', (String) params.get('additionalMetadata'))); - form.addAll(client.makeParam('file', (Blob) params.get('file'))); - - return (SwagApiResponse) client.invoke( - 'POST', '/pet/{petId}/uploadImage', '', - query, form, - new Map{ - 'petId' => (Long) params.get('petId') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/x-www-form-urlencoded' }, - new List { 'petstore_auth' }, - SwagApiResponse.class - ); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagPetApi.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagPetApi.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPetApi.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagPetApiTest.cls b/samples/client/petstore/apex/deploy/classes/SwagPetApiTest.cls deleted file mode 100644 index e0f872e71b..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPetApiTest.cls +++ /dev/null @@ -1,247 +0,0 @@ -@isTest -private class SwagPetApiTest { - /** - * Add a new pet to the store - * - * - */ - @isTest - private static void addPetTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(201); - res.setStatus('Created'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagPet.getExample() - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - api.addPet(params); - } - - /** - * Deletes a pet - * - * - */ - @isTest - private static void deletePetTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L, - 'apiKey' => 'apiKey_example' - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - api.deletePet(params); - } - - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - */ - @isTest - private static void findPetsByStatusTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'status' => new List{'available'} - }; - - SwagClient client; - SwagPetApi api; - List response; - List expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('[ {\n "photoUrls" : [ "aeiou" ],\n "name" : "doggie",\n "id" : 0,\n "category" : {\n "name" : "aeiou",\n "id" : 6\n },\n "tags" : [ {\n "name" : "aeiou",\n "id" : 1\n } ],\n "status" : "available"\n} ]'); - expectedResponse = new List{SwagPet.getExample()}; - response = (List) api.findPetsByStatus(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - */ - @isTest - private static void findPetsByTagsTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'tags' => new List{'aeiou'} - }; - - SwagClient client; - SwagPetApi api; - List response; - List expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('[ {\n "photoUrls" : [ "aeiou" ],\n "name" : "doggie",\n "id" : 0,\n "category" : {\n "name" : "aeiou",\n "id" : 6\n },\n "tags" : [ {\n "name" : "aeiou",\n "id" : 1\n } ],\n "status" : "available"\n} ]'); - expectedResponse = new List{SwagPet.getExample()}; - response = (List) api.findPetsByTags(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Find pet by ID - * - * Returns a single pet - */ - @isTest - private static void getPetByIdTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L - }; - - SwagClient client; - SwagPetApi api; - SwagPet response; - SwagPet expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.ApiKeyAuth) client.getAuthentication('api_key')) - .setApiKey('foo-bar-api-key'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "photoUrls" : [ "aeiou" ],\n "name" : "doggie",\n "id" : 0,\n "category" : {\n "name" : "aeiou",\n "id" : 6\n },\n "tags" : [ {\n "name" : "aeiou",\n "id" : 1\n } ],\n "status" : "available"\n}'); - expectedResponse = SwagPet.getExample(); - response = (SwagPet) api.getPetById(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Update an existing pet - * - * - */ - @isTest - private static void updatePetTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagPet.getExample() - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - api.updatePet(params); - } - - /** - * Updates a pet in the store with form data - * - * - */ - @isTest - private static void updatePetWithFormTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L, - 'name' => 'name_example', - 'status' => 'status_example' - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - api.updatePetWithForm(params); - } - - /** - * uploads an image - * - * - */ - @isTest - private static void uploadFileTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L, - 'additionalMetadata' => 'additionalMetadata_example', - 'file' => Blob.valueOf('Sample text file\nContents') - }; - - SwagClient client; - SwagPetApi api; - SwagApiResponse response; - SwagApiResponse expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.OAuth2) client.getAuthentication('petstore_auth')) - .setAccessToken('foo-bar-access-token'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "code" : 0,\n "type" : "aeiou",\n "message" : "aeiou"\n}'); - expectedResponse = SwagApiResponse.getExample(); - response = (SwagApiResponse) api.uploadFile(params); - System.assertEquals(expectedResponse, response); - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/deploy/classes/SwagPetApiTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagPetApiTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPetApiTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagPetTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagPetTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagPetTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagStoreApi.cls b/samples/client/petstore/apex/deploy/classes/SwagStoreApi.cls deleted file mode 100644 index feb5535446..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagStoreApi.cls +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -public class SwagStoreApi { - SwagClient client; - - public SwagStoreApi(SwagClient client) { - this.client = client; - } - - public SwagStoreApi() { - this.client = new SwagClient(); - } - - public SwagClient getClient() { - return this.client; - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void deleteOrder(Map params) { - client.assertNotNull(params.get('orderId'), 'orderId'); - List query = new List(); - List form = new List(); - - client.invoke( - 'DELETE', '/store/order/{orderId}', '', - query, form, - new Map{ - 'orderId' => (String) params.get('orderId') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map - * @throws Swagger.ApiException if fails to make API call - */ - public Map getInventory() { - List query = new List(); - List form = new List(); - - return (Map) client.invoke( - 'GET', '/store/inventory', '', - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List { 'api_key' }, - Map.class - ); - } - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return SwagOrder - * @throws Swagger.ApiException if fails to make API call - */ - public SwagOrder getOrderById(Map params) { - client.assertNotNull(params.get('orderId'), 'orderId'); - List query = new List(); - List form = new List(); - - return (SwagOrder) client.invoke( - 'GET', '/store/order/{orderId}', '', - query, form, - new Map{ - 'orderId' => (Long) params.get('orderId') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - SwagOrder.class - ); - } - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return SwagOrder - * @throws Swagger.ApiException if fails to make API call - */ - public SwagOrder placeOrder(Map params) { - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - return (SwagOrder) client.invoke( - 'POST', '/store/order', - (SwagOrder) params.get('body'), - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - SwagOrder.class - ); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagStoreApi.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagStoreApi.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagStoreApi.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagStoreApiTest.cls b/samples/client/petstore/apex/deploy/classes/SwagStoreApiTest.cls deleted file mode 100644 index 7efe273bba..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagStoreApiTest.cls +++ /dev/null @@ -1,115 +0,0 @@ -@isTest -private class SwagStoreApiTest { - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - */ - @isTest - private static void deleteOrderTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'orderId' => 'orderId_example' - }; - - SwagClient client; - SwagStoreApi api; - - api = new SwagStoreApi(new SwagClient()); - - api.deleteOrder(params); - } - - /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - */ - @isTest - private static void getInventoryTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - SwagClient client; - SwagStoreApi api; - Map response; - Map expectedResponse; - - client = new SwagClient(); - api = new SwagStoreApi(client); - ((Swagger.ApiKeyAuth) client.getAuthentication('api_key')) - .setApiKey('foo-bar-api-key'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "key" : 0\n}'); - expectedResponse = new Map{'key'=>123}; - response = (Map) api.getInventory(); - System.assertEquals(expectedResponse, response); - } - - /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - */ - @isTest - private static void getOrderByIdTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'orderId' => 2147483648L - }; - - SwagClient client; - SwagStoreApi api; - SwagOrder response; - SwagOrder expectedResponse; - - api = new SwagStoreApi(new SwagClient()); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "petId" : 6,\n "quantity" : 1,\n "id" : 0,\n "shipDate" : "2000-01-23T04:56:07.000+00:00",\n "complete" : false,\n "status" : "placed"\n}'); - expectedResponse = SwagOrder.getExample(); - response = (SwagOrder) api.getOrderById(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Place an order for a pet - * - * - */ - @isTest - private static void placeOrderTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagOrder.getExample() - }; - - SwagClient client; - SwagStoreApi api; - SwagOrder response; - SwagOrder expectedResponse; - - api = new SwagStoreApi(new SwagClient()); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "petId" : 6,\n "quantity" : 1,\n "id" : 0,\n "shipDate" : "2000-01-23T04:56:07.000+00:00",\n "complete" : false,\n "status" : "placed"\n}'); - expectedResponse = SwagOrder.getExample(); - response = (SwagOrder) api.placeOrder(params); - System.assertEquals(expectedResponse, response); - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/deploy/classes/SwagStoreApiTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagStoreApiTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagStoreApiTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagTag.cls b/samples/client/petstore/apex/deploy/classes/SwagTag.cls deleted file mode 100644 index d1348d58db..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagTag.cls +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * A tag for a pet - */ -public class SwagTag { - /** - * Get id - * @return id - */ - public Long id { get; set; } - - /** - * Get name - * @return name - */ - public String name { get; set; } - - public static SwagTag getExample() { - SwagTag tag = new SwagTag(); - tag.id = 123456789L; - tag.name = 'aeiou'; - return tag; - } - - public Boolean equals(Object obj) { - if (obj instanceof SwagTag) { - SwagTag tag = (SwagTag) obj; - return this.id == tag.id - && this.name == tag.name; - } - return false; - } - - public Integer hashCode() { - Integer hashCode = 43; - hashCode = (17 * hashCode) + (id == null ? 0 : System.hashCode(id)); - hashCode = (17 * hashCode) + (name == null ? 0 : System.hashCode(name)); - return hashCode; - } -} - diff --git a/samples/client/petstore/apex/deploy/classes/SwagTag.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagTag.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagTag.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagTagTest.cls b/samples/client/petstore/apex/deploy/classes/SwagTagTest.cls deleted file mode 100644 index beee669040..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagTagTest.cls +++ /dev/null @@ -1,80 +0,0 @@ -@isTest -private class SwagTagTest { - @isTest - private static void equalsSameInstance() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = tag1; - SwagTag tag3 = new SwagTag(); - SwagTag tag4 = tag3; - - System.assert(tag1.equals(tag2)); - System.assert(tag2.equals(tag1)); - System.assert(tag1.equals(tag1)); - System.assert(tag3.equals(tag4)); - System.assert(tag4.equals(tag3)); - System.assert(tag3.equals(tag3)); - } - - @isTest - private static void equalsIdenticalInstance() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = SwagTag.getExample(); - SwagTag tag3 = new SwagTag(); - SwagTag tag4 = new SwagTag(); - - System.assert(tag1.equals(tag2)); - System.assert(tag2.equals(tag1)); - System.assert(tag3.equals(tag4)); - System.assert(tag4.equals(tag3)); - } - - @isTest - private static void notEqualsUnlikeInstance() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); - - System.assertEquals(false, tag1.equals(tag2)); - System.assertEquals(false, tag2.equals(tag1)); - } - - @isTest - private static void notEqualsDifferentType() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); - - System.assertEquals(false, tag1.equals('foo')); - System.assertEquals(false, tag2.equals('foo')); - } - - @isTest - private static void notEqualsNull() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); - SwagTag tag3; - - System.assertEquals(false, tag1.equals(tag3)); - System.assertEquals(false, tag2.equals(tag3)); - } - - @isTest - private static void consistentHashCodeValue() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); - - System.assertEquals(tag1.hashCode(), tag1.hashCode()); - System.assertEquals(tag2.hashCode(), tag2.hashCode()); - } - - @isTest - private static void equalInstancesHaveSameHashCode() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = SwagTag.getExample(); - SwagTag tag3 = new SwagTag(); - SwagTag tag4 = new SwagTag(); - - System.assert(tag1.equals(tag2)); - System.assert(tag3.equals(tag4)); - System.assertEquals(tag1.hashCode(), tag2.hashCode()); - System.assertEquals(tag3.hashCode(), tag4.hashCode()); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagTagTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagTagTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagTagTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagUser.cls b/samples/client/petstore/apex/deploy/classes/SwagUser.cls deleted file mode 100644 index d8ec7643bb..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUser.cls +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * A User who is purchasing from the pet store - */ -public class SwagUser { - /** - * Get id - * @return id - */ - public Long id { get; set; } - - /** - * Get username - * @return username - */ - public String username { get; set; } - - /** - * Get firstName - * @return firstName - */ - public String firstName { get; set; } - - /** - * Get lastName - * @return lastName - */ - public String lastName { get; set; } - - /** - * Get email - * @return email - */ - public String email { get; set; } - - /** - * Get password - * @return password - */ - public String password { get; set; } - - /** - * Get phone - * @return phone - */ - public String phone { get; set; } - - /** - * User Status - * @return userStatus - */ - public Integer userStatus { get; set; } - - public static SwagUser getExample() { - SwagUser user = new SwagUser(); - user.id = 123456789L; - user.username = 'aeiou'; - user.firstName = 'aeiou'; - user.lastName = 'aeiou'; - user.email = 'aeiou'; - user.password = 'aeiou'; - user.phone = 'aeiou'; - user.userStatus = 123; - return user; - } - - public Boolean equals(Object obj) { - if (obj instanceof SwagUser) { - SwagUser user = (SwagUser) obj; - return this.id == user.id - && this.username == user.username - && this.firstName == user.firstName - && this.lastName == user.lastName - && this.email == user.email - && this.password == user.password - && this.phone == user.phone - && this.userStatus == user.userStatus; - } - return false; - } - - public Integer hashCode() { - Integer hashCode = 43; - hashCode = (17 * hashCode) + (id == null ? 0 : System.hashCode(id)); - hashCode = (17 * hashCode) + (username == null ? 0 : System.hashCode(username)); - hashCode = (17 * hashCode) + (firstName == null ? 0 : System.hashCode(firstName)); - hashCode = (17 * hashCode) + (lastName == null ? 0 : System.hashCode(lastName)); - hashCode = (17 * hashCode) + (email == null ? 0 : System.hashCode(email)); - hashCode = (17 * hashCode) + (password == null ? 0 : System.hashCode(password)); - hashCode = (17 * hashCode) + (phone == null ? 0 : System.hashCode(phone)); - hashCode = (17 * hashCode) + (userStatus == null ? 0 : System.hashCode(userStatus)); - return hashCode; - } -} - diff --git a/samples/client/petstore/apex/deploy/classes/SwagUser.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagUser.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUser.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagUserApi.cls b/samples/client/petstore/apex/deploy/classes/SwagUserApi.cls deleted file mode 100644 index 01d9ebe401..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUserApi.cls +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -public class SwagUserApi { - SwagClient client; - - public SwagUserApi(SwagClient client) { - this.client = client; - } - - public SwagUserApi() { - this.client = new SwagClient(); - } - - public SwagClient getClient() { - return this.client; - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void createUser(Map params) { - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - client.invoke( - 'POST', '/user', - (SwagUser) params.get('body'), - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } - /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void createUsersWithArrayInput(Map params) { - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - client.invoke( - 'POST', '/user/createWithArray', - (List) params.get('body'), - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } - /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void createUsersWithListInput(Map params) { - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - client.invoke( - 'POST', '/user/createWithList', - (List) params.get('body'), - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void deleteUser(Map params) { - client.assertNotNull(params.get('username'), 'username'); - List query = new List(); - List form = new List(); - - client.invoke( - 'DELETE', '/user/{username}', '', - query, form, - new Map{ - 'username' => (String) params.get('username') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return SwagUser - * @throws Swagger.ApiException if fails to make API call - */ - public SwagUser getUserByName(Map params) { - client.assertNotNull(params.get('username'), 'username'); - List query = new List(); - List form = new List(); - - return (SwagUser) client.invoke( - 'GET', '/user/{username}', '', - query, form, - new Map{ - 'username' => (String) params.get('username') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - SwagUser.class - ); - } - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return String - * @throws Swagger.ApiException if fails to make API call - */ - public String loginUser(Map params) { - client.assertNotNull(params.get('username'), 'username'); - client.assertNotNull(params.get('password'), 'password'); - List query = new List(); - - // cast query params to verify their expected type - query.addAll(client.makeParam('username', (String) params.get('username'))); - query.addAll(client.makeParam('password', (String) params.get('password'))); - - List form = new List(); - - return (String) client.invoke( - 'GET', '/user/login', '', - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - String.class - ); - } - /** - * Logs out current logged in user session - * - * @throws Swagger.ApiException if fails to make API call - */ - public void logoutUser() { - List query = new List(); - List form = new List(); - - client.invoke( - 'GET', '/user/logout', '', - query, form, - new Map(), - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @throws Swagger.ApiException if fails to make API call - */ - public void updateUser(Map params) { - client.assertNotNull(params.get('username'), 'username'); - client.assertNotNull(params.get('body'), 'body'); - List query = new List(); - List form = new List(); - - client.invoke( - 'PUT', '/user/{username}', - (SwagUser) params.get('body'), - query, form, - new Map{ - 'username' => (String) params.get('username') - }, - new Map(), - new List{ 'application/json' }, - new List{ 'application/json' }, - new List(), - null - ); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagUserApi.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagUserApi.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUserApi.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagUserApiTest.cls b/samples/client/petstore/apex/deploy/classes/SwagUserApiTest.cls deleted file mode 100644 index 637f55bd5a..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUserApiTest.cls +++ /dev/null @@ -1,204 +0,0 @@ -@isTest -private class SwagUserApiTest { - /** - * Create user - * - * This can only be done by the logged in user. - */ - @isTest - private static void createUserTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(201); - res.setStatus('Created'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagUser.getExample() - }; - - SwagClient client; - SwagUserApi api; - - api = new SwagUserApi(new SwagClient()); - - api.createUser(params); - } - - /** - * Creates list of users with given input array - * - * - */ - @isTest - private static void createUsersWithArrayInputTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => new List{SwagUser.getExample()} - }; - - SwagClient client; - SwagUserApi api; - - api = new SwagUserApi(new SwagClient()); - - api.createUsersWithArrayInput(params); - } - - /** - * Creates list of users with given input array - * - * - */ - @isTest - private static void createUsersWithListInputTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => new List{SwagUser.getExample()} - }; - - SwagClient client; - SwagUserApi api; - - api = new SwagUserApi(new SwagClient()); - - api.createUsersWithListInput(params); - } - - /** - * Delete user - * - * This can only be done by the logged in user. - */ - @isTest - private static void deleteUserTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'username' => 'username_example' - }; - - SwagClient client; - SwagUserApi api; - - api = new SwagUserApi(new SwagClient()); - - api.deleteUser(params); - } - - /** - * Get user by user name - * - * - */ - @isTest - private static void getUserByNameTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'username' => 'username_example' - }; - - SwagClient client; - SwagUserApi api; - SwagUser response; - SwagUser expectedResponse; - - api = new SwagUserApi(new SwagClient()); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "firstName" : "aeiou",\n "lastName" : "aeiou",\n "password" : "aeiou",\n "userStatus" : 6,\n "phone" : "aeiou",\n "id" : 0,\n "email" : "aeiou",\n "username" : "aeiou"\n}'); - expectedResponse = SwagUser.getExample(); - response = (SwagUser) api.getUserByName(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Logs user into the system - * - * - */ - @isTest - private static void loginUserTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'username' => 'username_example', - 'password' => 'password_example' - }; - - SwagClient client; - SwagUserApi api; - String response; - String expectedResponse; - - api = new SwagUserApi(new SwagClient()); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('"aeiou"'); - expectedResponse = 'aeiou'; - response = (String) api.loginUser(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Logs out current logged in user session - * - * - */ - @isTest - private static void logoutUserTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - SwagClient client; - SwagUserApi api; - - api = new SwagUserApi(new SwagClient()); - - api.logoutUser(); - } - - /** - * Updated user - * - * This can only be done by the logged in user. - */ - @isTest - private static void updateUserTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'username' => 'username_example', - 'body' => SwagUser.getExample() - }; - - SwagClient client; - SwagUserApi api; - - api = new SwagUserApi(new SwagClient()); - - api.updateUser(params); - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/deploy/classes/SwagUserApiTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagUserApiTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUserApiTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwagUserTest.cls b/samples/client/petstore/apex/deploy/classes/SwagUserTest.cls deleted file mode 100644 index ec89e21ac1..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUserTest.cls +++ /dev/null @@ -1,80 +0,0 @@ -@isTest -private class SwagUserTest { - @isTest - private static void equalsSameInstance() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = user1; - SwagUser user3 = new SwagUser(); - SwagUser user4 = user3; - - System.assert(user1.equals(user2)); - System.assert(user2.equals(user1)); - System.assert(user1.equals(user1)); - System.assert(user3.equals(user4)); - System.assert(user4.equals(user3)); - System.assert(user3.equals(user3)); - } - - @isTest - private static void equalsIdenticalInstance() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = SwagUser.getExample(); - SwagUser user3 = new SwagUser(); - SwagUser user4 = new SwagUser(); - - System.assert(user1.equals(user2)); - System.assert(user2.equals(user1)); - System.assert(user3.equals(user4)); - System.assert(user4.equals(user3)); - } - - @isTest - private static void notEqualsUnlikeInstance() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); - - System.assertEquals(false, user1.equals(user2)); - System.assertEquals(false, user2.equals(user1)); - } - - @isTest - private static void notEqualsDifferentType() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); - - System.assertEquals(false, user1.equals('foo')); - System.assertEquals(false, user2.equals('foo')); - } - - @isTest - private static void notEqualsNull() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); - SwagUser user3; - - System.assertEquals(false, user1.equals(user3)); - System.assertEquals(false, user2.equals(user3)); - } - - @isTest - private static void consistentHashCodeValue() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); - - System.assertEquals(user1.hashCode(), user1.hashCode()); - System.assertEquals(user2.hashCode(), user2.hashCode()); - } - - @isTest - private static void equalInstancesHaveSameHashCode() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = SwagUser.getExample(); - SwagUser user3 = new SwagUser(); - SwagUser user4 = new SwagUser(); - - System.assert(user1.equals(user2)); - System.assert(user3.equals(user4)); - System.assertEquals(user1.hashCode(), user2.hashCode()); - System.assertEquals(user3.hashCode(), user4.hashCode()); - } -} diff --git a/samples/client/petstore/apex/deploy/classes/SwagUserTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwagUserTest.cls-meta.xml deleted file mode 100644 index 38aa015d1f..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwagUserTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 36.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/Swagger.cls b/samples/client/petstore/apex/deploy/classes/Swagger.cls deleted file mode 100644 index 0a7a1b106a..0000000000 --- a/samples/client/petstore/apex/deploy/classes/Swagger.cls +++ /dev/null @@ -1,395 +0,0 @@ -public class Swagger { - private static final String HEADER_CONTENT_TYPE = 'Content-Type'; - private static final String HEADER_ACCEPT = 'Accept'; - private static final String HEADER_ACCEPT_DELIMITER = ','; - private static final Map DELIMITERS = new Map { - 'csv' => ',', - 'ssv' => ' ', - 'tsv' => '\t', - 'pipes' => '|' - }; - - public class Param { - private String name, value; - - public Param(String name, String value) { - this.name = name; - this.value = value; - } - - public override String toString() { - return EncodingUtil.urlEncode(name, 'UTF-8') + '=' - + EncodingUtil.urlEncode(value, 'UTF-8'); - } - } - - public interface Authentication { - void apply(Map headers, List query); - } - - public interface MappedProperties { - Map getPropertyMappings(); - } - - public abstract class ApiKeyAuth implements Authentication { - protected final String paramName; - protected String key = ''; - - public void setApiKey(String key) { - this.key = key; - } - - @TestVisible - private String getApiKey() { - return key; - } - } - - public class ApiKeyQueryAuth extends ApiKeyAuth { - public ApiKeyQueryAuth(String paramName) { - this.paramName = paramName; - } - - public void apply(Map headers, List query) { - query.add(new Param(paramName, key)); - } - } - - public class ApiKeyHeaderAuth extends ApiKeyAuth { - public ApiKeyHeaderAuth(String paramName) { - this.paramName = paramName; - } - - public void apply(Map headers, List query) { - headers.put(paramName, key); - } - } - - public class HttpBasicAuth implements Authentication { - private String username = ''; - private String password = ''; - - public void setUsername(String username) { - this.username = username; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setCredentials(String username, String password) { - setUsername(username); - setPassword(password); - } - - @TestVisible - private String getHeaderValue() { - return 'Basic ' + EncodingUtil.base64Encode(Blob.valueOf(username + ':' + password)); - } - - public void apply(Map headers, List query) { - headers.put('Authorization', getHeaderValue()); - } - } - - public class OAuth2 implements Authentication { - private String accessToken = ''; - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @TestVisible - private String getHeaderValue() { - return 'Bearer ' + accessToken; - } - - public void apply(Map headers, List query) { - headers.put('Authorization', getHeaderValue()); - } - } - - public class ApiException extends Exception { - private final Integer code; - private final String status; - private final Map headers; - private final String body; - - public ApiException(Integer code, String status, Map headers, String body) { - this('API returned HTTP ' + code + ': ' + status); - this.code = code; - this.status = status; - this.headers = headers; - this.body = body; - } - - public Integer getStatusCode() { - return code; - } - - public String getStatus() { - return status; - } - - public Map getHeaders() { - return headers; - } - - public String getBody() { - return body; - } - } - - public virtual class ApiClient { - protected String preferredContentType = 'application/json'; - protected String preferredAccept = 'application/json'; - protected final String basePath; - - @TestVisible - protected final Map authentications = new Map(); - - public virtual Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - public virtual void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new NoSuchElementException('No HTTP basic authentication configured!'); - } - - public virtual void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new NoSuchElementException('No HTTP basic authentication configured!'); - } - - public virtual void setCredentials(String username, String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setCredentials(username, password); - return; - } - } - throw new NoSuchElementException('No HTTP basic authentication configured!'); - } - - public virtual void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new NoSuchElementException('No API key authentication configured!'); - } - - public virtual void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth2) { - ((OAuth2) auth).setAccessToken(accessToken); - return; - } - } - throw new NoSuchElementException('No OAuth2 authentication configured!'); - } - - public List makeParams(String name, List values) { - List pairs = new List(); - for (Object value : new List(values)) { - pairs.add(new Param(name, String.valueOf(value))); - } - return pairs; - } - - public List makeParam(String name, List values, String format) { - List pairs = new List(); - if (values != null) { - String delimiter = DELIMITERS.get(format); - pairs.add(new Param(name, String.join(values, delimiter))); - } - return pairs; - } - - public List makeParam(String name, Object value) { - List pairs = new List(); - if (value != null) { - pairs.add(new Param(name, String.valueOf(value))); - } - return pairs; - } - - public virtual void assertNotNull(Object required, String parameterName) { - if (required == null) { - Exception e = new NullPointerException(); - e.setMessage('Argument cannot be null: ' + parameterName); - throw e; - } - } - - public virtual Object invoke( - String method, String path, Object body, List query, List form, - Map pathParams, Map headers, List accepts, - List contentTypes, List authMethods, Type returnType) { - - HttpResponse res = getResponse(method, path, body, query, form, pathParams, headers, - accepts, contentTypes, authMethods); - - Integer code = res.getStatusCode(); - Boolean isFailure = code / 100 != 2; - if (isFailure) { - throw new ApiException(code, res.getStatus(), getHeaders(res), res.getBody()); - } else if (returnType != null) { - return toReturnValue(res.getBody(), returnType, res.getHeader('Content-Type')); - } - return null; - } - - @TestVisible - protected virtual Map getHeaders(HttpResponse res) { - Map headers = new Map(); - List headerKeys = res.getHeaderKeys(); - for (String headerKey : headerKeys) { - headers.put(headerKey, res.getHeader(headerKey)); - } - return headers; - } - - @TestVisible - protected virtual Object toReturnValue(String body, Type returnType, String contentType) { - if (contentType == 'application/json') { - Object o = returnType.newInstance(); - if (o instanceof MappedProperties) { - Map propertyMappings = ((MappedProperties) o).getPropertyMappings(); - for (String baseName : propertyMappings.keySet()) { - body = body.replaceAll('"' + baseName + '"\\s*:', - '"' + propertyMappings.get(baseName) + '":'); - } - } - JsonParser parser = Json.createParser(body); - parser.nextToken(); - return parser.readValueAs(returnType); - } - return body; - } - - @TestVisible - protected virtual HttpResponse getResponse( - String method, String path, Object body, List query, List form, - Map pathParams, Map headers, List accepts, - List contentTypes, List authMethods) { - - HttpRequest req = new HttpRequest(); - applyAuthentication(authMethods, headers, query); - req.setMethod(method); - req.setEndpoint(toEndpoint(path, pathParams, query)); - String contentType = setContentTypeHeader(contentTypes, headers); - setAcceptHeader(accepts, headers); - setHeaders(req, headers); - - if (method != 'GET') { - req.setBody(toBody(contentType, body, form)); - } - - return new Http().send(req); - } - - @TestVisible - protected virtual void setHeaders(HttpRequest req, Map headers) { - for (String headerName : headers.keySet()) { - req.setHeader(headerName, String.valueOf(headers.get(headerName))); - } - } - - @TestVisible - protected virtual String toBody(String contentType, Object body, List form) { - if (contentType.contains('application/x-www-form-urlencoded')) { - return paramsToString(form); - } else if (contentType.contains('application/json')) { - return Json.serialize(body); - } - return String.valueOf(body); - } - - @TestVisible - protected virtual String setContentTypeHeader(List contentTypes, - Map headers) { - if (contentTypes.isEmpty()) { - headers.put(HEADER_CONTENT_TYPE, preferredContentType); - return preferredContentType; - } - for (String contentType : contentTypes) { - if (preferredContentType == contentType) { - headers.put(HEADER_CONTENT_TYPE, contentType); - return contentType; - } - } - String contentType = contentTypes.get(0); - headers.put(HEADER_CONTENT_TYPE, contentType); - return contentType; - } - - @TestVisible - protected virtual void setAcceptHeader(List accepts, Map headers) { - for (String accept : accepts) { - if (preferredAccept == accept) { - headers.put(HEADER_ACCEPT, accept); - return; - } - } - if (!accepts.isEmpty()) { - headers.put(HEADER_ACCEPT, String.join(accepts, HEADER_ACCEPT_DELIMITER)); - } - } - - @TestVisible - protected virtual void applyAuthentication(List names, Map headers, - List query) { - for (Authentication auth : getAuthMethods(names)) { - auth.apply(headers, query); - } - } - - @TestVisible - protected virtual List getAuthMethods(List names) { - List authMethods = new List(); - for (String name : names) { - authMethods.add(authentications.get(name)); - } - return authMethods; - } - - @TestVisible - protected virtual String toPath(String path, Map params) { - String formatted = path; - for (String key : params.keySet()) { - formatted = formatted.replace('{' + key + '}', String.valueOf(params.get(key))); - } - return formatted; - } - - @TestVisible - protected virtual String toEndpoint(String path, Map params, - List queryParams) { - String query = '?' + paramsToString(queryParams); - return basePath + toPath(path, params) + query.removeEnd('?'); - } - - @TestVisible - protected virtual String paramsToString(List params) { - String s = ''; - for (Param p : params) { - s += '&' + p; - } - return s.removeStart('&'); - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/deploy/classes/Swagger.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/Swagger.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/Swagger.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwaggerResponseMock.cls b/samples/client/petstore/apex/deploy/classes/SwaggerResponseMock.cls deleted file mode 100644 index 7d3acb1a91..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwaggerResponseMock.cls +++ /dev/null @@ -1,18 +0,0 @@ -@isTest -public class SwaggerResponseMock implements HttpCalloutMock { - private final HttpResponse response; - private HttpRequest request; - - public SwaggerResponseMock(HttpResponse response) { - this.response = response; - } - - public HttpResponse respond(HttpRequest request) { - this.request = request; - return response; - } - - public HttpRequest getRequest() { - return request; - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/deploy/classes/SwaggerResponseMock.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwaggerResponseMock.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwaggerResponseMock.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/classes/SwaggerTest.cls b/samples/client/petstore/apex/deploy/classes/SwaggerTest.cls deleted file mode 100644 index dcbca6cdd9..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwaggerTest.cls +++ /dev/null @@ -1,782 +0,0 @@ -@isTest -private class SwaggerTest { - @isTest - private static void Param_urlEncodeKeyValuePairUtf8() { - String toEncodeLeft = 'Hello +%-_.!~*\'()@'; - String toEncodeRight = 'World +%-_.!~*\'()@'; - String expected = 'Hello+%2B%25-_.%21%7E*%27%28%29%40=World+%2B%25-_.%21%7E*%27%28%29%40'; - String result = new Swagger.Param(toEncodeLeft, toEncodeRight).toString(); - System.assertEquals(expected, result); - } - - @isTest - private static void ApiKeyHeaderAuth_keyInHeaderWithGivenName() { - Map headers = new Map(); - List query = new List(); - Swagger.ApiKeyHeaderAuth auth = new Swagger.ApiKeyHeaderAuth('X-Authenticate'); - auth.setApiKey('foo-bar-api-key'); - auth.apply(headers, query); - - System.assert(query.isEmpty()); - System.assertEquals(1, headers.size()); - System.assertEquals('foo-bar-api-key', headers.get('X-Authenticate')); - } - - @isTest - private static void ApiKeyQueryAuth_keyInQueryParamWithGivenName() { - Map headers = new Map(); - List query = new List(); - Swagger.ApiKeyQueryAuth auth = new Swagger.ApiKeyQueryAuth('auth_token'); - auth.setApiKey('foo-bar-api-key'); - auth.apply(headers, query); - - System.assert(headers.isEmpty()); - System.assertEquals(1, query.size()); - System.assertEquals('auth_token=foo-bar-api-key', query.get(0).toString()); - } - - @isTest - private static void HttpBasicAuth_base64EncodeCredentials() { - Map headers = new Map(); - List query = new List(); - Swagger.HttpBasicAuth auth = new Swagger.HttpBasicAuth(); - auth.setCredentials('username', 'password'); - auth.apply(headers, query); - - System.assert(query.isEmpty()); - System.assertEquals(1, headers.size()); - System.assertEquals('Basic dXNlcm5hbWU6cGFzc3dvcmQ=', headers.get('Authorization')); - } - - @isTest - private static void HttpBasicAuth_base64EncodeUsernamePassword() { - Map headers = new Map(); - List query = new List(); - Swagger.HttpBasicAuth auth = new Swagger.HttpBasicAuth(); - auth.setUsername('username'); - auth.setPassword('password'); - auth.apply(headers, query); - - System.assert(query.isEmpty()); - System.assertEquals(1, headers.size()); - System.assertEquals('Basic dXNlcm5hbWU6cGFzc3dvcmQ=', headers.get('Authorization')); - } - - @isTest - private static void OAuth2_tokenInAuthorizationHeaderWithBearerPrefix() { - Map headers = new Map(); - List query = new List(); - Swagger.OAuth2 auth = new Swagger.OAuth2(); - auth.setAccessToken('foo-bar-api-key'); - auth.apply(headers, query); - - System.assert(query.isEmpty()); - System.assertEquals(1, headers.size()); - System.assertEquals('Bearer foo-bar-api-key', headers.get('Authorization')); - } - - @isTest - private static void ApiClient_returnAuthenticationMatchingInput() { - MockApiClient client = new MockApiClient(); - Swagger.ApiKeyHeaderAuth auth1 = new Swagger.ApiKeyHeaderAuth('foo'); - Swagger.ApiKeyQueryAuth auth2 = new Swagger.ApiKeyQueryAuth('foo'); - Swagger.HttpBasicAuth auth3 = new Swagger.HttpBasicAuth(); - Swagger.OAuth2 auth4 = new Swagger.OAuth2(); - - client.authentications.put('auth1', auth1); - client.authentications.put('auth2', auth2); - client.authentications.put('auth3', auth3); - client.authentications.put('auth4', auth4); - - System.assertEquals(auth1, client.getAuthentication('auth1')); - System.assertEquals(auth2, client.getAuthentication('auth2')); - System.assertEquals(auth3, client.getAuthentication('auth3')); - System.assertEquals(auth4, client.getAuthentication('auth4')); - } - - @isTest - private static void ApiClient_noAuthenticationsMatchInputReturnNull() { - MockApiClient client = new MockApiClient(); - Swagger.OAuth2 auth = new Swagger.OAuth2(); - client.authentications.put('auth', auth); - - System.assertEquals(auth, client.getAuthentication('auth')); - System.assertEquals(null, client.getAuthentication('no-auth')); - } - - @isTest - private static void ApiClient_setUsernamePasswordFirstBasicAuthOnly() { - MockApiClient client = new MockApiClient(); - Swagger.OAuth2 auth1 = new Swagger.OAuth2(); - Swagger.ApiKeyQueryAuth auth2 = new Swagger.ApiKeyQueryAuth('auth2'); - Swagger.ApiKeyHeaderAuth auth3 = new Swagger.ApiKeyHeaderAuth('auth3'); - Swagger.HttpBasicAuth auth4 = new Swagger.HttpBasicAuth(); - Swagger.HttpBasicAuth auth5 = new Swagger.HttpBasicAuth(); - client.authentications.put('auth1', auth1); - client.authentications.put('auth2', auth2); - client.authentications.put('auth3', auth3); - client.authentications.put('auth4', auth4); - client.authentications.put('auth5', auth5); - client.setUsername('username'); - client.setPassword('password'); - - System.assertEquals('Bearer ', auth1.getHeaderValue()); - System.assertEquals('', auth2.getApiKey()); - System.assertEquals('', auth3.getApiKey()); - System.assertEquals('Basic dXNlcm5hbWU6cGFzc3dvcmQ=', auth4.getHeaderValue()); - System.assertEquals('Basic Og==', auth5.getHeaderValue()); - } - - @isTest - private static void ApiClient_setUsernameExceptionNoBasicAuth() { - Swagger.ApiClient client = new Swagger.ApiClient(); - try { - client.setUsername('username'); - } catch (NoSuchElementException e) { - return; - } - System.assert(false); - } - - @isTest - private static void ApiClient_setPasswordExceptionNoBasicAuth() { - Swagger.ApiClient client = new Swagger.ApiClient(); - try { - client.setPassword('password'); - } catch (NoSuchElementException e) { - return; - } - System.assert(false); - } - - @isTest - private static void ApiClient_setCredentialsFirstBasicAuthOnly() { - MockApiClient client = new MockApiClient(); - Swagger.OAuth2 auth1 = new Swagger.OAuth2(); - Swagger.ApiKeyQueryAuth auth2 = new Swagger.ApiKeyQueryAuth('auth2'); - Swagger.ApiKeyHeaderAuth auth3 = new Swagger.ApiKeyHeaderAuth('auth3'); - Swagger.HttpBasicAuth auth4 = new Swagger.HttpBasicAuth(); - Swagger.HttpBasicAuth auth5 = new Swagger.HttpBasicAuth(); - client.authentications.put('auth1', auth1); - client.authentications.put('auth2', auth2); - client.authentications.put('auth3', auth3); - client.authentications.put('auth4', auth4); - client.authentications.put('auth5', auth5); - client.setCredentials('username', 'password'); - - System.assertEquals('Bearer ', auth1.getHeaderValue()); - System.assertEquals('', auth2.getApiKey()); - System.assertEquals('', auth3.getApiKey()); - System.assertEquals('Basic dXNlcm5hbWU6cGFzc3dvcmQ=', auth4.getHeaderValue()); - System.assertEquals('Basic Og==', auth5.getHeaderValue()); - } - - @isTest - private static void ApiClient_setCredentialsExceptionNoBasicAuth() { - Swagger.ApiClient client = new Swagger.ApiClient(); - try { - client.setCredentials('username', 'password'); - } catch (NoSuchElementException e) { - return; - } - System.assert(false); - } - - @isTest - private static void ApiClient_setApiKeyFirstKeyAuthOnly() { - MockApiClient client = new MockApiClient(); - Swagger.OAuth2 auth1 = new Swagger.OAuth2(); - Swagger.HttpBasicAuth auth2 = new Swagger.HttpBasicAuth(); - Swagger.HttpBasicAuth auth3 = new Swagger.HttpBasicAuth(); - Swagger.ApiKeyQueryAuth auth4 = new Swagger.ApiKeyQueryAuth('auth4'); - Swagger.ApiKeyHeaderAuth auth5 = new Swagger.ApiKeyHeaderAuth('auth5'); - client.authentications.put('auth1', auth1); - client.authentications.put('auth2', auth2); - client.authentications.put('auth3', auth3); - client.authentications.put('auth4', auth4); - client.authentications.put('auth5', auth5); - client.setApiKey('foo-bar-api-key'); - - System.assertEquals('Bearer ', auth1.getHeaderValue()); - System.assertEquals('Basic Og==', auth2.getHeaderValue()); - System.assertEquals('Basic Og==', auth3.getHeaderValue()); - System.assertEquals('foo-bar-api-key', auth4.getApiKey()); - System.assertEquals('', auth5.getApiKey()); - } - - @isTest - private static void ApiClient_setApiKeyExceptionNoKeyAuth() { - Swagger.ApiClient client = new Swagger.ApiClient(); - try { - client.setApiKey('foo-bar-api-key'); - } catch (NoSuchElementException e) { - return; - } - System.assert(false); - } - - @isTest - private static void ApiClient_setAccessTokenFirstOauthOnly() { - MockApiClient client = new MockApiClient(); - Swagger.HttpBasicAuth auth1 = new Swagger.HttpBasicAuth(); - Swagger.ApiKeyQueryAuth auth2 = new Swagger.ApiKeyQueryAuth('auth2'); - Swagger.ApiKeyHeaderAuth auth3 = new Swagger.ApiKeyHeaderAuth('auth3'); - Swagger.OAuth2 auth4 = new Swagger.OAuth2(); - Swagger.OAuth2 auth5 = new Swagger.OAuth2(); - client.authentications.put('auth1', auth1); - client.authentications.put('auth2', auth2); - client.authentications.put('auth3', auth3); - client.authentications.put('auth4', auth4); - client.authentications.put('auth5', auth5); - client.setAccessToken('foo-bar-api-key'); - - System.assertEquals('Basic Og==', auth1.getHeaderValue()); - System.assertEquals('', auth2.getApiKey()); - System.assertEquals('', auth3.getApiKey()); - System.assertEquals('Bearer foo-bar-api-key', auth4.getHeaderValue()); - System.assertEquals('Bearer ', auth5.getHeaderValue()); - } - - @isTest - private static void ApiClient_setAccessTokenExceptionNoOAuth() { - Swagger.ApiClient client = new Swagger.ApiClient(); - try { - client.setAccessToken('foo-bar-api-key'); - } catch (NoSuchElementException e) { - return; - } - System.assert(false); - } - - @isTest - private static void ApiClient_oneKeyValuePairForEachValueInList() { - List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParams('foo', values); - - System.assertEquals(5, params.size()); - System.assertEquals('foo=bar', params.get(0).toString()); - System.assertEquals('foo=4', params.get(1).toString()); - System.assertEquals('foo=false', params.get(2).toString()); - System.assertEquals('foo=12.4', params.get(3).toString()); - System.assertEquals('foo=', params.get(4).toString()); - } - - @isTest - private static void ApiClient_nullMultiValuesListToEmptyParamsList() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParams('foo', null); - - System.assert(params.isEmpty()); - } - - @isTest - private static void ApiClient_valuesListToSingleCsvKeyValuePair() { - List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'csv'); - - System.assertEquals(1, params.size()); - System.assertEquals('foo=bar%2C4%2Cfalse%2C12.4%2C', params.get(0).toString()); - } - - @isTest - private static void ApiClient_valuesListToSingleSsvKeyValuePair() { - List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'ssv'); - - System.assertEquals(1, params.size()); - System.assertEquals('foo=bar+4+false+12.4+', params.get(0).toString()); - } - - @isTest - private static void ApiClient_valuesListToSingleTsvKeyValuePair() { - List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'tsv'); - - System.assertEquals(1, params.size()); - System.assertEquals('foo=bar%094%09false%0912.4%09', params.get(0).toString()); - } - - @isTest - private static void ApiClient_valuesListToSinglePipeSeparatedKeyValuePair() { - List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'pipes'); - - System.assertEquals(1, params.size()); - System.assertEquals('foo=bar%7C4%7Cfalse%7C12.4%7C', params.get(0).toString()); - } - - @isTest - private static void ApiClient_nullValuesListToEmptyParamsList() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', null, 'csv'); - - System.assert(params.isEmpty()); - } - - @isTest - private static void ApiClient_paramsFromAnyPrimitiveTypeDiscardNull() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = new List(); - params.addAll(client.makeParam('foo', 'bar')); - params.addAll(client.makeParam('foo', 10)); - params.addAll(client.makeParam('foo', 12.6)); - params.addAll(client.makeParam('foo', true)); - params.addAll(client.makeParam('foo', '')); - params.addAll(client.makeParam('foo', Datetime.newInstanceGmt(2017, 1, 1, 15, 0, 0))); - params.addAll(client.makeParam('foo', null)); - - System.assertEquals(6, params.size()); - System.assertEquals('foo=bar', params.get(0).toString()); - System.assertEquals('foo=10', params.get(1).toString()); - System.assertEquals('foo=12.6', params.get(2).toString()); - System.assertEquals('foo=true', params.get(3).toString()); - System.assertEquals('foo=', params.get(4).toString()); - System.assertEquals('foo=2017-01-01+15%3A00%3A00', params.get(5).toString()); - } - - @isTest - private static void ApiClient_requiredParameterPasses() { - Swagger.ApiClient client = new Swagger.ApiClient(); - client.assertNotNull('foo', 'bar'); - } - - @isTest - private static void ApiClient_requiredParameterFails() { - Swagger.ApiClient client = new Swagger.ApiClient(); - try { - client.assertNotNull(null, 'bar'); - } catch (NullPointerException e) { - System.assertEquals('Argument cannot be null: bar', e.getMessage()); - return; - } - System.assert(false); - } - - @isTest - private static void ApiClient_extractHeadersFromResponse() { - HttpResponse res = new HttpResponse(); - res.setHeader('Content-Type', 'application/json'); - res.setHeader('Cache-Control', 'private, max-age=0'); - Map headers = new MockApiClient().getHeaders(res); - - System.assertEquals(2, headers.size()); - System.assertEquals('application/json', headers.get('Content-Type')); - System.assertEquals('private, max-age=0', headers.get('Cache-Control')); - } - - @isTest - private static void ApiClient_deserializeResponseBodyByContentType() { - MockApiClient client = new MockApiClient(); - String jsonBody = '{"red":"apple","yellow":"banana","orange":"orange"}'; - Map result1 = (Map) client - .toReturnValue(jsonBody, Map.class, 'application/json'); - - System.assertEquals(3, result1.size()); - System.assertEquals('apple', result1.get('red')); - System.assertEquals('banana', result1.get('yellow')); - System.assertEquals('orange', result1.get('orange')); - - String result2 = (String) client - .toReturnValue('Hello, World!', String.class, 'text/plain'); - - System.assertEquals('Hello, World!', result2); - } - - @isTest - private static void ApiClient_addStringifiedHeadersToRequest() { - MockApiClient client = new MockApiClient(); - Map headers = new Map{ - 'Content-Type' => 'application/json', - 'Max-Forwards' => 10 - }; - HttpRequest req = new HttpRequest(); - client.setHeaders(req, headers); - - System.assertEquals('application/json', req.getHeader('Content-Type')); - System.assertEquals('10', req.getHeader('Max-Forwards')); - } - - @isTest - private static void ApiClient_serializeRequestBodyOrFormByContentType() { - MockApiClient client = new MockApiClient(); - Map body1 = new Map{ - 'hello' => 'world', - 'foo' => 15, - 'bar' => Datetime.newInstanceGmt(2017, 1, 1, 15, 0, 0), - 'bat' => false - }; - Set expected1 = new Set{ - '"hello":"world"', - '"foo":15', - '"bar":"2017-01-01T15:00:00.000Z"', - '"bat":false' - }; - Set actual1 = new Set(client - .toBody('application/json', body1, new List()) - .removeStart('{') - .removeEnd('}') - .split(',') - ); - System.assertEquals(expected1, actual1); - - String body2 = 'Hello, World!'; - String actual2 = client.toBody('text/plain', body2, new List()); - System.assertEquals(body2, actual2); - - List form = new List{ - new Swagger.Param('hello', 'world'), - new Swagger.Param('date', '2017-01-01 15:00:00') - }; - String expected3 = 'hello=world&date=2017-01-01+15%3A00%3A00'; - String actual3 = client.toBody('application/x-www-form-urlencoded', '', form); - System.assertEquals(expected3, actual3); - } - - @isTest - private static void ApiClient_usePreferredContentTypeOrFirstInList() { - MockApiClient client = new MockApiClient(); - - Map headers1 = new Map(); - List types1 = new List{'application/xml', 'application/json', 'text/plain'}; - String result1 = client.setContentTypeHeader(types1, headers1); - System.assertEquals(1, headers1.size()); - System.assertEquals('application/json', headers1.get('Content-Type')); - System.assertEquals('application/json', result1); - - Map headers2 = new Map(); - List types2 = new List{'application/xml', 'text/plain'}; - String result2 = client.setContentTypeHeader(types2, headers2); - System.assertEquals(1, headers2.size()); - System.assertEquals('application/xml', headers2.get('Content-Type')); - System.assertEquals('application/xml', result2); - - Map headers3 = new Map(); - String result3 = client.setContentTypeHeader(new List(), headers3); - System.assertEquals(1, headers3.size()); - System.assertEquals('application/json', headers3.get('Content-Type')); - System.assertEquals('application/json', result3); - } - - @isTest - private static void ApiClient_usePreferredAcceptOrAllInListNoDefault() { - MockApiClient client = new MockApiClient(); - - Map headers1 = new Map(); - List types1 = new List{'application/xml', 'application/json', 'text/plain'}; - client.setAcceptHeader(types1, headers1); - System.assertEquals(1, headers1.size()); - System.assertEquals('application/json', headers1.get('Accept')); - - Map headers2 = new Map(); - List types2 = new List{'application/xml', 'text/plain'}; - client.setAcceptHeader(types2, headers2); - System.assertEquals(1, headers2.size()); - System.assertEquals('application/xml,text/plain', headers2.get('Accept')); - - Map headers3 = new Map(); - client.setAcceptHeader(new List(), headers3); - System.assert(headers3.isEmpty()); - } - - @isTest - private static void ApiClient_applyOnlyGivenAuthMethodsToParams() { - MockApiClient client = new MockApiClient(); - Map headers = new Map(); - Swagger.OAuth2 auth1 = new Swagger.OAuth2(); - Swagger.ApiKeyHeaderAuth auth2 = new Swagger.ApiKeyHeaderAuth('X-Authentication-Token'); - auth1.setAccessToken('boo-bat-api-key'); - auth2.setApiKey('foo-bar-api-key'); - client.authentications.put('auth1', auth1); - client.authentications.put('auth2', auth2); - client.applyAuthentication(new List{'auth2'}, headers, new List()); - - System.assertEquals(1, headers.size()); - System.assertEquals('foo-bar-api-key', headers.get('X-Authentication-Token')); - } - - @isTest - private static void ApiClient_formUrlWithQueryParamsPathParams() { - MockApiClient client = new MockApiClient(); - String path = '/departments/{department}'; - Map params = new Map{'department' => 'finance'}; - List queryParams = new List{ - new Swagger.Param('foo', 'bar'), - new Swagger.Param('bat', '123') - }; - String expected = 'https://www.mccombs.utexas.edu/departments/finance?foo=bar&bat=123'; - String actual = client.toEndpoint(path, params, queryParams); - System.assertEquals(expected, actual); - } - - @isTest - private static void ApiClient_setupRequestWithBody() { - MockApiClient client = new MockApiClient(); - HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); - Swagger.OAuth2 auth = new Swagger.OAuth2(); - auth.setAccessToken('foo-bar-access-token'); - client.authentications.put('oauth_method', auth); - Test.setMock(HttpCalloutMock.class, mock); - - HttpResponse returned = client.getResponse( - 'PUT', '/courses/{course}/assignments/{assignmentId}', - new Map { - 'title' => 'Chapter 4 quiz', - 'timed' => true, - 'time' => 60, - 'points' => 20.5, - 'due' => Datetime.newInstanceGmt(2016, 5, 10, 23, 59, 59), - 'description' => '' - }, - new List(), - new List(), - new Map{ - 'course' => 'acc321', - 'assignmentId' => 5 - }, - new Map{ - 'X-Session' => 'foo-bar-444' - }, - new List{'application/json', 'application/xml'}, - new List{'application/json', 'application/xml'}, - new List{'oauth_method'} - ); - - HttpRequest req = mock.getRequest(); - String expectedUrl = 'https://www.mccombs.utexas.edu/courses/acc321/assignments/5'; - Set body = new Set(req - .getBody() - .removeStart('{') - .removeEnd('}') - .split(',') - ); - - System.assertEquals(res, returned); - System.assertEquals(expectedUrl, req.getEndpoint()); - System.assertEquals(6, body.size()); - System.assert(body.contains('"title":"Chapter 4 quiz"')); - System.assert(body.contains('"timed":true')); - System.assert(body.contains('"time":60')); - System.assert(body.contains('"points":20.5')); - System.assert(body.contains('"due":"2016-05-10T23:59:59.000Z"')); - System.assert(body.contains('"description":""')); - System.assertEquals('PUT', req.getMethod()); - System.assertEquals('Bearer foo-bar-access-token', req.getHeader('Authorization')); - System.assertEquals('foo-bar-444', req.getHeader('X-Session')); - System.assertEquals('application/json', req.getHeader('Accept')); - System.assertEquals('application/json', req.getHeader('Content-Type')); - } - - @isTest - private static void ApiClient_setupRequestWithForm() { - MockApiClient client = new MockApiClient(); - HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); - Swagger.OAuth2 auth = new Swagger.OAuth2(); - auth.setAccessToken('foo-bar-access-token'); - client.authentications.put('oauth_method', auth); - Test.setMock(HttpCalloutMock.class, mock); - - HttpResponse returned = client.getResponse( - 'PUT', '/courses/{course}/assignments/{assignmentId}', '', - new List(), - new List{ - new Swagger.Param('title', 'Chapter 4 quiz'), - new Swagger.Param('timed', 'true'), - new Swagger.Param('time', '60'), - new Swagger.Param('points', '20.5'), - new Swagger.Param('due', '2016-05-10 18:59:59'), - new Swagger.Param('description', 'complete & upload \'section1: advanced\'') - }, - new Map{ - 'course' => 'acc321', - 'assignmentId' => 5 - }, - new Map{ - 'X-Session' => 'foo-bar-444' - }, - new List{'text/html', 'application/xml'}, - new List{'application/x-www-form-urlencoded'}, - new List{'oauth_method'} - ); - - HttpRequest req = mock.getRequest(); - String expectedUrl = 'https://www.mccombs.utexas.edu/courses/acc321/assignments/5'; - Set body = new Set(req.getBody().split('&')); - - System.assertEquals(res, returned); - System.assertEquals(expectedUrl, req.getEndpoint()); - System.assertEquals(6, body.size()); - System.assert(body.contains('title=Chapter+4+quiz')); - System.assert(body.contains('timed=true')); - System.assert(body.contains('time=60')); - System.assert(body.contains('points=20.5')); - System.assert(body.contains('due=2016-05-10+18%3A59%3A59')); - System.assert(body.contains('description=complete+%26+upload+%27section1%3A+advanced%27')); - System.assertEquals('PUT', req.getMethod()); - System.assertEquals('Bearer foo-bar-access-token', req.getHeader('Authorization')); - System.assertEquals('foo-bar-444', req.getHeader('X-Session')); - System.assertEquals('text/html,application/xml', req.getHeader('Accept')); - System.assertEquals('application/x-www-form-urlencoded', req.getHeader('Content-Type')); - } - - @isTest - private static void ApiClient_setupRequestWithQuery() { - MockApiClient client = new MockApiClient(); - HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); - Swagger.OAuth2 auth = new Swagger.OAuth2(); - auth.setAccessToken('foo-bar-access-token'); - client.authentications.put('oauth_method', auth); - Test.setMock(HttpCalloutMock.class, mock); - - HttpResponse returned = client.getResponse( - 'GET', '/courses/{course}/assignments', '', - new List{ - new Swagger.Param('title', '#chapter1:section2'), - new Swagger.Param('due', '2016-05-10 18:59:59') - }, - new List(), - new Map{ - 'course' => 'acc321' - }, - new Map(), - new List{'application/xml'}, - new List{'text/plain'}, - new List{'oauth_method'} - ); - - HttpRequest req = mock.getRequest(); - List splitUrl = req.getEndpoint().split('\\?'); - String expectedUrl = 'https://www.mccombs.utexas.edu/courses/acc321/assignments'; - Set query = new Set(splitUrl.get(1).split('&')); - - System.assertEquals(res, returned); - System.assertEquals(expectedUrl, splitUrl.get(0)); - System.assertEquals(2, query.size()); - System.assert(query.contains('title=%23chapter1%3Asection2')); - System.assert(query.contains('due=2016-05-10+18%3A59%3A59')); - System.assertEquals('GET', req.getMethod()); - System.assertEquals('Bearer foo-bar-access-token', req.getHeader('Authorization')); - System.assertEquals('application/xml', req.getHeader('Accept')); - System.assertEquals('text/plain', req.getHeader('Content-Type')); - } - - @isTest - private static void ApiClient_nonSuccessfulStatusCodeException() { - MockApiClient client = new MockApiClient(); - HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); - Swagger.OAuth2 auth = new Swagger.OAuth2(); - auth.setAccessToken('foo-bar-access-token'); - client.authentications.put('oauth_method', auth); - Test.setMock(HttpCalloutMock.class, mock); - - res.setStatus('Not Found'); - res.setStatusCode(404); - res.setHeader('X-Request-ID', '1234567890'); - res.setHeader('Content-Type', 'application/json'); - res.setBody('{"error":"the specified course does not exist"}'); - - try { - client.invoke( - 'GET', '/courses/{course}', '', - new List(), - new List(), - new Map{ - 'course' => 'acc321' - }, - new Map(), - new List{'application/json'}, - new List{'text/plain'}, - new List{'oauth_method'}, - null - ); - } catch (Swagger.ApiException e) { - Map headers = e.getHeaders(); - - System.assertEquals('API returned HTTP 404: Not Found', e.getMessage()); - System.assertEquals(404, e.getStatusCode()); - System.assertEquals('Not Found', e.getStatus()); - System.assertEquals('{"error":"the specified course does not exist"}', e.getBody()); - System.assertEquals(2, headers.size()); - System.assertEquals('1234567890', headers.get('X-Request-ID')); - System.assertEquals('application/json', headers.get('Content-Type')); - return; - } - - System.assert(false); - } - - @isTest - private static void ApiClient_returnParsedBody() { - MockApiClient client = new MockApiClient(); - HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); - Test.setMock(HttpCalloutMock.class, mock); - - res.setStatus('OK'); - res.setStatusCode(200); - res.setHeader('Content-Type', 'application/json'); - res.setBody('{' - + '"city":"Austin","country":"United States","latitude":30.28403639999999,' - + '"longitude":-97.73789449999998,"postalCode":"78705","state":"Texas",' - + '"street":"2110 Speedway"}'); - - Address a = (Address) client.invoke( - 'GET', '/address', '', - new List(), - new List(), - new Map(), - new Map(), - new List{'application/json'}, - new List{'text/plain'}, - new List(), - Address.class - ); - - System.assertEquals('Austin', a.getCity()); - System.assertEquals('United States', a.getCountry()); - System.assertEquals(30.28403639999999, a.getLatitude()); - System.assertEquals(-97.73789449999998, a.getLongitude()); - System.assertEquals('78705', a.getPostalCode()); - System.assertEquals('Texas', a.getState()); - System.assertEquals('2110 Speedway', a.getStreet()); - } - - @isTest - private static void ApiClient_noReturnTypeReturnsNull() { - MockApiClient client = new MockApiClient(); - HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); - Test.setMock(HttpCalloutMock.class, mock); - - res.setStatus('OK'); - res.setStatusCode(200); - - Object o = client.invoke( - 'POST', '/address', '', - new List(), - new List(), - new Map(), - new Map(), - new List{'application/json'}, - new List{'text/plain'}, - new List(), - null - ); - - System.assertEquals(null, o); - } - - private class MockApiClient extends Swagger.ApiClient { - public MockApiClient() { - basePath = 'https://www.mccombs.utexas.edu'; - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/deploy/classes/SwaggerTest.cls-meta.xml b/samples/client/petstore/apex/deploy/classes/SwaggerTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/deploy/classes/SwaggerTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/deploy/package.xml b/samples/client/petstore/apex/deploy/package.xml deleted file mode 100644 index 9f53557956..0000000000 --- a/samples/client/petstore/apex/deploy/package.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - Swagger Petstore API Client - Client library for calling the Swagger Petstore API. -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. -Generated with Swagger Codegen (github.com/swagger-api/swagger-codegen) - - SwagPetApi - SwagPetApiTest - SwagStoreApi - SwagStoreApiTest - SwagUserApi - SwagUserApiTest - SwagApiResponse - SwagApiResponseTest - SwagCategory - SwagCategoryTest - SwagOrder - SwagOrderTest - SwagPet - SwagPetTest - SwagTag - SwagTagTest - SwagUser - SwagUserTest - SwagClient - Swagger - SwaggerTest - SwaggerResponseMock - ApexClass - - - Swagger_Petstore - RemoteSiteSetting - - 39.0 - diff --git a/samples/client/petstore/apex/deploy/remoteSiteSettings/Swagger_Petstore.remoteSite b/samples/client/petstore/apex/deploy/remoteSiteSettings/Swagger_Petstore.remoteSite deleted file mode 100644 index a797eaedbe..0000000000 --- a/samples/client/petstore/apex/deploy/remoteSiteSettings/Swagger_Petstore.remoteSite +++ /dev/null @@ -1,7 +0,0 @@ - - - This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authori - false - true - http://petstore.swagger.io/v2 - \ No newline at end of file diff --git a/samples/client/petstore/apex/docs/SwagApiResponse.md b/samples/client/petstore/apex/docs/SwagApiResponse.md deleted file mode 100644 index a1e635ca25..0000000000 --- a/samples/client/petstore/apex/docs/SwagApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# SwagApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**r_type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/apex/docs/SwagCategory.md b/samples/client/petstore/apex/docs/SwagCategory.md deleted file mode 100644 index 9fb37feef8..0000000000 --- a/samples/client/petstore/apex/docs/SwagCategory.md +++ /dev/null @@ -1,11 +0,0 @@ - -# SwagCategory - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/apex/docs/SwagOrder.md b/samples/client/petstore/apex/docs/SwagOrder.md deleted file mode 100644 index 95e4b48f21..0000000000 --- a/samples/client/petstore/apex/docs/SwagOrder.md +++ /dev/null @@ -1,24 +0,0 @@ - -# SwagOrder - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**petId** | **Long** | | [optional] -**quantity** | **Integer** | | [optional] -**shipDate** | **Datetime** | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] -**complete** | **Boolean** | | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" - - - diff --git a/samples/client/petstore/apex/docs/SwagPet.md b/samples/client/petstore/apex/docs/SwagPet.md deleted file mode 100644 index 6f73d7f977..0000000000 --- a/samples/client/petstore/apex/docs/SwagPet.md +++ /dev/null @@ -1,24 +0,0 @@ - -# SwagPet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**SwagCategory**](SwagCategory.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<SwagTag>**](SwagTag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -AVAILABLE | "available" -PENDING | "pending" -SOLD | "sold" - - - diff --git a/samples/client/petstore/apex/docs/SwagPetApi.md b/samples/client/petstore/apex/docs/SwagPetApi.md deleted file mode 100644 index ad5843ea63..0000000000 --- a/samples/client/petstore/apex/docs/SwagPetApi.md +++ /dev/null @@ -1,404 +0,0 @@ -# SwagPetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](SwagPetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](SwagPetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](SwagPetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](SwagPetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](SwagPetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](SwagPetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](SwagPetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](SwagPetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(swagPet) - -Add a new pet to the store - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'swagPet' => SwagPet.getExample() -}; - -try { - // cross your fingers - api.addPet(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **swagPet** | [**SwagPet**](SwagPet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'petId' => 2147483648L, - 'apiKey' => 'apiKey_example' -}; - -try { - // cross your fingers - api.deletePet(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **findPetsByStatus** -> List<SwagPet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'status' => new List{'available'} -}; - -try { - // cross your fingers - List result = api.findPetsByStatus(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] - -### Return type - -[**List<SwagPet>**](SwagPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> List<SwagPet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'tags' => new List{'\'aeiou\''} -}; - -try { - // cross your fingers - List result = api.findPetsByTags(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List<SwagPet>**](SwagPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> SwagPet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) client.getAuthentication('api_key'); -api_key.setApiKey('YOUR API KEY'); - -Map params = new Map{ - 'petId' => 2147483648L -}; - -try { - // cross your fingers - SwagPet result = api.getPetById(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | - -### Return type - -[**SwagPet**](SwagPet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(swagPet) - -Update an existing pet - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'swagPet' => SwagPet.getExample() -}; - -try { - // cross your fingers - api.updatePet(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **swagPet** | [**SwagPet**](SwagPet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'petId' => 2147483648L, - 'name' => 'name_example', - 'status' => 'status_example' -}; - -try { - // cross your fingers - api.updatePetWithForm(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **uploadFile** -> SwagApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```java -SwagPetApi api = new SwagPetApi(); -SwagClient client = api.getClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth'); -petstore_auth.setAccessToken('YOUR ACCESS TOKEN'); - -Map params = new Map{ - 'petId' => 2147483648L, - 'additionalMetadata' => 'additionalMetadata_example', - 'file' => Blob.valueOf('Sample text file\nContents') -}; - -try { - // cross your fingers - SwagApiResponse result = api.uploadFile(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **Blob**| file to upload | [optional] - -### Return type - -[**SwagApiResponse**](SwagApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/apex/docs/SwagStoreApi.md b/samples/client/petstore/apex/docs/SwagStoreApi.md deleted file mode 100644 index de0b614f3d..0000000000 --- a/samples/client/petstore/apex/docs/SwagStoreApi.md +++ /dev/null @@ -1,183 +0,0 @@ -# SwagStoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](SwagStoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](SwagStoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](SwagStoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](SwagStoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```java -SwagStoreApi api = new SwagStoreApi(); - -Map params = new Map{ - 'orderId' => 'orderId_example' -}; - -try { - // cross your fingers - api.deleteOrder(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -SwagStoreApi api = new SwagStoreApi(); -SwagClient client = api.getClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) client.getAuthentication('api_key'); -api_key.setApiKey('YOUR API KEY'); - -try { - // cross your fingers - Map result = api.getInventory(); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map<String, Integer>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> SwagOrder getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -SwagStoreApi api = new SwagStoreApi(); - -Map params = new Map{ - 'orderId' => 2147483648L -}; - -try { - // cross your fingers - SwagOrder result = api.getOrderById(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | - -### Return type - -[**SwagOrder**](SwagOrder.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> SwagOrder placeOrder(swagOrder) - -Place an order for a pet - -### Example -```java -SwagStoreApi api = new SwagStoreApi(); - -Map params = new Map{ - 'swagOrder' => SwagOrder.getExample() -}; - -try { - // cross your fingers - SwagOrder result = api.placeOrder(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **swagOrder** | [**SwagOrder**](SwagOrder.md)| order placed for purchasing the pet | - -### Return type - -[**SwagOrder**](SwagOrder.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/apex/docs/SwagTag.md b/samples/client/petstore/apex/docs/SwagTag.md deleted file mode 100644 index 50060654b6..0000000000 --- a/samples/client/petstore/apex/docs/SwagTag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# SwagTag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/apex/docs/SwagUser.md b/samples/client/petstore/apex/docs/SwagUser.md deleted file mode 100644 index a3e487966f..0000000000 --- a/samples/client/petstore/apex/docs/SwagUser.md +++ /dev/null @@ -1,17 +0,0 @@ - -# SwagUser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] - - - diff --git a/samples/client/petstore/apex/docs/SwagUserApi.md b/samples/client/petstore/apex/docs/SwagUserApi.md deleted file mode 100644 index 622607d65d..0000000000 --- a/samples/client/petstore/apex/docs/SwagUserApi.md +++ /dev/null @@ -1,349 +0,0 @@ -# SwagUserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](SwagUserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](SwagUserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](SwagUserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](SwagUserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](SwagUserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](SwagUserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](SwagUserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](SwagUserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(swagUser) - -Create user - -This can only be done by the logged in user. - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'swagUser' => SwagUser.getExample() -}; - -try { - // cross your fingers - api.createUser(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **swagUser** | [**SwagUser**](SwagUser.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(swagUser) - -Creates list of users with given input array - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'swagUser' => new List{SwagUser.getExample()} -}; - -try { - // cross your fingers - api.createUsersWithArrayInput(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **swagUser** | [**List<SwagUser>**](List.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **createUsersWithListInput** -> createUsersWithListInput(swagUser) - -Creates list of users with given input array - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'swagUser' => new List{SwagUser.getExample()} -}; - -try { - // cross your fingers - api.createUsersWithListInput(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **swagUser** | [**List<SwagUser>**](List.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'username' => 'username_example' -}; - -try { - // cross your fingers - api.deleteUser(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getUserByName** -> SwagUser getUserByName(username) - -Get user by user name - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'username' => 'username_example' -}; - -try { - // cross your fingers - SwagUser result = api.getUserByName(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**SwagUser**](SwagUser.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'username' => 'username_example', - 'password' => 'password_example' -}; - -try { - // cross your fingers - String result = api.loginUser(params); - System.debug(result); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -try { - // cross your fingers - api.logoutUser(); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **updateUser** -> updateUser(username, swagUser) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -SwagUserApi api = new SwagUserApi(); - -Map params = new Map{ - 'username' => 'username_example', - 'swagUser' => SwagUser.getExample() -}; - -try { - // cross your fingers - api.updateUser(params); -} catch (Swagger.ApiException e) { - // ...handle your exceptions -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **swagUser** | [**SwagUser**](SwagUser.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/Swagger.cls b/samples/client/petstore/apex/force-app/main/default/classes/OAS.cls similarity index 97% rename from samples/client/petstore/apex/force-app/main/default/classes/Swagger.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OAS.cls index 172c303811..d7f4c6053c 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/Swagger.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OAS.cls @@ -1,4 +1,4 @@ -public class Swagger { +public class OAS { private static final String HEADER_CONTENT_TYPE = 'Content-Type'; private static final String HEADER_ACCEPT = 'Accept'; private static final String HEADER_ACCEPT_DELIMITER = ','; @@ -271,9 +271,7 @@ public class Swagger { @TestVisible protected virtual void applyAuthentication(List names, Map headers, List query) { - for (Authentication auth : getAuthMethods(names)) { - auth.apply(headers, query); - } + // TODO Check auth methods } @TestVisible @@ -298,7 +296,7 @@ public class Swagger { protected virtual String toEndpoint(String path, Map params, List queryParams) { String query = '?' + paramsToString(queryParams); - return '"callout:' + calloutName + toPath(path, params) + query.removeEnd('?') + '""'; + return 'callout:' + calloutName + toPath(path, params) + query.removeEnd('?'); } @TestVisible diff --git a/samples/client/petstore/apex/deploy/classes/SwagApiResponse.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OAS.cls-meta.xml similarity index 80% rename from samples/client/petstore/apex/deploy/classes/SwagApiResponse.cls-meta.xml rename to samples/client/petstore/apex/force-app/main/default/classes/OAS.cls-meta.xml index 8b061c82b6..fec71a2669 100644 --- a/samples/client/petstore/apex/deploy/classes/SwagApiResponse.cls-meta.xml +++ b/samples/client/petstore/apex/force-app/main/default/classes/OAS.cls-meta.xml @@ -1,5 +1,5 @@ - 39.0 + 42.0 Active diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponse.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls similarity index 73% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponse.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls index c5d3807965..2cae18bc3c 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponse.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls @@ -5,15 +5,15 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ /** * Describes the result of uploading an image resource */ -public class SwagApiResponse implements Swagger.MappedProperties { +public class OASApiResponse implements OAS.MappedProperties { /** * Get code * @return code @@ -40,17 +40,17 @@ public class SwagApiResponse implements Swagger.MappedProperties { return propertyMappings; } - public static SwagApiResponse getExample() { - SwagApiResponse apiResponse = new SwagApiResponse(); - apiResponse.code = ; - apiResponse.r_type = 'aeiou'; - apiResponse.message = 'aeiou'; + public static OASApiResponse getExample() { + OASApiResponse apiResponse = new OASApiResponse(); + apiResponse.code = 0; + apiResponse.r_type = ''; + apiResponse.message = ''; return apiResponse; } public Boolean equals(Object obj) { - if (obj instanceof SwagApiResponse) { - SwagApiResponse apiResponse = (SwagApiResponse) obj; + if (obj instanceof OASApiResponse) { + OASApiResponse apiResponse = (OASApiResponse) obj; return this.code == apiResponse.code && this.r_type == apiResponse.r_type && this.message == apiResponse.message; diff --git a/samples/client/petstore/apex/deploy/classes/SwagApiResponseTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls-meta.xml similarity index 80% rename from samples/client/petstore/apex/deploy/classes/SwagApiResponseTest.cls-meta.xml rename to samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls-meta.xml index 38aa015d1f..fec71a2669 100644 --- a/samples/client/petstore/apex/deploy/classes/SwagApiResponseTest.cls-meta.xml +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 42.0 Active diff --git a/samples/client/petstore/apex/deploy/classes/SwagApiResponseTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponseTest.cls similarity index 54% rename from samples/client/petstore/apex/deploy/classes/SwagApiResponseTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASApiResponseTest.cls index a7095a4f1c..4245ce1664 100644 --- a/samples/client/petstore/apex/deploy/classes/SwagApiResponseTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponseTest.cls @@ -1,11 +1,11 @@ @isTest -private class SwagApiResponseTest { +private class OASApiResponseTest { @isTest private static void equalsSameInstance() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = apiResponse1; - SwagApiResponse apiResponse3 = new SwagApiResponse(); - SwagApiResponse apiResponse4 = apiResponse3; + OASApiResponse apiResponse1 = OASApiResponse.getExample(); + OASApiResponse apiResponse2 = apiResponse1; + OASApiResponse apiResponse3 = new OASApiResponse(); + OASApiResponse apiResponse4 = apiResponse3; System.assert(apiResponse1.equals(apiResponse2)); System.assert(apiResponse2.equals(apiResponse1)); @@ -17,10 +17,10 @@ private class SwagApiResponseTest { @isTest private static void equalsIdenticalInstance() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse3 = new SwagApiResponse(); - SwagApiResponse apiResponse4 = new SwagApiResponse(); + OASApiResponse apiResponse1 = OASApiResponse.getExample(); + OASApiResponse apiResponse2 = OASApiResponse.getExample(); + OASApiResponse apiResponse3 = new OASApiResponse(); + OASApiResponse apiResponse4 = new OASApiResponse(); System.assert(apiResponse1.equals(apiResponse2)); System.assert(apiResponse2.equals(apiResponse1)); @@ -28,19 +28,10 @@ private class SwagApiResponseTest { System.assert(apiResponse4.equals(apiResponse3)); } - @isTest - private static void notEqualsUnlikeInstance() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); - - System.assertEquals(false, apiResponse1.equals(apiResponse2)); - System.assertEquals(false, apiResponse2.equals(apiResponse1)); - } - @isTest private static void notEqualsDifferentType() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); + OASApiResponse apiResponse1 = OASApiResponse.getExample(); + OASApiResponse apiResponse2 = new OASApiResponse(); System.assertEquals(false, apiResponse1.equals('foo')); System.assertEquals(false, apiResponse2.equals('foo')); @@ -48,9 +39,9 @@ private class SwagApiResponseTest { @isTest private static void notEqualsNull() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); - SwagApiResponse apiResponse3; + OASApiResponse apiResponse1 = OASApiResponse.getExample(); + OASApiResponse apiResponse2 = new OASApiResponse(); + OASApiResponse apiResponse3; System.assertEquals(false, apiResponse1.equals(apiResponse3)); System.assertEquals(false, apiResponse2.equals(apiResponse3)); @@ -58,8 +49,8 @@ private class SwagApiResponseTest { @isTest private static void consistentHashCodeValue() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); + OASApiResponse apiResponse1 = OASApiResponse.getExample(); + OASApiResponse apiResponse2 = new OASApiResponse(); System.assertEquals(apiResponse1.hashCode(), apiResponse1.hashCode()); System.assertEquals(apiResponse2.hashCode(), apiResponse2.hashCode()); @@ -67,10 +58,10 @@ private class SwagApiResponseTest { @isTest private static void equalInstancesHaveSameHashCode() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse3 = new SwagApiResponse(); - SwagApiResponse apiResponse4 = new SwagApiResponse(); + OASApiResponse apiResponse1 = OASApiResponse.getExample(); + OASApiResponse apiResponse2 = OASApiResponse.getExample(); + OASApiResponse apiResponse3 = new OASApiResponse(); + OASApiResponse apiResponse4 = new OASApiResponse(); System.assert(apiResponse1.equals(apiResponse2)); System.assert(apiResponse3.equals(apiResponse4)); @@ -80,7 +71,7 @@ private class SwagApiResponseTest { @isTest private static void maintainRenamedProperties() { - SwagApiResponse apiResponse = new SwagApiResponse(); + OASApiResponse apiResponse = new OASApiResponse(); Map propertyMappings = apiResponse.getPropertyMappings(); System.assertEquals('r_type', propertyMappings.get('type')); } diff --git a/samples/client/petstore/apex/deploy/classes/SwagCategory.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponseTest.cls-meta.xml similarity index 80% rename from samples/client/petstore/apex/deploy/classes/SwagCategory.cls-meta.xml rename to samples/client/petstore/apex/force-app/main/default/classes/OASApiResponseTest.cls-meta.xml index 8b061c82b6..fec71a2669 100644 --- a/samples/client/petstore/apex/deploy/classes/SwagCategory.cls-meta.xml +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASApiResponseTest.cls-meta.xml @@ -1,5 +1,5 @@ - 39.0 + 42.0 Active diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategory.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASCategory.cls similarity index 68% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagCategory.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASCategory.cls index 985aa5b1ec..69f1a5c677 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategory.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASCategory.cls @@ -5,15 +5,15 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ /** * A category for a pet */ -public class SwagCategory { +public class OASCategory { /** * Get id * @return id @@ -26,16 +26,16 @@ public class SwagCategory { */ public String name { get; set; } - public static SwagCategory getExample() { - SwagCategory category = new SwagCategory(); - category.id = 123456789L; - category.name = 'aeiou'; + public static OASCategory getExample() { + OASCategory category = new OASCategory(); + category.id = 123456789L; + category.name = ''; return category; } public Boolean equals(Object obj) { - if (obj instanceof SwagCategory) { - SwagCategory category = (SwagCategory) obj; + if (obj instanceof OASCategory) { + OASCategory category = (OASCategory) obj; return this.id == category.id && this.name == category.name; } diff --git a/samples/client/petstore/apex/deploy/classes/SwagCategoryTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASCategory.cls-meta.xml similarity index 80% rename from samples/client/petstore/apex/deploy/classes/SwagCategoryTest.cls-meta.xml rename to samples/client/petstore/apex/force-app/main/default/classes/OASCategory.cls-meta.xml index 38aa015d1f..fec71a2669 100644 --- a/samples/client/petstore/apex/deploy/classes/SwagCategoryTest.cls-meta.xml +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASCategory.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 42.0 Active diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategoryTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASCategoryTest.cls similarity index 53% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagCategoryTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASCategoryTest.cls index 8689ece6dc..534bc3ccfb 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategoryTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASCategoryTest.cls @@ -1,11 +1,11 @@ @isTest -private class SwagCategoryTest { +private class OASCategoryTest { @isTest private static void equalsSameInstance() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = category1; - SwagCategory category3 = new SwagCategory(); - SwagCategory category4 = category3; + OASCategory category1 = OASCategory.getExample(); + OASCategory category2 = category1; + OASCategory category3 = new OASCategory(); + OASCategory category4 = category3; System.assert(category1.equals(category2)); System.assert(category2.equals(category1)); @@ -17,10 +17,10 @@ private class SwagCategoryTest { @isTest private static void equalsIdenticalInstance() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = SwagCategory.getExample(); - SwagCategory category3 = new SwagCategory(); - SwagCategory category4 = new SwagCategory(); + OASCategory category1 = OASCategory.getExample(); + OASCategory category2 = OASCategory.getExample(); + OASCategory category3 = new OASCategory(); + OASCategory category4 = new OASCategory(); System.assert(category1.equals(category2)); System.assert(category2.equals(category1)); @@ -28,19 +28,10 @@ private class SwagCategoryTest { System.assert(category4.equals(category3)); } - @isTest - private static void notEqualsUnlikeInstance() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); - - System.assertEquals(false, category1.equals(category2)); - System.assertEquals(false, category2.equals(category1)); - } - @isTest private static void notEqualsDifferentType() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); + OASCategory category1 = OASCategory.getExample(); + OASCategory category2 = new OASCategory(); System.assertEquals(false, category1.equals('foo')); System.assertEquals(false, category2.equals('foo')); @@ -48,9 +39,9 @@ private class SwagCategoryTest { @isTest private static void notEqualsNull() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); - SwagCategory category3; + OASCategory category1 = OASCategory.getExample(); + OASCategory category2 = new OASCategory(); + OASCategory category3; System.assertEquals(false, category1.equals(category3)); System.assertEquals(false, category2.equals(category3)); @@ -58,8 +49,8 @@ private class SwagCategoryTest { @isTest private static void consistentHashCodeValue() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = new SwagCategory(); + OASCategory category1 = OASCategory.getExample(); + OASCategory category2 = new OASCategory(); System.assertEquals(category1.hashCode(), category1.hashCode()); System.assertEquals(category2.hashCode(), category2.hashCode()); @@ -67,10 +58,10 @@ private class SwagCategoryTest { @isTest private static void equalInstancesHaveSameHashCode() { - SwagCategory category1 = SwagCategory.getExample(); - SwagCategory category2 = SwagCategory.getExample(); - SwagCategory category3 = new SwagCategory(); - SwagCategory category4 = new SwagCategory(); + OASCategory category1 = OASCategory.getExample(); + OASCategory category2 = OASCategory.getExample(); + OASCategory category3 = new OASCategory(); + OASCategory category4 = new OASCategory(); System.assert(category1.equals(category2)); System.assert(category3.equals(category4)); diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASCategoryTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASCategoryTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASCategoryTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASClient.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASClient.cls new file mode 100644 index 0000000000..a808ff44b3 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASClient.cls @@ -0,0 +1,7 @@ +public class OASClient extends OAS.ApiClient { + public OASClient() { + basePath = 'http://petstore.swagger.io/v2'; + calloutName = 'OpenAPI_Petstore'; + authentications.put('api_key', new OAS.ApiKeyHeaderAuth('api_key')); + } +} diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASClient.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASClient.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASClient.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrder.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASOrder.cls similarity index 77% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagOrder.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASOrder.cls index 0937a675e9..cd9e98a3e8 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrder.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASOrder.cls @@ -5,15 +5,15 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ /** * An order for a pets from the pet store */ -public class SwagOrder { +public class OASOrder { /** * Get id * @return id @@ -59,24 +59,24 @@ public class SwagOrder { */ public Boolean complete { get; set; } - public SwagOrder() { + public OASOrder() { complete = false; } - public static SwagOrder getExample() { - SwagOrder order = new SwagOrder(); - order.id = 123456789L; - order.petId = 123456789L; - order.quantity = ; - order.shipDate = Datetime.newInstanceGmt(2000, 1, 23, 4, 56, 7); - order.status = StatusEnum.PLACED; - order.complete = true; + public static OASOrder getExample() { + OASOrder order = new OASOrder(); + order.id = 123456789L; + order.petId = 123456789L; + order.quantity = 0; + order.shipDate = Datetime.newInstanceGmt(2000, 1, 23, 4, 56, 7); + order.status = StatusEnum.PLACED; + order.complete = true; return order; } public Boolean equals(Object obj) { - if (obj instanceof SwagOrder) { - SwagOrder order = (SwagOrder) obj; + if (obj instanceof OASOrder) { + OASOrder order = (OASOrder) obj; return this.id == order.id && this.petId == order.petId && this.quantity == order.quantity diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASOrder.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASOrder.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASOrder.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrderTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASOrderTest.cls similarity index 60% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagOrderTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASOrderTest.cls index 090eea45e5..100f10c139 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrderTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASOrderTest.cls @@ -1,11 +1,11 @@ @isTest -private class SwagOrderTest { +private class OASOrderTest { @isTest private static void equalsSameInstance() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = order1; - SwagOrder order3 = new SwagOrder(); - SwagOrder order4 = order3; + OASOrder order1 = OASOrder.getExample(); + OASOrder order2 = order1; + OASOrder order3 = new OASOrder(); + OASOrder order4 = order3; System.assert(order1.equals(order2)); System.assert(order2.equals(order1)); @@ -17,10 +17,10 @@ private class SwagOrderTest { @isTest private static void equalsIdenticalInstance() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = SwagOrder.getExample(); - SwagOrder order3 = new SwagOrder(); - SwagOrder order4 = new SwagOrder(); + OASOrder order1 = OASOrder.getExample(); + OASOrder order2 = OASOrder.getExample(); + OASOrder order3 = new OASOrder(); + OASOrder order4 = new OASOrder(); System.assert(order1.equals(order2)); System.assert(order2.equals(order1)); @@ -28,19 +28,10 @@ private class SwagOrderTest { System.assert(order4.equals(order3)); } - @isTest - private static void notEqualsUnlikeInstance() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); - - System.assertEquals(false, order1.equals(order2)); - System.assertEquals(false, order2.equals(order1)); - } - @isTest private static void notEqualsDifferentType() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); + OASOrder order1 = OASOrder.getExample(); + OASOrder order2 = new OASOrder(); System.assertEquals(false, order1.equals('foo')); System.assertEquals(false, order2.equals('foo')); @@ -48,9 +39,9 @@ private class SwagOrderTest { @isTest private static void notEqualsNull() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); - SwagOrder order3; + OASOrder order1 = OASOrder.getExample(); + OASOrder order2 = new OASOrder(); + OASOrder order3; System.assertEquals(false, order1.equals(order3)); System.assertEquals(false, order2.equals(order3)); @@ -58,8 +49,8 @@ private class SwagOrderTest { @isTest private static void consistentHashCodeValue() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = new SwagOrder(); + OASOrder order1 = OASOrder.getExample(); + OASOrder order2 = new OASOrder(); System.assertEquals(order1.hashCode(), order1.hashCode()); System.assertEquals(order2.hashCode(), order2.hashCode()); @@ -67,10 +58,10 @@ private class SwagOrderTest { @isTest private static void equalInstancesHaveSameHashCode() { - SwagOrder order1 = SwagOrder.getExample(); - SwagOrder order2 = SwagOrder.getExample(); - SwagOrder order3 = new SwagOrder(); - SwagOrder order4 = new SwagOrder(); + OASOrder order1 = OASOrder.getExample(); + OASOrder order2 = OASOrder.getExample(); + OASOrder order3 = new OASOrder(); + OASOrder order4 = new OASOrder(); System.assert(order1.equals(order2)); System.assert(order3.equals(order4)); @@ -80,7 +71,7 @@ private class SwagOrderTest { @isTest private static void defaultValuesPopulated() { - SwagOrder order = new SwagOrder(); + OASOrder order = new OASOrder(); System.assertEquals(false, order.complete); System.assertEquals(null, order.id); System.assertEquals(null, order.petId); diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASOrderTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASOrderTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASOrderTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPet.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASPet.cls similarity index 72% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagPet.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASPet.cls index b04b5a621b..2a521f464e 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPet.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPet.cls @@ -5,15 +5,15 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ /** * A pet for sale in the pet store */ -public class SwagPet { +public class OASPet { /** * Get id * @return id @@ -24,7 +24,7 @@ public class SwagPet { * Get category * @return category */ - public SwagCategory category { get; set; } + public OASCategory category { get; set; } /** * Get name @@ -42,7 +42,7 @@ public class SwagPet { * Get tags * @return tags */ - public List tags { get; set; } + public List tags { get; set; } /** * pet status in the store @@ -59,25 +59,25 @@ public class SwagPet { */ public StatusEnum status { get; set; } - public SwagPet() { + public OASPet() { photoUrls = new List(); - tags = new List(); + tags = new List(); } - public static SwagPet getExample() { - SwagPet pet = new SwagPet(); - pet.id = 123456789L; - pet.category = SwagCategory.getExample(); - pet.name = 'doggie'; - pet.photoUrls = new List{'aeiou'}; - pet.tags = new List{SwagTag.getExample()}; - pet.status = StatusEnum.AVAILABLE; + public static OASPet getExample() { + OASPet pet = new OASPet(); + pet.id = 123456789L; + pet.category = OASCategory.getExample(); + pet.name = 'doggie'; + pet.photoUrls = new List{''}; + pet.tags = new List{OASTag.getExample()}; + pet.status = StatusEnum.AVAILABLE; return pet; } public Boolean equals(Object obj) { - if (obj instanceof SwagPet) { - SwagPet pet = (SwagPet) obj; + if (obj instanceof OASPet) { + OASPet pet = (OASPet) obj; return this.id == pet.id && this.category == pet.category && this.name == pet.name diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASPet.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASPet.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPet.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApi.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApi.cls similarity index 67% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagPetApi.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASPetApi.cls index 747fd27112..331cb6d2ef 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApi.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApi.cls @@ -5,40 +5,40 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ -public class SwagPetApi { - SwagClient client; +public class OASPetApi { + OASClient client; - public SwagPetApi(SwagClient client) { + public OASPetApi(OASClient client) { this.client = client; } - public SwagPetApi() { - this.client = new SwagClient(); + public OASPetApi() { + this.client = new OASClient(); } - public SwagClient getClient() { + public OASClient getClient() { return this.client; } /** * Add a new pet to the store * - * @param swagPet Pet object that needs to be added to the store (required) - * @throws Swagger.ApiException if fails to make API call + * @param oaSPet Pet object that needs to be added to the store (required) + * @throws OAS.ApiException if fails to make API call */ public void addPet(Map params) { - client.assertNotNull(params.get('swagPet'), 'swagPet'); - List query = new List(); - List form = new List(); + client.assertNotNull(params.get('oaSPet'), 'oaSPet'); + List query = new List(); + List form = new List(); client.invoke( 'POST', '/pet', - (SwagPet) params.get('swagPet'), + (OASPet) params.get('oaSPet'), query, form, new Map(), new Map(), @@ -53,12 +53,12 @@ public class SwagPetApi { * * @param petId Pet id to delete (required) * @param apiKey (optional) - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public void deletePet(Map params) { client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); client.invoke( 'DELETE', '/pet/{petId}', '', @@ -79,19 +79,19 @@ public class SwagPetApi { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter (required) - * @return List - * @throws Swagger.ApiException if fails to make API call + * @return List + * @throws OAS.ApiException if fails to make API call */ - public List findPetsByStatus(Map params) { + public List findPetsByStatus(Map params) { client.assertNotNull(params.get('status'), 'status'); - List query = new List(); + List query = new List(); // cast query params to verify their expected type query.addAll(client.makeParam('status', (List) params.get('status'), 'csv')); - List form = new List(); + List form = new List(); - return (List) client.invoke( + return (List) client.invoke( 'GET', '/pet/findByStatus', '', query, form, new Map(), @@ -99,26 +99,26 @@ public class SwagPetApi { new List{ 'application/xml', 'application/json' }, new List(), new List { 'petstore_auth' }, - List.class + List.class ); } /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List - * @throws Swagger.ApiException if fails to make API call + * @return List + * @throws OAS.ApiException if fails to make API call */ - public List findPetsByTags(Map params) { + public List findPetsByTags(Map params) { client.assertNotNull(params.get('tags'), 'tags'); - List query = new List(); + List query = new List(); // cast query params to verify their expected type query.addAll(client.makeParam('tags', (List) params.get('tags'), 'csv')); - List form = new List(); + List form = new List(); - return (List) client.invoke( + return (List) client.invoke( 'GET', '/pet/findByTags', '', query, form, new Map(), @@ -126,22 +126,22 @@ public class SwagPetApi { new List{ 'application/xml', 'application/json' }, new List(), new List { 'petstore_auth' }, - List.class + List.class ); } /** * Find pet by ID * Returns a single pet * @param petId ID of pet to return (required) - * @return SwagPet - * @throws Swagger.ApiException if fails to make API call + * @return OASPet + * @throws OAS.ApiException if fails to make API call */ - public SwagPet getPetById(Map params) { + public OASPet getPetById(Map params) { client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); - return (SwagPet) client.invoke( + return (OASPet) client.invoke( 'GET', '/pet/{petId}', '', query, form, new Map{ @@ -151,23 +151,23 @@ public class SwagPetApi { new List{ 'application/xml', 'application/json' }, new List(), new List { 'api_key' }, - SwagPet.class + OASPet.class ); } /** * Update an existing pet * - * @param swagPet Pet object that needs to be added to the store (required) - * @throws Swagger.ApiException if fails to make API call + * @param oaSPet Pet object that needs to be added to the store (required) + * @throws OAS.ApiException if fails to make API call */ public void updatePet(Map params) { - client.assertNotNull(params.get('swagPet'), 'swagPet'); - List query = new List(); - List form = new List(); + client.assertNotNull(params.get('oaSPet'), 'oaSPet'); + List query = new List(); + List form = new List(); client.invoke( 'PUT', '/pet', - (SwagPet) params.get('swagPet'), + (OASPet) params.get('oaSPet'), query, form, new Map(), new Map(), @@ -183,12 +183,12 @@ public class SwagPetApi { * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public void updatePetWithForm(Map params) { client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); // cast form params to verify their expected type form.addAll(client.makeParam('name', (String) params.get('name'))); @@ -213,19 +213,19 @@ public class SwagPetApi { * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return SwagApiResponse - * @throws Swagger.ApiException if fails to make API call + * @return OASApiResponse + * @throws OAS.ApiException if fails to make API call */ - public SwagApiResponse uploadFile(Map params) { + public OASApiResponse uploadFile(Map params) { client.assertNotNull(params.get('petId'), 'petId'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); // cast form params to verify their expected type form.addAll(client.makeParam('additionalMetadata', (String) params.get('additionalMetadata'))); form.addAll(client.makeParam('file', (Blob) params.get('file'))); - return (SwagApiResponse) client.invoke( + return (OASApiResponse) client.invoke( 'POST', '/pet/{petId}/uploadImage', '', query, form, new Map{ @@ -235,7 +235,7 @@ public class SwagPetApi { new List{ 'application/json' }, new List{ 'multipart/form-data' }, new List { 'petstore_auth' }, - SwagApiResponse.class + OASApiResponse.class ); } } diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASPetApi.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApi.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApi.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls new file mode 100644 index 0000000000..1eaf5a3ad2 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls @@ -0,0 +1,265 @@ +@isTest +private class OASPetApiTest { + /** + * Add a new pet to the store + * + * + */ + @isTest + private static void addPetTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(201); + res.setStatus('Created'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'oaSPet' => OASPet.getExample() + }; + + OASClient client; + OASPetApi api; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + api.addPet(params); + } + + /** + * Deletes a pet + * + * + */ + @isTest + private static void deletePetTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'petId' => 2147483648L, + 'apiKey' => 'null' + }; + + OASClient client; + OASPetApi api; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + api.deletePet(params); + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ + @isTest + private static void findPetsByStatusTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'status' => new List{'available'} + }; + + OASClient client; + OASPetApi api; + List response; + List expectedResponse; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + + js = JSON.serialize(new List{OASPet.getExample()}); + res.setHeader('Content-Type', 'application/json'); + res.setBody(js); + expectedResponse = new List{OASPet.getExample()}; + response = (List) api.findPetsByStatus(params); + System.assertEquals(expectedResponse, response); + + + js = JSON.serialize(new List{OASPet.getExample()}); + res.setHeader('Content-Type', 'application/xml'); + res.setBody(js); + expectedResponse = new List{OASPet.getExample()}; + response = (List) api.findPetsByStatus(params); + System.assertEquals(expectedResponse, response); + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ + @isTest + private static void findPetsByTagsTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'tags' => new List{''} + }; + + OASClient client; + OASPetApi api; + List response; + List expectedResponse; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + + js = JSON.serialize(new List{OASPet.getExample()}); + res.setHeader('Content-Type', 'application/json'); + res.setBody(js); + expectedResponse = new List{OASPet.getExample()}; + response = (List) api.findPetsByTags(params); + System.assertEquals(expectedResponse, response); + + + js = JSON.serialize(new List{OASPet.getExample()}); + res.setHeader('Content-Type', 'application/xml'); + res.setBody(js); + expectedResponse = new List{OASPet.getExample()}; + response = (List) api.findPetsByTags(params); + System.assertEquals(expectedResponse, response); + } + + /** + * Find pet by ID + * + * Returns a single pet + */ + @isTest + private static void getPetByIdTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'petId' => 2147483648L + }; + + OASClient client; + OASPetApi api; + OASPet response; + OASPet expectedResponse; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + ((OAS.ApiKeyAuth)client.getAuthentication('api_key')).setApiKey('foo-bar-api-key'); + + + js = JSON.serialize(OASPet.getExample()); + res.setHeader('Content-Type', 'application/json'); + res.setBody(js); + expectedResponse = OASPet.getExample(); + response = (OASPet) api.getPetById(params); + System.assertEquals(expectedResponse, response); + + + js = JSON.serialize(OASPet.getExample()); + res.setHeader('Content-Type', 'application/xml'); + res.setBody(js); + expectedResponse = OASPet.getExample(); + response = (OASPet) api.getPetById(params); + System.assertEquals(expectedResponse, response); + } + + /** + * Update an existing pet + * + * + */ + @isTest + private static void updatePetTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'oaSPet' => OASPet.getExample() + }; + + OASClient client; + OASPetApi api; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + api.updatePet(params); + } + + /** + * Updates a pet in the store with form data + * + * + */ + @isTest + private static void updatePetWithFormTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'petId' => 2147483648L, + 'name' => 'null', + 'status' => 'null' + }; + + OASClient client; + OASPetApi api; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + api.updatePetWithForm(params); + } + + /** + * uploads an image + * + * + */ + @isTest + private static void uploadFileTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'petId' => 2147483648L, + 'additionalMetadata' => 'null', + 'file' => Blob.valueOf('Sample text file\nContents') + }; + + OASClient client; + OASPetApi api; + OASApiResponse response; + OASApiResponse expectedResponse; + String js = ''; + + client = new OASClient(); + api = new OASPetApi(client); + + js = JSON.serialize(OASApiResponse.getExample()); + res.setHeader('Content-Type', 'application/json'); + res.setBody(js); + expectedResponse = OASApiResponse.getExample(); + response = (OASApiResponse) api.uploadFile(params); + System.assertEquals(expectedResponse, response); + } +} \ No newline at end of file diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/deploy/classes/SwagPetTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASPetTest.cls similarity index 60% rename from samples/client/petstore/apex/deploy/classes/SwagPetTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASPetTest.cls index 30b6d88b96..b0aa4c692a 100644 --- a/samples/client/petstore/apex/deploy/classes/SwagPetTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetTest.cls @@ -1,11 +1,11 @@ @isTest -private class SwagPetTest { +private class OASPetTest { @isTest private static void equalsSameInstance() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = pet1; - SwagPet pet3 = new SwagPet(); - SwagPet pet4 = pet3; + OASPet pet1 = OASPet.getExample(); + OASPet pet2 = pet1; + OASPet pet3 = new OASPet(); + OASPet pet4 = pet3; System.assert(pet1.equals(pet2)); System.assert(pet2.equals(pet1)); @@ -17,10 +17,10 @@ private class SwagPetTest { @isTest private static void equalsIdenticalInstance() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = SwagPet.getExample(); - SwagPet pet3 = new SwagPet(); - SwagPet pet4 = new SwagPet(); + OASPet pet1 = OASPet.getExample(); + OASPet pet2 = OASPet.getExample(); + OASPet pet3 = new OASPet(); + OASPet pet4 = new OASPet(); System.assert(pet1.equals(pet2)); System.assert(pet2.equals(pet1)); @@ -28,19 +28,10 @@ private class SwagPetTest { System.assert(pet4.equals(pet3)); } - @isTest - private static void notEqualsUnlikeInstance() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); - - System.assertEquals(false, pet1.equals(pet2)); - System.assertEquals(false, pet2.equals(pet1)); - } - @isTest private static void notEqualsDifferentType() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); + OASPet pet1 = OASPet.getExample(); + OASPet pet2 = new OASPet(); System.assertEquals(false, pet1.equals('foo')); System.assertEquals(false, pet2.equals('foo')); @@ -48,9 +39,9 @@ private class SwagPetTest { @isTest private static void notEqualsNull() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); - SwagPet pet3; + OASPet pet1 = OASPet.getExample(); + OASPet pet2 = new OASPet(); + OASPet pet3; System.assertEquals(false, pet1.equals(pet3)); System.assertEquals(false, pet2.equals(pet3)); @@ -58,8 +49,8 @@ private class SwagPetTest { @isTest private static void consistentHashCodeValue() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); + OASPet pet1 = OASPet.getExample(); + OASPet pet2 = new OASPet(); System.assertEquals(pet1.hashCode(), pet1.hashCode()); System.assertEquals(pet2.hashCode(), pet2.hashCode()); @@ -67,10 +58,10 @@ private class SwagPetTest { @isTest private static void equalInstancesHaveSameHashCode() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = SwagPet.getExample(); - SwagPet pet3 = new SwagPet(); - SwagPet pet4 = new SwagPet(); + OASPet pet1 = OASPet.getExample(); + OASPet pet2 = OASPet.getExample(); + OASPet pet3 = new OASPet(); + OASPet pet4 = new OASPet(); System.assert(pet1.equals(pet2)); System.assert(pet3.equals(pet4)); @@ -80,9 +71,9 @@ private class SwagPetTest { @isTest private static void defaultValuesPopulated() { - SwagPet pet = new SwagPet(); + OASPet pet = new OASPet(); System.assertEquals(new List(), pet.photoUrls); - System.assertEquals(new List(), pet.tags); + System.assertEquals(new List(), pet.tags); System.assertEquals(null, pet.id); System.assertEquals(null, pet.category); System.assertEquals(null, pet.name); diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASPetTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASPetTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/modules/openapi-generator/src/main/resources/apex/SwaggerResponseMock.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASResponseMock.cls similarity index 72% rename from modules/openapi-generator/src/main/resources/apex/SwaggerResponseMock.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASResponseMock.cls index 7d3acb1a91..a6931145c5 100644 --- a/modules/openapi-generator/src/main/resources/apex/SwaggerResponseMock.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASResponseMock.cls @@ -1,9 +1,9 @@ @isTest -public class SwaggerResponseMock implements HttpCalloutMock { +public class OASResponseMock implements HttpCalloutMock { private final HttpResponse response; private HttpRequest request; - public SwaggerResponseMock(HttpResponse response) { + public OASResponseMock(HttpResponse response) { this.response = response; } diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASResponseMock.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASResponseMock.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASResponseMock.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApi.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApi.cls similarity index 62% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApi.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASStoreApi.cls index a9f948232f..215f61329f 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApi.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApi.cls @@ -5,23 +5,23 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ -public class SwagStoreApi { - SwagClient client; +public class OASStoreApi { + OASClient client; - public SwagStoreApi(SwagClient client) { + public OASStoreApi(OASClient client) { this.client = client; } - public SwagStoreApi() { - this.client = new SwagClient(); + public OASStoreApi() { + this.client = new OASClient(); } - public SwagClient getClient() { + public OASClient getClient() { return this.client; } @@ -29,12 +29,12 @@ public class SwagStoreApi { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted (required) - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public void deleteOrder(Map params) { client.assertNotNull(params.get('orderId'), 'orderId'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); client.invoke( 'DELETE', '/store/order/{orderId}', '', @@ -53,11 +53,11 @@ public class SwagStoreApi { * Returns pet inventories by status * Returns a map of status codes to quantities * @return Map - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public Map getInventory() { - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); return (Map) client.invoke( 'GET', '/store/inventory', '', @@ -74,15 +74,15 @@ public class SwagStoreApi { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched (required) - * @return SwagOrder - * @throws Swagger.ApiException if fails to make API call + * @return OASOrder + * @throws OAS.ApiException if fails to make API call */ - public SwagOrder getOrderById(Map params) { + public OASOrder getOrderById(Map params) { client.assertNotNull(params.get('orderId'), 'orderId'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); - return (SwagOrder) client.invoke( + return (OASOrder) client.invoke( 'GET', '/store/order/{orderId}', '', query, form, new Map{ @@ -92,31 +92,31 @@ public class SwagStoreApi { new List{ 'application/xml', 'application/json' }, new List(), new List(), - SwagOrder.class + OASOrder.class ); } /** * Place an order for a pet * - * @param swagOrder order placed for purchasing the pet (required) - * @return SwagOrder - * @throws Swagger.ApiException if fails to make API call + * @param oaSOrder order placed for purchasing the pet (required) + * @return OASOrder + * @throws OAS.ApiException if fails to make API call */ - public SwagOrder placeOrder(Map params) { - client.assertNotNull(params.get('swagOrder'), 'swagOrder'); - List query = new List(); - List form = new List(); + public OASOrder placeOrder(Map params) { + client.assertNotNull(params.get('oaSOrder'), 'oaSOrder'); + List query = new List(); + List form = new List(); - return (SwagOrder) client.invoke( + return (OASOrder) client.invoke( 'POST', '/store/order', - (SwagOrder) params.get('swagOrder'), + (OASOrder) params.get('oaSOrder'), query, form, new Map(), new Map(), new List{ 'application/xml', 'application/json' }, new List(), new List(), - SwagOrder.class + OASOrder.class ); } } diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApi.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApi.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApi.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls new file mode 100644 index 0000000000..548c228a65 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls @@ -0,0 +1,130 @@ +@isTest +private class OASStoreApiTest { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @isTest + private static void deleteOrderTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'orderId' => 'null' + }; + + OASClient client; + OASStoreApi api; + String js = ''; + + api = new OASStoreApi(new OASClient()); + + api.deleteOrder(params); + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ + @isTest + private static void getInventoryTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + OASClient client; + OASStoreApi api; + Map response; + Map expectedResponse; + String js = ''; + + client = new OASClient(); + api = new OASStoreApi(client); + ((OAS.ApiKeyAuth)client.getAuthentication('api_key')).setApiKey('foo-bar-api-key'); + + api.getInventory(); + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ + @isTest + private static void getOrderByIdTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'orderId' => 2147483648L + }; + + OASClient client; + OASStoreApi api; + OASOrder response; + OASOrder expectedResponse; + String js = ''; + + api = new OASStoreApi(new OASClient()); + + js = JSON.serialize(OASOrder.getExample()); + res.setHeader('Content-Type', 'application/json'); + res.setBody(js); + expectedResponse = OASOrder.getExample(); + response = (OASOrder) api.getOrderById(params); + System.assertEquals(expectedResponse, response); + + js = JSON.serialize(OASOrder.getExample()); + res.setHeader('Content-Type', 'application/xml'); + res.setBody(js); + expectedResponse = OASOrder.getExample(); + response = (OASOrder) api.getOrderById(params); + System.assertEquals(expectedResponse, response); + } + + /** + * Place an order for a pet + * + * + */ + @isTest + private static void placeOrderTest() { + HttpResponse res = new HttpResponse(); + res.setStatusCode(200); + res.setStatus('OK'); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); + + Map params = new Map{ + 'oaSOrder' => OASOrder.getExample() + }; + + OASClient client; + OASStoreApi api; + OASOrder response; + OASOrder expectedResponse; + String js = ''; + + api = new OASStoreApi(new OASClient()); + + js = JSON.serialize(OASOrder.getExample()); + res.setHeader('Content-Type', 'application/json'); + res.setBody(js); + expectedResponse = OASOrder.getExample(); + response = (OASOrder) api.placeOrder(params); + System.assertEquals(expectedResponse, response); + + js = JSON.serialize(OASOrder.getExample()); + res.setHeader('Content-Type', 'application/xml'); + res.setBody(js); + expectedResponse = OASOrder.getExample(); + response = (OASOrder) api.placeOrder(params); + System.assertEquals(expectedResponse, response); + } +} \ No newline at end of file diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagTag.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASTag.cls similarity index 70% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagTag.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASTag.cls index 8f90699f77..d3658da066 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagTag.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASTag.cls @@ -5,15 +5,15 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ /** * A tag for a pet */ -public class SwagTag { +public class OASTag { /** * Get id * @return id @@ -26,16 +26,16 @@ public class SwagTag { */ public String name { get; set; } - public static SwagTag getExample() { - SwagTag tag = new SwagTag(); - tag.id = 123456789L; - tag.name = 'aeiou'; + public static OASTag getExample() { + OASTag tag = new OASTag(); + tag.id = 123456789L; + tag.name = ''; return tag; } public Boolean equals(Object obj) { - if (obj instanceof SwagTag) { - SwagTag tag = (SwagTag) obj; + if (obj instanceof OASTag) { + OASTag tag = (OASTag) obj; return this.id == tag.id && this.name == tag.name; } diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASTag.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASTag.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASTag.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagTagTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASTagTest.cls similarity index 57% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagTagTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASTagTest.cls index beee669040..43dd1732a9 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagTagTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASTagTest.cls @@ -1,11 +1,11 @@ @isTest -private class SwagTagTest { +private class OASTagTest { @isTest private static void equalsSameInstance() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = tag1; - SwagTag tag3 = new SwagTag(); - SwagTag tag4 = tag3; + OASTag tag1 = OASTag.getExample(); + OASTag tag2 = tag1; + OASTag tag3 = new OASTag(); + OASTag tag4 = tag3; System.assert(tag1.equals(tag2)); System.assert(tag2.equals(tag1)); @@ -17,10 +17,10 @@ private class SwagTagTest { @isTest private static void equalsIdenticalInstance() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = SwagTag.getExample(); - SwagTag tag3 = new SwagTag(); - SwagTag tag4 = new SwagTag(); + OASTag tag1 = OASTag.getExample(); + OASTag tag2 = OASTag.getExample(); + OASTag tag3 = new OASTag(); + OASTag tag4 = new OASTag(); System.assert(tag1.equals(tag2)); System.assert(tag2.equals(tag1)); @@ -28,19 +28,10 @@ private class SwagTagTest { System.assert(tag4.equals(tag3)); } - @isTest - private static void notEqualsUnlikeInstance() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); - - System.assertEquals(false, tag1.equals(tag2)); - System.assertEquals(false, tag2.equals(tag1)); - } - @isTest private static void notEqualsDifferentType() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); + OASTag tag1 = OASTag.getExample(); + OASTag tag2 = new OASTag(); System.assertEquals(false, tag1.equals('foo')); System.assertEquals(false, tag2.equals('foo')); @@ -48,9 +39,9 @@ private class SwagTagTest { @isTest private static void notEqualsNull() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); - SwagTag tag3; + OASTag tag1 = OASTag.getExample(); + OASTag tag2 = new OASTag(); + OASTag tag3; System.assertEquals(false, tag1.equals(tag3)); System.assertEquals(false, tag2.equals(tag3)); @@ -58,8 +49,8 @@ private class SwagTagTest { @isTest private static void consistentHashCodeValue() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = new SwagTag(); + OASTag tag1 = OASTag.getExample(); + OASTag tag2 = new OASTag(); System.assertEquals(tag1.hashCode(), tag1.hashCode()); System.assertEquals(tag2.hashCode(), tag2.hashCode()); @@ -67,10 +58,10 @@ private class SwagTagTest { @isTest private static void equalInstancesHaveSameHashCode() { - SwagTag tag1 = SwagTag.getExample(); - SwagTag tag2 = SwagTag.getExample(); - SwagTag tag3 = new SwagTag(); - SwagTag tag4 = new SwagTag(); + OASTag tag1 = OASTag.getExample(); + OASTag tag2 = OASTag.getExample(); + OASTag tag3 = new OASTag(); + OASTag tag4 = new OASTag(); System.assert(tag1.equals(tag2)); System.assert(tag3.equals(tag4)); diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASTagTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASTagTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASTagTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/modules/openapi-generator/src/main/resources/apex/SwaggerTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASTest.cls similarity index 82% rename from modules/openapi-generator/src/main/resources/apex/SwaggerTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASTest.cls index e3cec8831c..e1c73d185e 100644 --- a/modules/openapi-generator/src/main/resources/apex/SwaggerTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASTest.cls @@ -1,19 +1,19 @@ @isTest -private class SwaggerTest { +private class OASTest { @isTest private static void Param_urlEncodeKeyValuePairUtf8() { String toEncodeLeft = 'Hello +%-_.!~*\'()@'; String toEncodeRight = 'World +%-_.!~*\'()@'; String expected = 'Hello+%2B%25-_.%21%7E*%27%28%29%40=World+%2B%25-_.%21%7E*%27%28%29%40'; - String result = new Swagger.Param(toEncodeLeft, toEncodeRight).toString(); + String result = new OAS.Param(toEncodeLeft, toEncodeRight).toString(); System.assertEquals(expected, result); } @isTest private static void ApiKeyHeaderAuth_keyInHeaderWithGivenName() { Map headers = new Map(); - List query = new List(); - Swagger.ApiKeyHeaderAuth auth = new Swagger.ApiKeyHeaderAuth('X-Authenticate'); + List query = new List(); + OAS.ApiKeyHeaderAuth auth = new OAS.ApiKeyHeaderAuth('X-Authenticate'); auth.setApiKey('foo-bar-api-key'); auth.apply(headers, query); @@ -25,8 +25,8 @@ private class SwaggerTest { @isTest private static void ApiKeyQueryAuth_keyInQueryParamWithGivenName() { Map headers = new Map(); - List query = new List(); - Swagger.ApiKeyQueryAuth auth = new Swagger.ApiKeyQueryAuth('auth_token'); + List query = new List(); + OAS.ApiKeyQueryAuth auth = new OAS.ApiKeyQueryAuth('auth_token'); auth.setApiKey('foo-bar-api-key'); auth.apply(headers, query); @@ -38,8 +38,8 @@ private class SwaggerTest { @isTest private static void ApiClient_returnAuthenticationMatchingInput() { MockApiClient client = new MockApiClient(); - Swagger.ApiKeyHeaderAuth auth1 = new Swagger.ApiKeyHeaderAuth('foo'); - Swagger.ApiKeyQueryAuth auth2 = new Swagger.ApiKeyQueryAuth('foo'); + OAS.ApiKeyHeaderAuth auth1 = new OAS.ApiKeyHeaderAuth('foo'); + OAS.ApiKeyQueryAuth auth2 = new OAS.ApiKeyQueryAuth('foo'); client.authentications.put('auth1', auth1); client.authentications.put('auth2', auth2); @@ -51,8 +51,8 @@ private class SwaggerTest { @isTest private static void ApiClient_oneKeyValuePairForEachValueInList() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParams('foo', values); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParams('foo', values); System.assertEquals(5, params.size()); System.assertEquals('foo=bar', params.get(0).toString()); @@ -64,8 +64,8 @@ private class SwaggerTest { @isTest private static void ApiClient_nullMultiValuesListToEmptyParamsList() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParams('foo', null); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParams('foo', null); System.assert(params.isEmpty()); } @@ -73,8 +73,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSingleCsvKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'csv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'csv'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar%2C4%2Cfalse%2C12.4%2C', params.get(0).toString()); @@ -83,8 +83,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSingleSsvKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'ssv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'ssv'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar+4+false+12.4+', params.get(0).toString()); @@ -93,8 +93,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSingleTsvKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'tsv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'tsv'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar%094%09false%0912.4%09', params.get(0).toString()); @@ -103,8 +103,8 @@ private class SwaggerTest { @isTest private static void ApiClient_valuesListToSinglePipeSeparatedKeyValuePair() { List values = new List{'bar', 4, false, 12.4, ''}; - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', values, 'pipes'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', values, 'pipes'); System.assertEquals(1, params.size()); System.assertEquals('foo=bar%7C4%7Cfalse%7C12.4%7C', params.get(0).toString()); @@ -112,16 +112,16 @@ private class SwaggerTest { @isTest private static void ApiClient_nullValuesListToEmptyParamsList() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = client.makeParam('foo', null, 'csv'); + OAS.ApiClient client = new OAS.ApiClient(); + List params = client.makeParam('foo', null, 'csv'); System.assert(params.isEmpty()); } @isTest private static void ApiClient_paramsFromAnyPrimitiveTypeDiscardNull() { - Swagger.ApiClient client = new Swagger.ApiClient(); - List params = new List(); + OAS.ApiClient client = new OAS.ApiClient(); + List params = new List(); params.addAll(client.makeParam('foo', 'bar')); params.addAll(client.makeParam('foo', 10)); params.addAll(client.makeParam('foo', 12.6)); @@ -141,13 +141,13 @@ private class SwaggerTest { @isTest private static void ApiClient_requiredParameterPasses() { - Swagger.ApiClient client = new Swagger.ApiClient(); + OAS.ApiClient client = new OAS.ApiClient(); client.assertNotNull('foo', 'bar'); } @isTest private static void ApiClient_requiredParameterFails() { - Swagger.ApiClient client = new Swagger.ApiClient(); + OAS.ApiClient client = new OAS.ApiClient(); try { client.assertNotNull(null, 'bar'); } catch (NullPointerException e) { @@ -217,7 +217,7 @@ private class SwaggerTest { '"bat":false' }; Set actual1 = new Set(client - .toBody('application/json', body1, new List()) + .toBody('application/json', body1, new List()) .removeStart('{') .removeEnd('}') .split(',') @@ -225,12 +225,12 @@ private class SwaggerTest { System.assertEquals(expected1, actual1); String body2 = 'Hello, World!'; - String actual2 = client.toBody('text/plain', body2, new List()); + String actual2 = client.toBody('text/plain', body2, new List()); System.assertEquals(body2, actual2); - List form = new List{ - new Swagger.Param('hello', 'world'), - new Swagger.Param('date', '2017-01-01 15:00:00') + List form = new List{ + new OAS.Param('hello', 'world'), + new OAS.Param('date', '2017-01-01 15:00:00') }; String expected3 = 'hello=world&date=2017-01-01+15%3A00%3A00'; String actual3 = client.toBody('application/x-www-form-urlencoded', '', form); @@ -288,11 +288,11 @@ private class SwaggerTest { MockApiClient client = new MockApiClient(); String path = '/departments/{department}'; Map params = new Map{'department' => 'finance'}; - List queryParams = new List{ - new Swagger.Param('foo', 'bar'), - new Swagger.Param('bat', '123') + List queryParams = new List{ + new OAS.Param('foo', 'bar'), + new OAS.Param('bat', '123') }; - String expected = 'https://www.mccombs.utexas.edu/departments/finance?foo=bar&bat=123'; + String expected = 'callout:Winkelmeyer/departments/finance?foo=bar&bat=123'; String actual = client.toEndpoint(path, params, queryParams); System.assertEquals(expected, actual); } @@ -301,7 +301,7 @@ private class SwaggerTest { private static void ApiClient_returnParsedBody() { MockApiClient client = new MockApiClient(); HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); + OASResponseMock mock = new OASResponseMock(res); Test.setMock(HttpCalloutMock.class, mock); res.setStatus('OK'); @@ -314,8 +314,8 @@ private class SwaggerTest { Address a = (Address) client.invoke( 'GET', '/address', '', - new List(), - new List(), + new List(), + new List(), new Map(), new Map(), new List{'application/json'}, @@ -337,7 +337,7 @@ private class SwaggerTest { private static void ApiClient_noReturnTypeReturnsNull() { MockApiClient client = new MockApiClient(); HttpResponse res = new HttpResponse(); - SwaggerResponseMock mock = new SwaggerResponseMock(res); + OASResponseMock mock = new OASResponseMock(res); Test.setMock(HttpCalloutMock.class, mock); res.setStatus('OK'); @@ -345,8 +345,8 @@ private class SwaggerTest { Object o = client.invoke( 'POST', '/address', '', - new List(), - new List(), + new List(), + new List(), new Map(), new Map(), new List{'application/json'}, @@ -358,9 +358,10 @@ private class SwaggerTest { System.assertEquals(null, o); } - private class MockApiClient extends Swagger.ApiClient { + private class MockApiClient extends OAS.ApiClient { public MockApiClient() { - basePath = 'https://www.mccombs.utexas.edu'; + basePath = 'https://blog.winkelmeyer.com'; + calloutName = 'Winkelmeyer'; } } } \ No newline at end of file diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUser.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASUser.cls similarity index 80% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagUser.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASUser.cls index 63e4c8423e..8ce543f9fe 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUser.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUser.cls @@ -5,15 +5,15 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ /** * A User who is purchasing from the pet store */ -public class SwagUser { +public class OASUser { /** * Get id * @return id @@ -62,22 +62,22 @@ public class SwagUser { */ public Integer userStatus { get; set; } - public static SwagUser getExample() { - SwagUser user = new SwagUser(); - user.id = 123456789L; - user.username = 'aeiou'; - user.firstName = 'aeiou'; - user.lastName = 'aeiou'; - user.email = 'aeiou'; - user.password = 'aeiou'; - user.phone = 'aeiou'; - user.userStatus = ; + public static OASUser getExample() { + OASUser user = new OASUser(); + user.id = 123456789L; + user.username = ''; + user.firstName = ''; + user.lastName = ''; + user.email = ''; + user.password = ''; + user.phone = ''; + user.userStatus = 0; return user; } public Boolean equals(Object obj) { - if (obj instanceof SwagUser) { - SwagUser user = (SwagUser) obj; + if (obj instanceof OASUser) { + OASUser user = (OASUser) obj; return this.id == user.id && this.username == user.username && this.firstName == user.firstName diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASUser.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASUser.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUser.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApi.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApi.cls similarity index 64% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagUserApi.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASUserApi.cls index ae296e8d3b..c86416a450 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApi.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApi.cls @@ -5,40 +5,40 @@ * OpenAPI spec version: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OAS-api/OAS-codegen.git * Do not edit the class manually. */ -public class SwagUserApi { - SwagClient client; +public class OASUserApi { + OASClient client; - public SwagUserApi(SwagClient client) { + public OASUserApi(OASClient client) { this.client = client; } - public SwagUserApi() { - this.client = new SwagClient(); + public OASUserApi() { + this.client = new OASClient(); } - public SwagClient getClient() { + public OASClient getClient() { return this.client; } /** * Create user * This can only be done by the logged in user. - * @param swagUser Created user object (required) - * @throws Swagger.ApiException if fails to make API call + * @param oaSUser Created user object (required) + * @throws OAS.ApiException if fails to make API call */ public void createUser(Map params) { - client.assertNotNull(params.get('swagUser'), 'swagUser'); - List query = new List(); - List form = new List(); + client.assertNotNull(params.get('oaSUser'), 'oaSUser'); + List query = new List(); + List form = new List(); client.invoke( 'POST', '/user', - (SwagUser) params.get('swagUser'), + (OASUser) params.get('oaSUser'), query, form, new Map(), new Map(), @@ -51,17 +51,17 @@ public class SwagUserApi { /** * Creates list of users with given input array * - * @param swagUser List of user object (required) - * @throws Swagger.ApiException if fails to make API call + * @param oaSUser List of user object (required) + * @throws OAS.ApiException if fails to make API call */ public void createUsersWithArrayInput(Map params) { - client.assertNotNull(params.get('swagUser'), 'swagUser'); - List query = new List(); - List form = new List(); + client.assertNotNull(params.get('oaSUser'), 'oaSUser'); + List query = new List(); + List form = new List(); client.invoke( 'POST', '/user/createWithArray', - (List) params.get('swagUser'), + (List) params.get('oaSUser'), query, form, new Map(), new Map(), @@ -74,17 +74,17 @@ public class SwagUserApi { /** * Creates list of users with given input array * - * @param swagUser List of user object (required) - * @throws Swagger.ApiException if fails to make API call + * @param oaSUser List of user object (required) + * @throws OAS.ApiException if fails to make API call */ public void createUsersWithListInput(Map params) { - client.assertNotNull(params.get('swagUser'), 'swagUser'); - List query = new List(); - List form = new List(); + client.assertNotNull(params.get('oaSUser'), 'oaSUser'); + List query = new List(); + List form = new List(); client.invoke( 'POST', '/user/createWithList', - (List) params.get('swagUser'), + (List) params.get('oaSUser'), query, form, new Map(), new Map(), @@ -98,12 +98,12 @@ public class SwagUserApi { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted (required) - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public void deleteUser(Map params) { client.assertNotNull(params.get('username'), 'username'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); client.invoke( 'DELETE', '/user/{username}', '', @@ -122,15 +122,15 @@ public class SwagUserApi { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return SwagUser - * @throws Swagger.ApiException if fails to make API call + * @return OASUser + * @throws OAS.ApiException if fails to make API call */ - public SwagUser getUserByName(Map params) { + public OASUser getUserByName(Map params) { client.assertNotNull(params.get('username'), 'username'); - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); - return (SwagUser) client.invoke( + return (OASUser) client.invoke( 'GET', '/user/{username}', '', query, form, new Map{ @@ -140,7 +140,7 @@ public class SwagUserApi { new List{ 'application/xml', 'application/json' }, new List(), new List(), - SwagUser.class + OASUser.class ); } /** @@ -149,18 +149,18 @@ public class SwagUserApi { * @param username The user name for login (required) * @param password The password for login in clear text (required) * @return String - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public String loginUser(Map params) { client.assertNotNull(params.get('username'), 'username'); client.assertNotNull(params.get('password'), 'password'); - List query = new List(); + List query = new List(); // cast query params to verify their expected type query.addAll(client.makeParam('username', (String) params.get('username'))); query.addAll(client.makeParam('password', (String) params.get('password'))); - List form = new List(); + List form = new List(); return (String) client.invoke( 'GET', '/user/login', '', @@ -176,11 +176,11 @@ public class SwagUserApi { /** * Logs out current logged in user session * - * @throws Swagger.ApiException if fails to make API call + * @throws OAS.ApiException if fails to make API call */ public void logoutUser() { - List query = new List(); - List form = new List(); + List query = new List(); + List form = new List(); client.invoke( 'GET', '/user/logout', '', @@ -197,18 +197,18 @@ public class SwagUserApi { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param swagUser Updated user object (required) - * @throws Swagger.ApiException if fails to make API call + * @param oaSUser Updated user object (required) + * @throws OAS.ApiException if fails to make API call */ public void updateUser(Map params) { client.assertNotNull(params.get('username'), 'username'); - client.assertNotNull(params.get('swagUser'), 'swagUser'); - List query = new List(); - List form = new List(); + client.assertNotNull(params.get('oaSUser'), 'oaSUser'); + List query = new List(); + List form = new List(); client.invoke( 'PUT', '/user/{username}', - (SwagUser) params.get('swagUser'), + (OASUser) params.get('oaSUser'), query, form, new Map{ 'username' => (String) params.get('username') diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASUserApi.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApi.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApi.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls similarity index 55% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagUserApiTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls index 637f55bd5a..3d797e0798 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApiTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls @@ -1,5 +1,5 @@ @isTest -private class SwagUserApiTest { +private class OASUserApiTest { /** * Create user * @@ -10,16 +10,17 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(201); res.setStatus('Created'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'body' => SwagUser.getExample() + 'oaSUser' => OASUser.getExample() }; - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); api.createUser(params); } @@ -34,16 +35,17 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'body' => new List{SwagUser.getExample()} + 'oaSUser' => new List{OASUser.getExample()} }; - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); api.createUsersWithArrayInput(params); } @@ -58,16 +60,17 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'body' => new List{SwagUser.getExample()} + 'oaSUser' => new List{OASUser.getExample()} }; - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); api.createUsersWithListInput(params); } @@ -82,16 +85,17 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'username' => 'username_example' + 'username' => 'null' }; - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); api.deleteUser(params); } @@ -106,23 +110,32 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'username' => 'username_example' + 'username' => 'null' }; - SwagClient client; - SwagUserApi api; - SwagUser response; - SwagUser expectedResponse; + OASClient client; + OASUserApi api; + OASUser response; + OASUser expectedResponse; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); + js = JSON.serialize(OASUser.getExample()); res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "firstName" : "aeiou",\n "lastName" : "aeiou",\n "password" : "aeiou",\n "userStatus" : 6,\n "phone" : "aeiou",\n "id" : 0,\n "email" : "aeiou",\n "username" : "aeiou"\n}'); - expectedResponse = SwagUser.getExample(); - response = (SwagUser) api.getUserByName(params); + res.setBody(js); + expectedResponse = OASUser.getExample(); + response = (OASUser) api.getUserByName(params); + System.assertEquals(expectedResponse, response); + + js = JSON.serialize(OASUser.getExample()); + res.setHeader('Content-Type', 'application/xml'); + res.setBody(js); + expectedResponse = OASUser.getExample(); + response = (OASUser) api.getUserByName(params); System.assertEquals(expectedResponse, response); } @@ -136,25 +149,22 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'username' => 'username_example', - 'password' => 'password_example' + 'username' => 'null', + 'password' => 'null' }; - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; String response; String expectedResponse; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); - res.setHeader('Content-Type', 'application/json'); - res.setBody('"aeiou"'); - expectedResponse = 'aeiou'; - response = (String) api.loginUser(params); - System.assertEquals(expectedResponse, response); + api.loginUser(params); } /** @@ -167,12 +177,13 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); api.logoutUser(); } @@ -187,17 +198,18 @@ private class SwagUserApiTest { HttpResponse res = new HttpResponse(); res.setStatusCode(200); res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); + Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'username' => 'username_example', - 'body' => SwagUser.getExample() + 'username' => 'null', + 'oaSUser' => OASUser.getExample() }; - SwagClient client; - SwagUserApi api; + OASClient client; + OASUserApi api; + String js = ''; - api = new SwagUserApi(new SwagClient()); + api = new OASUserApi(new OASClient()); api.updateUser(params); } diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASUserTest.cls similarity index 56% rename from samples/client/petstore/apex/force-app/main/default/classes/SwagUserTest.cls rename to samples/client/petstore/apex/force-app/main/default/classes/OASUserTest.cls index ec89e21ac1..c8bbc9cfd4 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserTest.cls @@ -1,11 +1,11 @@ @isTest -private class SwagUserTest { +private class OASUserTest { @isTest private static void equalsSameInstance() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = user1; - SwagUser user3 = new SwagUser(); - SwagUser user4 = user3; + OASUser user1 = OASUser.getExample(); + OASUser user2 = user1; + OASUser user3 = new OASUser(); + OASUser user4 = user3; System.assert(user1.equals(user2)); System.assert(user2.equals(user1)); @@ -17,10 +17,10 @@ private class SwagUserTest { @isTest private static void equalsIdenticalInstance() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = SwagUser.getExample(); - SwagUser user3 = new SwagUser(); - SwagUser user4 = new SwagUser(); + OASUser user1 = OASUser.getExample(); + OASUser user2 = OASUser.getExample(); + OASUser user3 = new OASUser(); + OASUser user4 = new OASUser(); System.assert(user1.equals(user2)); System.assert(user2.equals(user1)); @@ -28,19 +28,10 @@ private class SwagUserTest { System.assert(user4.equals(user3)); } - @isTest - private static void notEqualsUnlikeInstance() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); - - System.assertEquals(false, user1.equals(user2)); - System.assertEquals(false, user2.equals(user1)); - } - @isTest private static void notEqualsDifferentType() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); + OASUser user1 = OASUser.getExample(); + OASUser user2 = new OASUser(); System.assertEquals(false, user1.equals('foo')); System.assertEquals(false, user2.equals('foo')); @@ -48,9 +39,9 @@ private class SwagUserTest { @isTest private static void notEqualsNull() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); - SwagUser user3; + OASUser user1 = OASUser.getExample(); + OASUser user2 = new OASUser(); + OASUser user3; System.assertEquals(false, user1.equals(user3)); System.assertEquals(false, user2.equals(user3)); @@ -58,8 +49,8 @@ private class SwagUserTest { @isTest private static void consistentHashCodeValue() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = new SwagUser(); + OASUser user1 = OASUser.getExample(); + OASUser user2 = new OASUser(); System.assertEquals(user1.hashCode(), user1.hashCode()); System.assertEquals(user2.hashCode(), user2.hashCode()); @@ -67,10 +58,10 @@ private class SwagUserTest { @isTest private static void equalInstancesHaveSameHashCode() { - SwagUser user1 = SwagUser.getExample(); - SwagUser user2 = SwagUser.getExample(); - SwagUser user3 = new SwagUser(); - SwagUser user4 = new SwagUser(); + OASUser user1 = OASUser.getExample(); + OASUser user2 = OASUser.getExample(); + OASUser user3 = new OASUser(); + OASUser user4 = new OASUser(); System.assert(user1.equals(user2)); System.assert(user3.equals(user4)); diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASUserTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASUserTest.cls-meta.xml new file mode 100644 index 0000000000..fec71a2669 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponse.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponse.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponse.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponseTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponseTest.cls deleted file mode 100644 index a7095a4f1c..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponseTest.cls +++ /dev/null @@ -1,87 +0,0 @@ -@isTest -private class SwagApiResponseTest { - @isTest - private static void equalsSameInstance() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = apiResponse1; - SwagApiResponse apiResponse3 = new SwagApiResponse(); - SwagApiResponse apiResponse4 = apiResponse3; - - System.assert(apiResponse1.equals(apiResponse2)); - System.assert(apiResponse2.equals(apiResponse1)); - System.assert(apiResponse1.equals(apiResponse1)); - System.assert(apiResponse3.equals(apiResponse4)); - System.assert(apiResponse4.equals(apiResponse3)); - System.assert(apiResponse3.equals(apiResponse3)); - } - - @isTest - private static void equalsIdenticalInstance() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse3 = new SwagApiResponse(); - SwagApiResponse apiResponse4 = new SwagApiResponse(); - - System.assert(apiResponse1.equals(apiResponse2)); - System.assert(apiResponse2.equals(apiResponse1)); - System.assert(apiResponse3.equals(apiResponse4)); - System.assert(apiResponse4.equals(apiResponse3)); - } - - @isTest - private static void notEqualsUnlikeInstance() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); - - System.assertEquals(false, apiResponse1.equals(apiResponse2)); - System.assertEquals(false, apiResponse2.equals(apiResponse1)); - } - - @isTest - private static void notEqualsDifferentType() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); - - System.assertEquals(false, apiResponse1.equals('foo')); - System.assertEquals(false, apiResponse2.equals('foo')); - } - - @isTest - private static void notEqualsNull() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); - SwagApiResponse apiResponse3; - - System.assertEquals(false, apiResponse1.equals(apiResponse3)); - System.assertEquals(false, apiResponse2.equals(apiResponse3)); - } - - @isTest - private static void consistentHashCodeValue() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = new SwagApiResponse(); - - System.assertEquals(apiResponse1.hashCode(), apiResponse1.hashCode()); - System.assertEquals(apiResponse2.hashCode(), apiResponse2.hashCode()); - } - - @isTest - private static void equalInstancesHaveSameHashCode() { - SwagApiResponse apiResponse1 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse2 = SwagApiResponse.getExample(); - SwagApiResponse apiResponse3 = new SwagApiResponse(); - SwagApiResponse apiResponse4 = new SwagApiResponse(); - - System.assert(apiResponse1.equals(apiResponse2)); - System.assert(apiResponse3.equals(apiResponse4)); - System.assertEquals(apiResponse1.hashCode(), apiResponse2.hashCode()); - System.assertEquals(apiResponse3.hashCode(), apiResponse4.hashCode()); - } - - @isTest - private static void maintainRenamedProperties() { - SwagApiResponse apiResponse = new SwagApiResponse(); - Map propertyMappings = apiResponse.getPropertyMappings(); - System.assertEquals('r_type', propertyMappings.get('type')); - } -} diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponseTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponseTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagApiResponseTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategory.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagCategory.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategory.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategoryTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagCategoryTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagCategoryTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagClient.cls b/samples/client/petstore/apex/force-app/main/default/classes/SwagClient.cls deleted file mode 100644 index ee404c543f..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagClient.cls +++ /dev/null @@ -1,7 +0,0 @@ -public class SwagClient extends Swagger.ApiClient { - public SwagClient() { - basePath = 'http://petstore.swagger.io/v2'; - calloutName = 'OpenAPI_Petstore'; - authentications.put('api_key', new Swagger.ApiKeyHeaderAuth('api_key')); - } -} diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagClient.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagClient.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagClient.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrder.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagOrder.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrder.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrderTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagOrderTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagOrderTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPet.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagPet.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPet.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApi.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApi.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApi.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApiTest.cls deleted file mode 100644 index c1daa5f626..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApiTest.cls +++ /dev/null @@ -1,233 +0,0 @@ -@isTest -private class SwagPetApiTest { - /** - * Add a new pet to the store - * - * - */ - @isTest - private static void addPetTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(201); - res.setStatus('Created'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagPet.getExample() - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - api.addPet(params); - } - - /** - * Deletes a pet - * - * - */ - @isTest - private static void deletePetTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L, - 'apiKey' => 'apiKey_example' - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - api.deletePet(params); - } - - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - */ - @isTest - private static void findPetsByStatusTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'status' => new List{'available'} - }; - - SwagClient client; - SwagPetApi api; - List response; - List expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('[ {\n "photoUrls" : [ "aeiou" ],\n "name" : "doggie",\n "id" : 0,\n "category" : {\n "name" : "aeiou",\n "id" : 6\n },\n "tags" : [ {\n "name" : "aeiou",\n "id" : 1\n } ],\n "status" : "available"\n} ]'); - expectedResponse = new List{SwagPet.getExample()}; - response = (List) api.findPetsByStatus(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - */ - @isTest - private static void findPetsByTagsTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'tags' => new List{'aeiou'} - }; - - SwagClient client; - SwagPetApi api; - List response; - List expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('[ {\n "photoUrls" : [ "aeiou" ],\n "name" : "doggie",\n "id" : 0,\n "category" : {\n "name" : "aeiou",\n "id" : 6\n },\n "tags" : [ {\n "name" : "aeiou",\n "id" : 1\n } ],\n "status" : "available"\n} ]'); - expectedResponse = new List{SwagPet.getExample()}; - response = (List) api.findPetsByTags(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Find pet by ID - * - * Returns a single pet - */ - @isTest - private static void getPetByIdTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L - }; - - SwagClient client; - SwagPetApi api; - SwagPet response; - SwagPet expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); - ((Swagger.ApiKeyAuth) client.getAuthentication('api_key'); - client.setApiKey('foo-bar-api-key'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "photoUrls" : [ "aeiou" ],\n "name" : "doggie",\n "id" : 0,\n "category" : {\n "name" : "aeiou",\n "id" : 6\n },\n "tags" : [ {\n "name" : "aeiou",\n "id" : 1\n } ],\n "status" : "available"\n}'); - expectedResponse = SwagPet.getExample(); - response = (SwagPet) api.getPetById(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Update an existing pet - * - * - */ - @isTest - private static void updatePetTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagPet.getExample() - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - api.updatePet(params); - } - - /** - * Updates a pet in the store with form data - * - * - */ - @isTest - private static void updatePetWithFormTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L, - 'name' => 'name_example', - 'status' => 'status_example' - }; - - SwagClient client; - SwagPetApi api; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - api.updatePetWithForm(params); - } - - /** - * uploads an image - * - * - */ - @isTest - private static void uploadFileTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'petId' => 2147483648L, - 'additionalMetadata' => 'additionalMetadata_example', - 'file' => Blob.valueOf('Sample text file\nContents') - }; - - SwagClient client; - SwagPetApi api; - SwagApiResponse response; - SwagApiResponse expectedResponse; - - client = new SwagClient(); - api = new SwagPetApi(client); client.getAuthentication('petstore_auth'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "code" : 0,\n "type" : "aeiou",\n "message" : "aeiou"\n}'); - expectedResponse = SwagApiResponse.getExample(); - response = (SwagApiResponse) api.uploadFile(params); - System.assertEquals(expectedResponse, response); - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApiTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApiTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetApiTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/SwagPetTest.cls deleted file mode 100644 index 30b6d88b96..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetTest.cls +++ /dev/null @@ -1,91 +0,0 @@ -@isTest -private class SwagPetTest { - @isTest - private static void equalsSameInstance() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = pet1; - SwagPet pet3 = new SwagPet(); - SwagPet pet4 = pet3; - - System.assert(pet1.equals(pet2)); - System.assert(pet2.equals(pet1)); - System.assert(pet1.equals(pet1)); - System.assert(pet3.equals(pet4)); - System.assert(pet4.equals(pet3)); - System.assert(pet3.equals(pet3)); - } - - @isTest - private static void equalsIdenticalInstance() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = SwagPet.getExample(); - SwagPet pet3 = new SwagPet(); - SwagPet pet4 = new SwagPet(); - - System.assert(pet1.equals(pet2)); - System.assert(pet2.equals(pet1)); - System.assert(pet3.equals(pet4)); - System.assert(pet4.equals(pet3)); - } - - @isTest - private static void notEqualsUnlikeInstance() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); - - System.assertEquals(false, pet1.equals(pet2)); - System.assertEquals(false, pet2.equals(pet1)); - } - - @isTest - private static void notEqualsDifferentType() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); - - System.assertEquals(false, pet1.equals('foo')); - System.assertEquals(false, pet2.equals('foo')); - } - - @isTest - private static void notEqualsNull() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); - SwagPet pet3; - - System.assertEquals(false, pet1.equals(pet3)); - System.assertEquals(false, pet2.equals(pet3)); - } - - @isTest - private static void consistentHashCodeValue() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = new SwagPet(); - - System.assertEquals(pet1.hashCode(), pet1.hashCode()); - System.assertEquals(pet2.hashCode(), pet2.hashCode()); - } - - @isTest - private static void equalInstancesHaveSameHashCode() { - SwagPet pet1 = SwagPet.getExample(); - SwagPet pet2 = SwagPet.getExample(); - SwagPet pet3 = new SwagPet(); - SwagPet pet4 = new SwagPet(); - - System.assert(pet1.equals(pet2)); - System.assert(pet3.equals(pet4)); - System.assertEquals(pet1.hashCode(), pet2.hashCode()); - System.assertEquals(pet3.hashCode(), pet4.hashCode()); - } - - @isTest - private static void defaultValuesPopulated() { - SwagPet pet = new SwagPet(); - System.assertEquals(new List(), pet.photoUrls); - System.assertEquals(new List(), pet.tags); - System.assertEquals(null, pet.id); - System.assertEquals(null, pet.category); - System.assertEquals(null, pet.name); - System.assertEquals(null, pet.status); - } -} diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagPetTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagPetTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApi.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApi.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApi.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApiTest.cls deleted file mode 100644 index c79bbd98ac..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApiTest.cls +++ /dev/null @@ -1,115 +0,0 @@ -@isTest -private class SwagStoreApiTest { - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - */ - @isTest - private static void deleteOrderTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'orderId' => 'orderId_example' - }; - - SwagClient client; - SwagStoreApi api; - - api = new SwagStoreApi(new SwagClient()); - - api.deleteOrder(params); - } - - /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - */ - @isTest - private static void getInventoryTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - SwagClient client; - SwagStoreApi api; - Map response; - Map expectedResponse; - - client = new SwagClient(); - api = new SwagStoreApi(client); - ((Swagger.ApiKeyAuth) client.getAuthentication('api_key'); - client.setApiKey('foo-bar-api-key'); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "key" : 0\n}'); - expectedResponse = new Map{'key'=>123}; - response = (Map) api.getInventory(); - System.assertEquals(expectedResponse, response); - } - - /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - */ - @isTest - private static void getOrderByIdTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'orderId' => 2147483648L - }; - - SwagClient client; - SwagStoreApi api; - SwagOrder response; - SwagOrder expectedResponse; - - api = new SwagStoreApi(new SwagClient()); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "petId" : 6,\n "quantity" : 1,\n "id" : 0,\n "shipDate" : "2000-01-23T04:56:07.000+00:00",\n "complete" : false,\n "status" : "placed"\n}'); - expectedResponse = SwagOrder.getExample(); - response = (SwagOrder) api.getOrderById(params); - System.assertEquals(expectedResponse, response); - } - - /** - * Place an order for a pet - * - * - */ - @isTest - private static void placeOrderTest() { - HttpResponse res = new HttpResponse(); - res.setStatusCode(200); - res.setStatus('OK'); - Test.setMock(HttpCalloutMock.class, new SwaggerResponseMock(res)); - - Map params = new Map{ - 'body' => SwagOrder.getExample() - }; - - SwagClient client; - SwagStoreApi api; - SwagOrder response; - SwagOrder expectedResponse; - - api = new SwagStoreApi(new SwagClient()); - - res.setHeader('Content-Type', 'application/json'); - res.setBody('{\n "petId" : 6,\n "quantity" : 1,\n "id" : 0,\n "shipDate" : "2000-01-23T04:56:07.000+00:00",\n "complete" : false,\n "status" : "placed"\n}'); - expectedResponse = SwagOrder.getExample(); - response = (SwagOrder) api.placeOrder(params); - System.assertEquals(expectedResponse, response); - } -} \ No newline at end of file diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApiTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApiTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagStoreApiTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagTag.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagTag.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagTag.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagTagTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagTagTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagTagTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUser.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagUser.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUser.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApi.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApi.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApi.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApiTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApiTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserApiTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwagUserTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwagUserTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/Swagger.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/Swagger.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/Swagger.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerResponseMock.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwaggerResponseMock.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerResponseMock.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/SwaggerTest.cls-meta.xml deleted file mode 100644 index 8b061c82b6..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/classes/SwaggerTest.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 39.0 - Active - diff --git a/samples/client/petstore/apex/force-app/main/default/namedCredentials/OpenAPI_Petstore.namedCredential b/samples/client/petstore/apex/force-app/main/default/namedCredentials/OpenAPI_Petstore.namedCredential-meta.xml similarity index 100% rename from samples/client/petstore/apex/force-app/main/default/namedCredentials/OpenAPI_Petstore.namedCredential rename to samples/client/petstore/apex/force-app/main/default/namedCredentials/OpenAPI_Petstore.namedCredential-meta.xml diff --git a/samples/client/petstore/apex/force-app/main/default/namedCredentials/Swagger_Petstore.namedCredential b/samples/client/petstore/apex/force-app/main/default/namedCredentials/Swagger_Petstore.namedCredential deleted file mode 100644 index e7d8d71ac1..0000000000 --- a/samples/client/petstore/apex/force-app/main/default/namedCredentials/Swagger_Petstore.namedCredential +++ /dev/null @@ -1,7 +0,0 @@ - - - http://petstore.swagger.io/v2 - Anonymous - NoAuthentication - - \ No newline at end of file diff --git a/samples/client/petstore/apex/git_push.sh b/samples/client/petstore/apex/git_push.sh deleted file mode 100644 index ed374619b1..0000000000 --- a/samples/client/petstore/apex/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/apex/sfdx-oss-manifest.json b/samples/client/petstore/apex/sfdx-oss-manifest.json deleted file mode 100644 index f63e2e3611..0000000000 --- a/samples/client/petstore/apex/sfdx-oss-manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "sfdxSource": true, - "version": "1.0.0", - "sourceFolder": "src/", - "folders": [ - "src/classes" - ], - "files": [ - ] -} \ No newline at end of file diff --git a/samples/client/petstore/apex/sfdx-project.json b/samples/client/petstore/apex/sfdx-project.json new file mode 100644 index 0000000000..e0fe2f7ab1 --- /dev/null +++ b/samples/client/petstore/apex/sfdx-project.json @@ -0,0 +1,11 @@ +{ + "packageDirectories": [ + { + "path": "force-app", + "default": true + } + ], + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "42.0" +} \ No newline at end of file diff --git a/samples/client/petstore/apex/undeploy/destructiveChanges.xml b/samples/client/petstore/apex/undeploy/destructiveChanges.xml deleted file mode 100644 index 9f53557956..0000000000 --- a/samples/client/petstore/apex/undeploy/destructiveChanges.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - Swagger Petstore API Client - Client library for calling the Swagger Petstore API. -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. -Generated with Swagger Codegen (github.com/swagger-api/swagger-codegen) - - SwagPetApi - SwagPetApiTest - SwagStoreApi - SwagStoreApiTest - SwagUserApi - SwagUserApiTest - SwagApiResponse - SwagApiResponseTest - SwagCategory - SwagCategoryTest - SwagOrder - SwagOrderTest - SwagPet - SwagPetTest - SwagTag - SwagTagTest - SwagUser - SwagUserTest - SwagClient - Swagger - SwaggerTest - SwaggerResponseMock - ApexClass - - - Swagger_Petstore - RemoteSiteSetting - - 39.0 - diff --git a/samples/client/petstore/apex/undeploy/package.xml b/samples/client/petstore/apex/undeploy/package.xml deleted file mode 100644 index 1f583b9fcb..0000000000 --- a/samples/client/petstore/apex/undeploy/package.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - Swag API Client - 39.0 - diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION index 096bf47efe..4395ff5923 100644 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/doc/Doxyfile b/samples/client/petstore/cpp-tizen/doc/Doxyfile index bbb92191a0..9a0ba8f718 100644 --- a/samples/client/petstore/cpp-tizen/doc/Doxyfile +++ b/samples/client/petstore/cpp-tizen/doc/Doxyfile @@ -46,7 +46,7 @@ PROJECT_NUMBER = 1.0.0 PROJECT_BRIEF = "An SDK for creating client applications for OpenAPI Petstore 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. diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index dde25ef08e..4395ff5923 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index dde25ef08e..4395ff5923 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 79673db9e3..610174ac2a 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -30,7 +30,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **Patch** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 1843427a4f..1ccb557da3 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -954,8 +954,8 @@ paths: - fake /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 7a8691ec37..cf9b1f9867 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -26,12 +26,12 @@ type AnotherFakeApiService service /* AnotherFakeApiService To test special tags -To test special tags +To test special tags and operation ID starting with number * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param client client model @return Client */ -func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} diff --git a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index ce9779af26..43c6323113 100644 --- a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -4,14 +4,14 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**TestSpecialTags**](AnotherFakeApi.md#TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags +[**Call123TestSpecialTags**](AnotherFakeApi.md#Call123TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags -# **TestSpecialTags** -> Client TestSpecialTags(ctx, client) +# **Call123TestSpecialTags** +> Client Call123TestSpecialTags(ctx, client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Required Parameters diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index e0b813f2a6..f41fb1dec4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -17,7 +17,7 @@ public interface AnotherFakeApi extends ApiClient.Api { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client */ @@ -26,5 +26,5 @@ public interface AnotherFakeApi extends ApiClient.Api { "Content-Type: application/json", "Accept: application/json", }) - Client testSpecialTags(Client client); + Client call123testSpecialTags(Client client); } diff --git a/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md b/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 4b52082378..ab532e8536 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -42,37 +42,37 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number *

200 - successful operation * @param client client model * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testSpecialTags(Client client) throws IOException { - HttpResponse response = testSpecialTagsForHttpResponse(client); + public Client call123testSpecialTags(Client client) throws IOException { + HttpResponse response = call123testSpecialTagsForHttpResponse(client); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number *

200 - successful operation * @param client client model * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return Client * @throws IOException if an error occurs while attempting to invoke the API **/ - public Client testSpecialTags(Client client, Map params) throws IOException { - HttpResponse response = testSpecialTagsForHttpResponse(client, params); + public Client call123testSpecialTags(Client client, Map params) throws IOException { + HttpResponse response = call123testSpecialTagsForHttpResponse(client, params); TypeReference typeRef = new TypeReference() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse testSpecialTagsForHttpResponse(Client client) throws IOException { + public HttpResponse call123testSpecialTagsForHttpResponse(Client client) throws IOException { // verify the required parameter 'client' is set if (client == null) { - throw new IllegalArgumentException("Missing the required parameter 'client' when calling testSpecialTags"); + throw new IllegalArgumentException("Missing the required parameter 'client' when calling call123testSpecialTags"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); @@ -83,10 +83,10 @@ public class AnotherFakeApi { return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testSpecialTagsForHttpResponse(java.io.InputStream client, String mediaType) throws IOException { + public HttpResponse call123testSpecialTagsForHttpResponse(java.io.InputStream client, String mediaType) throws IOException { // verify the required parameter 'client' is set if (client == null) { - throw new IllegalArgumentException("Missing the required parameter 'client' when calling testSpecialTags"); + throw new IllegalArgumentException("Missing the required parameter 'client' when calling call123testSpecialTags"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); @@ -99,10 +99,10 @@ public class AnotherFakeApi { return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); } - public HttpResponse testSpecialTagsForHttpResponse(Client client, Map params) throws IOException { + public HttpResponse call123testSpecialTagsForHttpResponse(Client client, Map params) throws IOException { // verify the required parameter 'client' is set if (client == null) { - throw new IllegalArgumentException("Missing the required parameter 'client' when calling testSpecialTags"); + throw new IllegalArgumentException("Missing the required parameter 'client' when calling call123testSpecialTags"); } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index cddd52987e..baebe15ab2 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws IOException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws IOException { + public void call123testSpecialTagsTest() throws IOException { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 895639d312..7d39d56b6c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -50,17 +50,17 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client client) throws ApiException { + public Client call123testSpecialTags(Client client) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 872fb60215..b6db8d2a2c 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws ApiException { + public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 66ce30be1d..2060f36dd2 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -37,28 +37,28 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client client) throws ApiException { - return testSpecialTagsWithHttpInfo(client).getData(); + public Client call123testSpecialTags(Client client) throws ApiException { + return call123testSpecialTagsWithHttpInfo(client).getData(); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 66ce30be1d..2060f36dd2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -37,28 +37,28 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client client) throws ApiException { - return testSpecialTagsWithHttpInfo(client).getData(); + public Client call123testSpecialTags(Client client) throws ApiException { + return call123testSpecialTagsWithHttpInfo(client).getData(); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 872fb60215..b6db8d2a2c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws ApiException { + public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 66ce30be1d..2060f36dd2 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -37,28 +37,28 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client client) throws ApiException { - return testSpecialTagsWithHttpInfo(client).getData(); + public Client call123testSpecialTags(Client client) throws ApiException { + return call123testSpecialTagsWithHttpInfo(client).getData(); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 872fb60215..b6db8d2a2c 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws ApiException { + public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 87fe1e5929..cb429b37da 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -55,14 +55,14 @@ public class AnotherFakeApi { } /** - * Build call for testSpecialTags + * Build call for call123testSpecialTags * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call call123testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = client; // create path and map variables @@ -104,53 +104,53 @@ public class AnotherFakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call call123testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'client' is set if (client == null) { - throw new ApiException("Missing the required parameter 'client' when calling testSpecialTags(Async)"); + throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)"); } - com.squareup.okhttp.Call call = testSpecialTagsCall(client, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = call123testSpecialTagsCall(client, progressListener, progressRequestListener); return call; } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testSpecialTags(Client client) throws ApiException { - ApiResponse resp = testSpecialTagsWithHttpInfo(client); + public Client call123testSpecialTags(Client client) throws ApiException { + ApiResponse resp = call123testSpecialTagsWithHttpInfo(client); return resp.getData(); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, null, null); + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = call123testSpecialTagsValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } /** * To test special tags (asynchronously) - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call call123testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,7 +171,7 @@ public class AnotherFakeApi { }; } - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = call123testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; diff --git a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 87fe1e5929..cb429b37da 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -55,14 +55,14 @@ public class AnotherFakeApi { } /** - * Build call for testSpecialTags + * Build call for call123testSpecialTags * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call call123testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = client; // create path and map variables @@ -104,53 +104,53 @@ public class AnotherFakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call call123testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'client' is set if (client == null) { - throw new ApiException("Missing the required parameter 'client' when calling testSpecialTags(Async)"); + throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)"); } - com.squareup.okhttp.Call call = testSpecialTagsCall(client, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = call123testSpecialTagsCall(client, progressListener, progressRequestListener); return call; } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public Client testSpecialTags(Client client) throws ApiException { - ApiResponse resp = testSpecialTagsWithHttpInfo(client); + public Client call123testSpecialTags(Client client) throws ApiException { + ApiResponse resp = call123testSpecialTagsWithHttpInfo(client); return resp.getData(); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, null, null); + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = call123testSpecialTagsValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } /** * To test special tags (asynchronously) - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call call123testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,7 +171,7 @@ public class AnotherFakeApi { }; } - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = call123testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 872fb60215..b6db8d2a2c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws ApiException { + public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md b/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md index a17009e27b..8ac4b3cb4d 100644 --- a/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/rest-assured/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -26,7 +26,7 @@ AnotherFakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSuppl () -> new RequestSpecBuilder() .setBaseUri("http://petstore.swagger.io:80/v2"))).anotherFake(); -api.testSpecialTags() +api.call123testSpecialTags() .body(client).execute(r -> r.prettyPeek()); ``` diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 06a01cb696..2cb316a26e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -47,8 +47,8 @@ public class AnotherFakeApi { } - public TestSpecialTagsOper testSpecialTags() { - return new TestSpecialTagsOper(reqSpec); + public Call123testSpecialTagsOper call123testSpecialTags() { + return new Call123testSpecialTagsOper(reqSpec); } /** @@ -63,27 +63,29 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * * @see #body client model (required) * return Client */ - public class TestSpecialTagsOper { + public class Call123testSpecialTagsOper { + public static final String REQ_METHOD = "PATCH"; public static final String REQ_URI = "/another-fake/dummy"; + public static final String SUMMARY = "To test special tags"; private RequestSpecBuilder reqSpec; private ResponseSpecBuilder respSpec; - public TestSpecialTagsOper() { + public Call123testSpecialTagsOper() { this.reqSpec = new RequestSpecBuilder(); reqSpec.setContentType("application/json"); reqSpec.setAccept("application/json"); this.respSpec = new ResponseSpecBuilder(); } - public TestSpecialTagsOper(RequestSpecBuilder reqSpec) { + public Call123testSpecialTagsOper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; reqSpec.setContentType("application/json"); reqSpec.setAccept("application/json"); @@ -114,7 +116,7 @@ public class AnotherFakeApi { * @param client (Client) client model (required) * @return operation */ - public TestSpecialTagsOper body(Client client) { + public Call123testSpecialTagsOper body(Client client) { reqSpec.setBody(client); return this; } @@ -124,7 +126,7 @@ public class AnotherFakeApi { * @param consumer consumer * @return operation */ - public TestSpecialTagsOper reqSpec(Consumer consumer) { + public Call123testSpecialTagsOper reqSpec(Consumer consumer) { consumer.accept(reqSpec); return this; } @@ -134,9 +136,9 @@ public class AnotherFakeApi { * @param consumer consumer * @return operation */ - public TestSpecialTagsOper respSpec(Consumer consumer) { + public Call123testSpecialTagsOper respSpec(Consumer consumer) { consumer.accept(respSpec); return this; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java index 2025922503..a56250e1ca 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java @@ -117,7 +117,9 @@ public class FakeApi { */ public class FakeOuterBooleanSerializeOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake/outer/boolean"; + public static final String SUMMARY = ""; private RequestSpecBuilder reqSpec; @@ -195,7 +197,9 @@ public class FakeApi { */ public class FakeOuterCompositeSerializeOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake/outer/composite"; + public static final String SUMMARY = ""; private RequestSpecBuilder reqSpec; @@ -273,7 +277,9 @@ public class FakeApi { */ public class FakeOuterNumberSerializeOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake/outer/number"; + public static final String SUMMARY = ""; private RequestSpecBuilder reqSpec; @@ -351,7 +357,9 @@ public class FakeApi { */ public class FakeOuterStringSerializeOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake/outer/string"; + public static final String SUMMARY = ""; private RequestSpecBuilder reqSpec; @@ -428,7 +436,9 @@ public class FakeApi { */ public class TestBodyWithFileSchemaOper { + public static final String REQ_METHOD = "PUT"; public static final String REQ_URI = "/fake/body-with-file-schema"; + public static final String SUMMARY = ""; private RequestSpecBuilder reqSpec; @@ -496,7 +506,9 @@ public class FakeApi { */ public class TestBodyWithQueryParamsOper { + public static final String REQ_METHOD = "PUT"; public static final String REQ_URI = "/fake/body-with-query-params"; + public static final String SUMMARY = ""; private RequestSpecBuilder reqSpec; @@ -575,7 +587,9 @@ public class FakeApi { */ public class TestClientModelOper { + public static final String REQ_METHOD = "PATCH"; public static final String REQ_URI = "/fake"; + public static final String SUMMARY = "To test \"client\" model"; private RequestSpecBuilder reqSpec; @@ -665,7 +679,9 @@ public class FakeApi { */ public class TestEndpointParametersOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake"; + public static final String SUMMARY = "Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íŠ¸ "; private RequestSpecBuilder reqSpec; @@ -884,7 +900,9 @@ public class FakeApi { */ public class TestEnumParametersOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/fake"; + public static final String SUMMARY = "To test enum parameters"; private RequestSpecBuilder reqSpec; @@ -917,7 +935,7 @@ public class FakeApi { public static final String ENUM_HEADER_STRING_ARRAY_HEADER = "enum_header_string_array"; /** - * @param enumHeaderStringArray (List<String>) Header parameter enum test (string array) (optional) + * @param enumHeaderStringArray (List) Header parameter enum test (string array) (optional) * @return operation */ public TestEnumParametersOper enumHeaderStringArrayHeader(String enumHeaderStringArray) { @@ -939,7 +957,7 @@ public class FakeApi { public static final String ENUM_QUERY_STRING_ARRAY_QUERY = "enum_query_string_array"; /** - * @param enumQueryStringArray (List<String>) Query parameter enum test (string array) (optional) + * @param enumQueryStringArray (List) Query parameter enum test (string array) (optional) * @return operation */ public TestEnumParametersOper enumQueryStringArrayQuery(Object... enumQueryStringArray) { @@ -983,7 +1001,7 @@ public class FakeApi { public static final String ENUM_FORM_STRING_ARRAY_FORM = "enum_form_string_array"; /** - * @param enumFormStringArray (List<String>) Form parameter enum test (string array) (optional, default to $) + * @param enumFormStringArray (List) Form parameter enum test (string array) (optional, default to $) * @return operation */ public TestEnumParametersOper enumFormStringArrayForm(Object... enumFormStringArray) { @@ -1030,7 +1048,9 @@ public class FakeApi { */ public class TestInlineAdditionalPropertiesOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake/inline-additionalProperties"; + public static final String SUMMARY = "test inline additionalProperties"; private RequestSpecBuilder reqSpec; @@ -1061,7 +1081,7 @@ public class FakeApi { } /** - * @param requestBody (Map<String, String>) request body (required) + * @param requestBody (Map) request body (required) * @return operation */ public TestInlineAdditionalPropertiesOper body(Map requestBody) { @@ -1098,7 +1118,9 @@ public class FakeApi { */ public class TestJsonFormDataOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/fake/jsonFormData"; + public static final String SUMMARY = "test json serialization of form data"; private RequestSpecBuilder reqSpec; @@ -1170,4 +1192,4 @@ public class FakeApi { return this; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 41f71b36e7..dab88d0ef9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -70,7 +70,9 @@ public class FakeClassnameTags123Api { */ public class TestClassnameOper { + public static final String REQ_METHOD = "PATCH"; public static final String REQ_URI = "/fake_classname_test"; + public static final String SUMMARY = "To test class name in snake case"; private RequestSpecBuilder reqSpec; @@ -139,4 +141,4 @@ public class FakeClassnameTags123Api { return this; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java index 6df8c7098d..508a67777f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java @@ -104,7 +104,9 @@ public class PetApi { */ public class AddPetOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/pet"; + public static final String SUMMARY = "Add a new pet to the store"; private RequestSpecBuilder reqSpec; @@ -172,7 +174,9 @@ public class PetApi { */ public class DeletePetOper { + public static final String REQ_METHOD = "DELETE"; public static final String REQ_URI = "/pet/{petId}"; + public static final String SUMMARY = "Deletes a pet"; private RequestSpecBuilder reqSpec; @@ -251,7 +255,9 @@ public class PetApi { */ public class FindPetsByStatusOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/pet/findByStatus"; + public static final String SUMMARY = "Finds Pets by status"; private RequestSpecBuilder reqSpec; @@ -292,7 +298,7 @@ public class PetApi { public static final String STATUS_QUERY = "status"; /** - * @param status (List<String>) Status values that need to be considered for filter (required) + * @param status (List) Status values that need to be considered for filter (required) * @return operation */ public FindPetsByStatusOper statusQuery(Object... status) { @@ -331,7 +337,9 @@ public class PetApi { @Deprecated public class FindPetsByTagsOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/pet/findByTags"; + public static final String SUMMARY = "Finds Pets by tags"; private RequestSpecBuilder reqSpec; @@ -372,7 +380,7 @@ public class PetApi { public static final String TAGS_QUERY = "tags"; /** - * @param tags (List<String>) Tags to filter by (required) + * @param tags (List) Tags to filter by (required) * @return operation */ public FindPetsByTagsOper tagsQuery(Object... tags) { @@ -409,7 +417,9 @@ public class PetApi { */ public class GetPetByIdOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/pet/{petId}"; + public static final String SUMMARY = "Find pet by ID"; private RequestSpecBuilder reqSpec; @@ -486,7 +496,9 @@ public class PetApi { */ public class UpdatePetOper { + public static final String REQ_METHOD = "PUT"; public static final String REQ_URI = "/pet"; + public static final String SUMMARY = "Update an existing pet"; private RequestSpecBuilder reqSpec; @@ -555,7 +567,9 @@ public class PetApi { */ public class UpdatePetWithFormOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/pet/{petId}"; + public static final String SUMMARY = "Updates a pet in the store with form data"; private RequestSpecBuilder reqSpec; @@ -649,7 +663,9 @@ public class PetApi { */ public class UploadFileOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/pet/{petId}/uploadImage"; + public static final String SUMMARY = "uploads an image"; private RequestSpecBuilder reqSpec; @@ -753,7 +769,9 @@ public class PetApi { */ public class UploadFileWithRequiredFileOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/fake/{petId}/uploadImageWithRequiredFile"; + public static final String SUMMARY = "uploads an image (required)"; private RequestSpecBuilder reqSpec; @@ -846,4 +864,4 @@ public class PetApi { return this; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java index b882613abc..85d22c9cc2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java @@ -81,7 +81,9 @@ public class StoreApi { */ public class DeleteOrderOper { + public static final String REQ_METHOD = "DELETE"; public static final String REQ_URI = "/store/order/{order_id}"; + public static final String SUMMARY = "Delete purchase order by ID"; private RequestSpecBuilder reqSpec; @@ -148,7 +150,9 @@ public class StoreApi { */ public class GetInventoryOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/store/inventory"; + public static final String SUMMARY = "Returns pet inventories by status"; private RequestSpecBuilder reqSpec; @@ -215,7 +219,9 @@ public class StoreApi { */ public class GetOrderByIdOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/store/order/{order_id}"; + public static final String SUMMARY = "Find purchase order by ID"; private RequestSpecBuilder reqSpec; @@ -293,7 +299,9 @@ public class StoreApi { */ public class PlaceOrderOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/store/order"; + public static final String SUMMARY = "Place an order for a pet"; private RequestSpecBuilder reqSpec; @@ -362,4 +370,4 @@ public class StoreApi { return this; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java index 5a7f3733db..4ed9d74750 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java @@ -97,7 +97,9 @@ public class UserApi { */ public class CreateUserOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/user"; + public static final String SUMMARY = "Create user"; private RequestSpecBuilder reqSpec; @@ -164,7 +166,9 @@ public class UserApi { */ public class CreateUsersWithArrayInputOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/user/createWithArray"; + public static final String SUMMARY = "Creates list of users with given input array"; private RequestSpecBuilder reqSpec; @@ -195,7 +199,7 @@ public class UserApi { } /** - * @param user (List<User>) List of user object (required) + * @param user (List) List of user object (required) * @return operation */ public CreateUsersWithArrayInputOper body(List user) { @@ -231,7 +235,9 @@ public class UserApi { */ public class CreateUsersWithListInputOper { + public static final String REQ_METHOD = "POST"; public static final String REQ_URI = "/user/createWithList"; + public static final String SUMMARY = "Creates list of users with given input array"; private RequestSpecBuilder reqSpec; @@ -262,7 +268,7 @@ public class UserApi { } /** - * @param user (List<User>) List of user object (required) + * @param user (List) List of user object (required) * @return operation */ public CreateUsersWithListInputOper body(List user) { @@ -298,7 +304,9 @@ public class UserApi { */ public class DeleteUserOper { + public static final String REQ_METHOD = "DELETE"; public static final String REQ_URI = "/user/{username}"; + public static final String SUMMARY = "Delete user"; private RequestSpecBuilder reqSpec; @@ -366,7 +374,9 @@ public class UserApi { */ public class GetUserByNameOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/user/{username}"; + public static final String SUMMARY = "Get user by user name"; private RequestSpecBuilder reqSpec; @@ -445,7 +455,9 @@ public class UserApi { */ public class LoginUserOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/user/login"; + public static final String SUMMARY = "Logs user into the system"; private RequestSpecBuilder reqSpec; @@ -532,7 +544,9 @@ public class UserApi { */ public class LogoutUserOper { + public static final String REQ_METHOD = "GET"; public static final String REQ_URI = "/user/logout"; + public static final String SUMMARY = "Logs out current logged in user session"; private RequestSpecBuilder reqSpec; @@ -589,7 +603,9 @@ public class UserApi { */ public class UpdateUserOper { + public static final String REQ_METHOD = "PUT"; public static final String REQ_URI = "/user/{username}"; + public static final String SUMMARY = "Updated user"; private RequestSpecBuilder reqSpec; @@ -659,4 +675,4 @@ public class UserApi { return this; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 59fd096f46..742dbac325 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -50,9 +50,9 @@ public class AnotherFakeApiTest { * successful operation */ @Test - public void shouldSee200AfterTestSpecialTags() { + public void shouldSee200AfterCall123testSpecialTags() { Client client = null; - api.testSpecialTags() + api.call123testSpecialTags() .body(client).execute(r -> r.prettyPeek()); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java index ce70332160..0373a272f6 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -14,6 +14,8 @@ package org.openapitools.client.api; import java.io.File; + +import io.restassured.response.ResponseBody; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import org.openapitools.client.ApiClient; diff --git a/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md b/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index fc5b6d8ac5..57fa4a98a8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -36,17 +36,17 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return a {@code Client} * @throws ApiException if fails to make API call */ - public Client testSpecialTags(Client client) throws ApiException { + public Client call123testSpecialTags(Client client) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } // create path and map variables diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 872fb60215..b6db8d2a2c 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws ApiException { + public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index e8829cf007..c1be2519f3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -40,6 +40,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -535,8 +537,15 @@ public class ApiClient { } builder.queryParams(queryParams); } + + URI uri; + try { + uri = new URI(builder.build().toUriString()); + } catch(URISyntaxException ex) { + throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); + } - final BodyBuilder requestBuilder = RequestEntity.method(method, builder.build().toUri()); + final BodyBuilder requestBuilder = RequestEntity.method(method, uri); if(accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 60adce2af9..08bbc033fb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -47,18 +47,18 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number *

200 - successful operation * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testSpecialTags(Client client) throws RestClientException { + public Client call123testSpecialTags(Client client) throws RestClientException { Object postBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling call123testSpecialTags"); } String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 627540e045..2953c8a0c0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -34,15 +34,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() { + public void call123testSpecialTagsTest() { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index ebb0a2b0f8..b2c42fc58a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -35,6 +35,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -530,8 +532,15 @@ public class ApiClient { } builder.queryParams(queryParams); } + + URI uri; + try { + uri = new URI(builder.build().toUriString()); + } catch(URISyntaxException ex) { + throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); + } - final BodyBuilder requestBuilder = RequestEntity.method(method, builder.build().toUri()); + final BodyBuilder requestBuilder = RequestEntity.method(method, uri); if(accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 60adce2af9..08bbc033fb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -47,18 +47,18 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number *

200 - successful operation * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Client testSpecialTags(Client client) throws RestClientException { + public Client call123testSpecialTags(Client client) throws RestClientException { Object postBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling call123testSpecialTags"); } String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 627540e045..2953c8a0c0 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -34,15 +34,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() { + public void call123testSpecialTagsTest() { Client client = null; - Client response = api.testSpecialTags(client); + Client response = api.call123testSpecialTags(client); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 2f3bc37b75..7a8dfbc3cd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -17,13 +17,13 @@ public interface AnotherFakeApi { /** * To test special tags * Sync method - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Client */ @PATCH("/another-fake/dummy") - Client testSpecialTags( + Client call123testSpecialTags( @retrofit.http.Body Client client ); @@ -35,7 +35,7 @@ public interface AnotherFakeApi { */ @PATCH("/another-fake/dummy") - void testSpecialTags( + void call123testSpecialTags( @retrofit.http.Body Client client, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md index fff646fef7..c44a064755 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index ae435c0897..2e7b01f055 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -24,7 +24,7 @@ import retrofit2.Response; public interface AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Call<Client> */ @@ -32,7 +32,7 @@ public interface AnotherFakeApi { "Content-Type:application/json" }) @PATCH("another-fake/dummy") - F.Promise> testSpecialTags( + F.Promise> call123testSpecialTags( @retrofit2.http.Body Client client ); diff --git a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md index fff646fef7..c44a064755 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5594221d7a..616c44b010 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -24,7 +24,7 @@ import retrofit2.Response; public interface AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Call<Client> */ @@ -32,7 +32,7 @@ public interface AnotherFakeApi { "Content-Type:application/json" }) @PATCH("another-fake/dummy") - CompletionStage> testSpecialTags( + CompletionStage> call123testSpecialTags( @retrofit2.http.Body Client client ); diff --git a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md index fff646fef7..c44a064755 100644 --- a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 4b2658c56f..043e214434 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -19,7 +19,7 @@ import java.util.Map; public interface AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Call<Client> */ @@ -27,7 +27,7 @@ public interface AnotherFakeApi { "Content-Type:application/json" }) @PATCH("another-fake/dummy") - Call testSpecialTags( + Call call123testSpecialTags( @retrofit2.http.Body Client client ); diff --git a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md index fff646fef7..c44a064755 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5099cb4959..482fbf1d50 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -19,7 +19,7 @@ import java.util.Map; public interface AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Observable<Client> */ @@ -27,7 +27,7 @@ public interface AnotherFakeApi { "Content-Type:application/json" }) @PATCH("another-fake/dummy") - Observable testSpecialTags( + Observable call123testSpecialTags( @retrofit2.http.Body Client client ); diff --git a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md index fff646fef7..c44a064755 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 1fb66b6aa3..81b821d019 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -20,7 +20,7 @@ import java.util.Map; public interface AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Observable<Client> */ @@ -28,7 +28,7 @@ public interface AnotherFakeApi { "Content-Type:application/json" }) @PATCH("another-fake/dummy") - Observable testSpecialTags( + Observable call123testSpecialTags( @retrofit2.http.Body Client client ); diff --git a/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md b/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index f6b151f1f9..e352608312 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -9,6 +9,6 @@ import java.util.*; public interface AnotherFakeApi { - void testSpecialTags(Client client, Handler> handler); + void call123testSpecialTags(Client client, Handler> handler); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java index 0dddf711be..b6d794b35c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java @@ -39,16 +39,16 @@ public class AnotherFakeApiImpl implements AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @param resultHandler Asynchronous result handler */ - public void testSpecialTags(Client client, Handler> resultHandler) { + public void call123testSpecialTags(Client client, Handler> resultHandler) { Object localVarBody = client; // verify the required parameter 'client' is set if (client == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'client' when calling testSpecialTags")); + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'client' when calling call123testSpecialTags")); return; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java index af9af97bda..28b6bcc6a0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java @@ -23,23 +23,23 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @param resultHandler Asynchronous result handler */ - public void testSpecialTags(Client client, Handler> resultHandler) { - delegate.testSpecialTags(client, resultHandler); + public void call123testSpecialTags(Client client, Handler> resultHandler) { + delegate.call123testSpecialTags(client, resultHandler); } /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * @param client client model (required) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestSpecialTags(Client client) { + public Single rxCall123testSpecialTags(Client client) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testSpecialTags(client, fut); + delegate.call123testSpecialTags(client, fut); })); } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index baf7f74d24..64da5ac36e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -59,15 +59,15 @@ public class AnotherFakeApiTest { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number * * @param context Vertx test context for doing assertions */ @Test - public void testSpecialTagsTest(TestContext context) { + public void call123testSpecialTagsTest(TestContext context) { Async async = context.async(); Client client = null; - api.testSpecialTags(client, result -> { + api.call123testSpecialTags(client, result -> { // TODO: test validations async.complete(); }); diff --git a/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md b/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md index edb115b793..a618e3928c 100644 --- a/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - -# **testSpecialTags** -> Client testSpecialTags(client) + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```java @@ -25,10 +25,10 @@ To test special tags AnotherFakeApi apiInstance = new AnotherFakeApi(); Client client = new Client(); // Client | client model try { - Client result = apiInstance.testSpecialTags(client); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); e.printStackTrace(); } ``` diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 3b5beefa97..2020fac4b5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -47,18 +47,18 @@ public class AnotherFakeApi { /** * To test special tags - * To test special tags + * To test special tags and operation ID starting with number *

200 - successful operation * @param client client model * @return Client * @throws RestClientException if an error occurs while attempting to invoke the API */ - public Mono testSpecialTags(Client client) throws RestClientException { + public Mono call123testSpecialTags(Client client) throws RestClientException { Object postBody = client; // verify the required parameter 'client' is set if (client == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testSpecialTags"); + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling call123testSpecialTags"); } String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 69ff923c8c..6f593f9144 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -35,15 +35,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() throws ApiException { + public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = api.testSpecialTags(client).block(); + Client response = api.call123testSpecialTags(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index ff30507fe7..481b9eb102 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -64,10 +64,10 @@ $apiInstance = new OpenAPI\Client\Api\AnotherFakeApi( $client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->testSpecialTags($client); + $result = $apiInstance->123testSpecialTags($client); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->123testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> @@ -79,7 +79,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**123testSpecialTags**](docs/Api/AnotherFakeApi.md#123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md index 9e4f59fce2..94e246084a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md @@ -4,15 +4,15 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**123testSpecialTags**](AnotherFakeApi.md#123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -# **testSpecialTags** -> \OpenAPI\Client\Model\Client testSpecialTags($client) +# **123testSpecialTags** +> \OpenAPI\Client\Model\Client 123testSpecialTags($client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```php @@ -27,10 +27,10 @@ $apiInstance = new OpenAPI\Client\Api\AnotherFakeApi( $client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->testSpecialTags($client); + $result = $apiInstance->123testSpecialTags($client); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->123testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index ec80b36cda..f1f5c23d5d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -88,7 +88,7 @@ class AnotherFakeApi } /** - * Operation testSpecialTags + * Operation 123testSpecialTags * * To test special tags * @@ -98,14 +98,14 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function testSpecialTags($client) + public function 123testSpecialTags($client) { - list($response) = $this->testSpecialTagsWithHttpInfo($client); + list($response) = $this->123testSpecialTagsWithHttpInfo($client); return $response; } /** - * Operation testSpecialTagsWithHttpInfo + * Operation 123testSpecialTagsWithHttpInfo * * To test special tags * @@ -115,9 +115,9 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function testSpecialTagsWithHttpInfo($client) + public function 123testSpecialTagsWithHttpInfo($client) { - $request = $this->testSpecialTagsRequest($client); + $request = $this->123testSpecialTagsRequest($client); try { $options = $this->createHttpClientOption(); @@ -199,7 +199,7 @@ class AnotherFakeApi } /** - * Operation testSpecialTagsAsync + * Operation 123testSpecialTagsAsync * * To test special tags * @@ -208,9 +208,9 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testSpecialTagsAsync($client) + public function 123testSpecialTagsAsync($client) { - return $this->testSpecialTagsAsyncWithHttpInfo($client) + return $this->123testSpecialTagsAsyncWithHttpInfo($client) ->then( function ($response) { return $response[0]; @@ -219,7 +219,7 @@ class AnotherFakeApi } /** - * Operation testSpecialTagsAsyncWithHttpInfo + * Operation 123testSpecialTagsAsyncWithHttpInfo * * To test special tags * @@ -228,10 +228,10 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testSpecialTagsAsyncWithHttpInfo($client) + public function 123testSpecialTagsAsyncWithHttpInfo($client) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testSpecialTagsRequest($client); + $request = $this->123testSpecialTagsRequest($client); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -271,19 +271,19 @@ class AnotherFakeApi } /** - * Create request for operation 'testSpecialTags' + * Create request for operation '123testSpecialTags' * * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testSpecialTagsRequest($client) + protected function 123testSpecialTagsRequest($client) { // verify the required parameter 'client' is set if ($client === null || (is_array($client) && count($client) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $client when calling testSpecialTags' + 'Missing the required parameter $client when calling 123testSpecialTags' ); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index cdec25a249..e9dbe2f313 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -72,12 +72,12 @@ class AnotherFakeApiTest extends \PHPUnit_Framework_TestCase } /** - * Test case for testSpecialTags + * Test case for 123testSpecialTags * * To test special tags. * */ - public function testTestSpecialTags() + public function test123testSpecialTags() { } } diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index dde25ef08e..4395ff5923 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/.rubocop.yml b/samples/client/petstore/ruby/.rubocop.yml index 9bc9d341d8..98c7e3c7e5 100644 --- a/samples/client/petstore/ruby/.rubocop.yml +++ b/samples/client/petstore/ruby/.rubocop.yml @@ -136,7 +136,7 @@ Style/UnneededPercentQ: # Align `end` with the matching keyword or starting expression except for # assignments, where it should be aligned with the LHS. -Lint/EndAlignment: +Layout/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable AutoCorrect: true diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 62ce92438f..0bc344953b 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -59,10 +59,10 @@ client = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.test_special_tags(client) + result = api_instance.call_123_test_special_tags(client) p result rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->test_special_tags: #{e}" + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" end ``` @@ -73,7 +73,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*Petstore::AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md index da2d5ff0b1..2d4891e066 100644 --- a/samples/client/petstore/ruby/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -4,15 +4,15 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -# **test_special_tags** -> Client test_special_tags(client) +# **call_123_test_special_tags** +> Client call_123_test_special_tags(client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```ruby @@ -24,10 +24,10 @@ client = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.test_special_tags(client) + result = api_instance.call_123_test_special_tags(client) p result rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->test_special_tags: #{e}" + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" end ``` diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index b7dc156c0c..ef152a3bd0 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -20,27 +20,27 @@ module Petstore @api_client = api_client end # To test special tags - # To test special tags + # To test special tags and operation ID starting with number # @param client client model # @param [Hash] opts the optional parameters # @return [Client] - def test_special_tags(client, opts = {}) - data, _status_code, _headers = test_special_tags_with_http_info(client, opts) + def call_123_test_special_tags(client, opts = {}) + data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) data end # To test special tags - # To test special tags + # To test special tags and operation ID starting with number # @param client client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers - def test_special_tags_with_http_info(client, opts = {}) + def call_123_test_special_tags_with_http_info(client, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AnotherFakeApi.test_special_tags ...' + @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.test_special_tags" + fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" end # resource path local_var_path = '/another-fake/dummy' @@ -69,7 +69,7 @@ module Petstore :auth_names => auth_names, :return_type => 'Client') if @api_client.config.debugging - @api_client.config.logger.debug "API called: AnotherFakeApi#test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 2a0851e3ea..8de2c60ca7 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -244,7 +244,7 @@ module Petstore tempfile.write(chunk) end request.on_complete do |response| - tempfile.close + tempfile.close if tempfile @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ "will be deleted automatically with GC. It's also recommended to delete the temp file "\ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md index ff30507fe7..481b9eb102 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md @@ -64,10 +64,10 @@ $apiInstance = new OpenAPI\Client\Api\AnotherFakeApi( $client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->testSpecialTags($client); + $result = $apiInstance->123testSpecialTags($client); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->123testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> @@ -79,7 +79,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**123testSpecialTags**](docs/Api/AnotherFakeApi.md#123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md index 9e4f59fce2..94e246084a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md @@ -4,15 +4,15 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**123testSpecialTags**](AnotherFakeApi.md#123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -# **testSpecialTags** -> \OpenAPI\Client\Model\Client testSpecialTags($client) +# **123testSpecialTags** +> \OpenAPI\Client\Model\Client 123testSpecialTags($client) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example ```php @@ -27,10 +27,10 @@ $apiInstance = new OpenAPI\Client\Api\AnotherFakeApi( $client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->testSpecialTags($client); + $result = $apiInstance->123testSpecialTags($client); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->123testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index ec80b36cda..f1f5c23d5d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -88,7 +88,7 @@ class AnotherFakeApi } /** - * Operation testSpecialTags + * Operation 123testSpecialTags * * To test special tags * @@ -98,14 +98,14 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function testSpecialTags($client) + public function 123testSpecialTags($client) { - list($response) = $this->testSpecialTagsWithHttpInfo($client); + list($response) = $this->123testSpecialTagsWithHttpInfo($client); return $response; } /** - * Operation testSpecialTagsWithHttpInfo + * Operation 123testSpecialTagsWithHttpInfo * * To test special tags * @@ -115,9 +115,9 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function testSpecialTagsWithHttpInfo($client) + public function 123testSpecialTagsWithHttpInfo($client) { - $request = $this->testSpecialTagsRequest($client); + $request = $this->123testSpecialTagsRequest($client); try { $options = $this->createHttpClientOption(); @@ -199,7 +199,7 @@ class AnotherFakeApi } /** - * Operation testSpecialTagsAsync + * Operation 123testSpecialTagsAsync * * To test special tags * @@ -208,9 +208,9 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testSpecialTagsAsync($client) + public function 123testSpecialTagsAsync($client) { - return $this->testSpecialTagsAsyncWithHttpInfo($client) + return $this->123testSpecialTagsAsyncWithHttpInfo($client) ->then( function ($response) { return $response[0]; @@ -219,7 +219,7 @@ class AnotherFakeApi } /** - * Operation testSpecialTagsAsyncWithHttpInfo + * Operation 123testSpecialTagsAsyncWithHttpInfo * * To test special tags * @@ -228,10 +228,10 @@ class AnotherFakeApi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testSpecialTagsAsyncWithHttpInfo($client) + public function 123testSpecialTagsAsyncWithHttpInfo($client) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testSpecialTagsRequest($client); + $request = $this->123testSpecialTagsRequest($client); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -271,19 +271,19 @@ class AnotherFakeApi } /** - * Create request for operation 'testSpecialTags' + * Create request for operation '123testSpecialTags' * * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testSpecialTagsRequest($client) + protected function 123testSpecialTagsRequest($client) { // verify the required parameter 'client' is set if ($client === null || (is_array($client) && count($client) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $client when calling testSpecialTags' + 'Missing the required parameter $client when calling 123testSpecialTags' ); } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index cdec25a249..e9dbe2f313 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -72,12 +72,12 @@ class AnotherFakeApiTest extends \PHPUnit_Framework_TestCase } /** - * Test case for testSpecialTags + * Test case for 123testSpecialTags * * To test special tags. * */ - public function testTestSpecialTags() + public function test123testSpecialTags() { } } diff --git a/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION b/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION index dde25ef08e..0f58aa0414 100644 --- a/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +3.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/php-slim/README.md b/samples/server/petstore-security-test/php-slim/README.md index 4f701ed192..8a2df551ce 100644 --- a/samples/server/petstore-security-test/php-slim/README.md +++ b/samples/server/petstore-security-test/php-slim/README.md @@ -7,4 +7,6 @@ is an example of building a PHP Slim server. This example uses the [Slim Framework](http://www.slimframework.com/). To see how to make this your own, please take a look at the template here: -[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/slim/) +[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/php-slim-server/) + +## Authentication diff --git a/samples/server/petstore-security-test/php-slim/composer.json b/samples/server/petstore-security-test/php-slim/composer.json index 7509c8ea95..ca19917902 100644 --- a/samples/server/petstore-security-test/php-slim/composer.json +++ b/samples/server/petstore-security-test/php-slim/composer.json @@ -2,7 +2,8 @@ "minimum-stability": "RC", "require": { "php": ">=5.5", - "slim/slim": "3.*" + "slim/slim": "3.*", + "tuupola/slim-basic-auth": "^3.0.0" }, "require-dev": { "phpunit/phpunit": "^4.8" diff --git a/samples/server/petstore-security-test/php-slim/index.php b/samples/server/petstore-security-test/php-slim/index.php index 434e9dd801..9cc64c9486 100644 --- a/samples/server/petstore-security-test/php-slim/index.php +++ b/samples/server/petstore-security-test/php-slim/index.php @@ -1,7 +1,7 @@ PUT('/ ' \" =end -- \\r\\n \\n \\r/v2 ' \" =end -- \\r\\n \\n \\r/fake', FakeApi::class . ':testCodeInjectEndRnNR'); + $basicAuth = new HttpBasicAuthentication([ + "secure" => false, + "authenticator" => function ($arguments) { + $user = $arguments["user"]; + $password = $arguments["password"]; + return false; + } + ]); + + $app->PUT( + '/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r/fake', FakeApi::class . ':testCodeInjectEndRnNR' + ); $this->slimApp = $app; } diff --git a/samples/server/petstore-security-test/php-slim/phpunit.xml.dist b/samples/server/petstore-security-test/php-slim/phpunit.xml.dist index a9fd1a3ad4..93af3ee9b1 100644 --- a/samples/server/petstore-security-test/php-slim/phpunit.xml.dist +++ b/samples/server/petstore-security-test/php-slim/phpunit.xml.dist @@ -11,16 +11,16 @@ > - .\test\Api + ./test/Api - .\test\Model + ./test/Model - .\lib\Api - .\lib\Model + ./lib//Api + ./lib//Model \ No newline at end of file diff --git a/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php b/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php index 8a920bba2f..3205216ec9 100644 --- a/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php +++ b/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php @@ -10,11 +10,11 @@ */ /** - * OpenAPI Petstore ' \" =end -- \\r\\n \\n \\r + * OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end -- - * OpenAPI spec version: 1.0.0 ' \" =end -- \\r\\n \\n \\r - * Contact: something@something.abc ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -70,7 +70,7 @@ class FakeApiTest extends \PHPUnit_Framework_TestCase { /** * Test case for testCodeInjectEndRnNR * - * To test code injection ' \" =end -- \\r\\n \\n \\r. + * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r. * @covers ::testCodeInjectEndRnNR */ public function testTestCodeInjectEndRnNR() { diff --git a/samples/server/petstore-security-test/php-slim/test/Model/ModelReturnTest.php b/samples/server/petstore-security-test/php-slim/test/Model/ModelReturnTest.php index 87f2cf6abf..d535c902fc 100644 --- a/samples/server/petstore-security-test/php-slim/test/Model/ModelReturnTest.php +++ b/samples/server/petstore-security-test/php-slim/test/Model/ModelReturnTest.php @@ -10,11 +10,11 @@ */ /** - * OpenAPI Petstore ' \" =end -- \\r\\n \\n \\r + * OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end -- - * OpenAPI spec version: 1.0.0 ' \" =end -- \\r\\n \\n \\r - * Contact: something@something.abc ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,7 +31,7 @@ use OpenAPIServer\Model\ModelReturn; * ModelReturnTest Class Doc Comment * * @category Class - * @description Model for testing reserved words ' \" =end -- \\r\\n \\n \\r + * @description Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r * @package OpenAPIServer\Model * @author OpenAPI Generator team * @link https://github.com/openapitools/openapi-generator diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp index 2625861ec4..e45ee72870 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp @@ -133,10 +133,8 @@ void ApiRouter::setUpRoutes() { void ApiRouter::processRequest(QHttpEngine::Socket *socket){ if (Routes.contains(socket->path())) { - auto itr = Routes.find(socket->path()); - while (itr != Routes.end() && itr.key() == socket->path()) { - itr.value().operator()(socket); - ++itr; + for(auto endpoints : Routes.values(socket->path())) { + endpoints.operator()(socket); } } else { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h index 95d08bb89b..8a7ac9d02c 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -#ifndef _OAI_OAIPetApiHandler_H_ -#define _OAI_OAIPetApiHandler_H_ +#ifndef OAI_OAIPetApiHandler_H +#define OAI_OAIPetApiHandler_H #include @@ -46,4 +46,4 @@ public slots: } -#endif // _OAI_OAIPetApiHandler_H_ +#endif // OAI_OAIPetApiHandler_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h index c0b1d3814d..791ca0b63b 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -#ifndef _OAI_OAIStoreApiHandler_H_ -#define _OAI_OAIStoreApiHandler_H_ +#ifndef OAI_OAIStoreApiHandler_H +#define OAI_OAIStoreApiHandler_H #include @@ -41,4 +41,4 @@ public slots: } -#endif // _OAI_OAIStoreApiHandler_H_ +#endif // OAI_OAIStoreApiHandler_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h index 2f43980d87..6cce891da6 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -#ifndef _OAI_OAIUserApiHandler_H_ -#define _OAI_OAIUserApiHandler_H_ +#ifndef OAI_OAIUserApiHandler_H +#define OAI_OAIUserApiHandler_H #include @@ -45,4 +45,4 @@ public slots: } -#endif // _OAI_OAIUserApiHandler_H_ +#endif // OAI_OAIUserApiHandler_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp index daa01fcf21..db0590c4ed 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp @@ -83,6 +83,7 @@ int main(int argc, char * argv[]) QSharedPointer handler(new OpenAPI::RequestHandler()); OpenAPI::ApiRouter router; + router.setUpRoutes(); QObject::connect(handler.data(), &OpenAPI::RequestHandler::requestReceived, [&](QHttpEngine::Socket *socket) { router.processRequest(socket); }); diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp index 8a65e8f339..7bba2a9468 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp @@ -83,7 +83,7 @@ OAIApiResponse::asJsonObject() const { } qint32 -OAIApiResponse::getCode() { +OAIApiResponse::getCode() const { return code; } void @@ -93,7 +93,7 @@ OAIApiResponse::setCode(const qint32 &code) { } QString -OAIApiResponse::getType() { +OAIApiResponse::getType() const { return type; } void @@ -103,7 +103,7 @@ OAIApiResponse::setType(const QString &type) { } QString -OAIApiResponse::getMessage() { +OAIApiResponse::getMessage() const { return message; } void diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h index 1fc574e0b3..144c0c4029 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h @@ -16,8 +16,8 @@ * Describes the result of uploading an image resource */ -#ifndef OAIApiResponse_H_ -#define OAIApiResponse_H_ +#ifndef OAIApiResponse_H +#define OAIApiResponse_H #include @@ -40,13 +40,13 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; - qint32 getCode(); + qint32 getCode() const; void setCode(const qint32 &code); - QString getType(); + QString getType() const; void setType(const QString &type); - QString getMessage(); + QString getMessage() const; void setMessage(const QString &message); virtual bool isSet() const override; @@ -65,4 +65,4 @@ private: } -#endif /* OAIApiResponse_H_ */ +#endif // OAIApiResponse_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp index 65fe716676..c70d263a5a 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp @@ -77,7 +77,7 @@ OAICategory::asJsonObject() const { } qint64 -OAICategory::getId() { +OAICategory::getId() const { return id; } void @@ -87,7 +87,7 @@ OAICategory::setId(const qint64 &id) { } QString -OAICategory::getName() { +OAICategory::getName() const { return name; } void diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h index bd84895cf5..027d83c6db 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h @@ -16,8 +16,8 @@ * A category for a pet */ -#ifndef OAICategory_H_ -#define OAICategory_H_ +#ifndef OAICategory_H +#define OAICategory_H #include @@ -40,10 +40,10 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; - qint64 getId(); + qint64 getId() const; void setId(const qint64 &id); - QString getName(); + QString getName() const; void setName(const QString &name); virtual bool isSet() const override; @@ -59,4 +59,4 @@ private: } -#endif /* OAICategory_H_ */ +#endif // OAICategory_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h index 77722b8294..0172e95377 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h @@ -37,23 +37,17 @@ namespace OpenAPI { QString toStringValue(const double &value); template - QList toStringValue(const QList &val) { - QList strArray; + QString toStringValue(const QList &val) { + QString strArray; for(auto item : val) { - strArray.append(toStringValue(item)); + strArray.append(toStringValue(item) + ","); + } + if(val.count() > 0) { + strArray.chop(1); } return strArray; } - template - QMap toStringValue(const QMap &val) { - QMap strMap; - for(auto itemkey : val.keys()) { - strMap.insert(itemkey, toStringValue(val.value(itemkey))); - } - return strMap; - } - QJsonValue toJsonValue(const QString &value); QJsonValue toJsonValue(const QDateTime &value); QJsonValue toJsonValue(const QByteArray &value); diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp index a022d5e643..7afaa063a2 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp @@ -101,7 +101,7 @@ OAIOrder::asJsonObject() const { } qint64 -OAIOrder::getId() { +OAIOrder::getId() const { return id; } void @@ -111,7 +111,7 @@ OAIOrder::setId(const qint64 &id) { } qint64 -OAIOrder::getPetId() { +OAIOrder::getPetId() const { return pet_id; } void @@ -121,7 +121,7 @@ OAIOrder::setPetId(const qint64 &pet_id) { } qint32 -OAIOrder::getQuantity() { +OAIOrder::getQuantity() const { return quantity; } void @@ -131,7 +131,7 @@ OAIOrder::setQuantity(const qint32 &quantity) { } QDateTime -OAIOrder::getShipDate() { +OAIOrder::getShipDate() const { return ship_date; } void @@ -141,7 +141,7 @@ OAIOrder::setShipDate(const QDateTime &ship_date) { } QString -OAIOrder::getStatus() { +OAIOrder::getStatus() const { return status; } void @@ -151,7 +151,7 @@ OAIOrder::setStatus(const QString &status) { } bool -OAIOrder::isComplete() { +OAIOrder::isComplete() const { return complete; } void diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h index 6eb1bc9ce6..561aebd8a4 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h @@ -16,8 +16,8 @@ * An order for a pets from the pet store */ -#ifndef OAIOrder_H_ -#define OAIOrder_H_ +#ifndef OAIOrder_H +#define OAIOrder_H #include @@ -41,22 +41,22 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; - qint64 getId(); + qint64 getId() const; void setId(const qint64 &id); - qint64 getPetId(); + qint64 getPetId() const; void setPetId(const qint64 &pet_id); - qint32 getQuantity(); + qint32 getQuantity() const; void setQuantity(const qint32 &quantity); - QDateTime getShipDate(); + QDateTime getShipDate() const; void setShipDate(const QDateTime &ship_date); - QString getStatus(); + QString getStatus() const; void setStatus(const QString &status); - bool isComplete(); + bool isComplete() const; void setComplete(const bool &complete); virtual bool isSet() const override; @@ -84,4 +84,4 @@ private: } -#endif /* OAIOrder_H_ */ +#endif // OAIOrder_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp index 2f36b66a30..97cb339915 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp @@ -103,7 +103,7 @@ OAIPet::asJsonObject() const { } qint64 -OAIPet::getId() { +OAIPet::getId() const { return id; } void @@ -113,7 +113,7 @@ OAIPet::setId(const qint64 &id) { } OAICategory -OAIPet::getCategory() { +OAIPet::getCategory() const { return category; } void @@ -123,7 +123,7 @@ OAIPet::setCategory(const OAICategory &category) { } QString -OAIPet::getName() { +OAIPet::getName() const { return name; } void @@ -133,7 +133,7 @@ OAIPet::setName(const QString &name) { } QList -OAIPet::getPhotoUrls() { +OAIPet::getPhotoUrls() const { return photo_urls; } void @@ -143,7 +143,7 @@ OAIPet::setPhotoUrls(const QList &photo_urls) { } QList -OAIPet::getTags() { +OAIPet::getTags() const { return tags; } void @@ -153,7 +153,7 @@ OAIPet::setTags(const QList &tags) { } QString -OAIPet::getStatus() { +OAIPet::getStatus() const { return status; } void diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h index b301f02c47..948040eb1e 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h @@ -16,8 +16,8 @@ * A pet for sale in the pet store */ -#ifndef OAIPet_H_ -#define OAIPet_H_ +#ifndef OAIPet_H +#define OAIPet_H #include @@ -43,22 +43,22 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; - qint64 getId(); + qint64 getId() const; void setId(const qint64 &id); - OAICategory getCategory(); + OAICategory getCategory() const; void setCategory(const OAICategory &category); - QString getName(); + QString getName() const; void setName(const QString &name); - QList getPhotoUrls(); + QList getPhotoUrls() const; void setPhotoUrls(const QList &photo_urls); - QList getTags(); + QList getTags() const; void setTags(const QList &tags); - QString getStatus(); + QString getStatus() const; void setStatus(const QString &status); virtual bool isSet() const override; @@ -86,4 +86,4 @@ private: } -#endif /* OAIPet_H_ */ +#endif // OAIPet_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp index 05343cb5e7..e8f1a69972 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp @@ -77,7 +77,7 @@ OAITag::asJsonObject() const { } qint64 -OAITag::getId() { +OAITag::getId() const { return id; } void @@ -87,7 +87,7 @@ OAITag::setId(const qint64 &id) { } QString -OAITag::getName() { +OAITag::getName() const { return name; } void diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h index 7e8dace76c..c6deb9cfef 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h @@ -16,8 +16,8 @@ * A tag for a pet */ -#ifndef OAITag_H_ -#define OAITag_H_ +#ifndef OAITag_H +#define OAITag_H #include @@ -40,10 +40,10 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; - qint64 getId(); + qint64 getId() const; void setId(const qint64 &id); - QString getName(); + QString getName() const; void setName(const QString &name); virtual bool isSet() const override; @@ -59,4 +59,4 @@ private: } -#endif /* OAITag_H_ */ +#endif // OAITag_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp index 3a904b343c..375c8b3220 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp @@ -113,7 +113,7 @@ OAIUser::asJsonObject() const { } qint64 -OAIUser::getId() { +OAIUser::getId() const { return id; } void @@ -123,7 +123,7 @@ OAIUser::setId(const qint64 &id) { } QString -OAIUser::getUsername() { +OAIUser::getUsername() const { return username; } void @@ -133,7 +133,7 @@ OAIUser::setUsername(const QString &username) { } QString -OAIUser::getFirstName() { +OAIUser::getFirstName() const { return first_name; } void @@ -143,7 +143,7 @@ OAIUser::setFirstName(const QString &first_name) { } QString -OAIUser::getLastName() { +OAIUser::getLastName() const { return last_name; } void @@ -153,7 +153,7 @@ OAIUser::setLastName(const QString &last_name) { } QString -OAIUser::getEmail() { +OAIUser::getEmail() const { return email; } void @@ -163,7 +163,7 @@ OAIUser::setEmail(const QString &email) { } QString -OAIUser::getPassword() { +OAIUser::getPassword() const { return password; } void @@ -173,7 +173,7 @@ OAIUser::setPassword(const QString &password) { } QString -OAIUser::getPhone() { +OAIUser::getPhone() const { return phone; } void @@ -183,7 +183,7 @@ OAIUser::setPhone(const QString &phone) { } qint32 -OAIUser::getUserStatus() { +OAIUser::getUserStatus() const { return user_status; } void diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h index 495cd88fa7..fce595439c 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h @@ -16,8 +16,8 @@ * A User who is purchasing from the pet store */ -#ifndef OAIUser_H_ -#define OAIUser_H_ +#ifndef OAIUser_H +#define OAIUser_H #include @@ -40,28 +40,28 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; - qint64 getId(); + qint64 getId() const; void setId(const qint64 &id); - QString getUsername(); + QString getUsername() const; void setUsername(const QString &username); - QString getFirstName(); + QString getFirstName() const; void setFirstName(const QString &first_name); - QString getLastName(); + QString getLastName() const; void setLastName(const QString &last_name); - QString getEmail(); + QString getEmail() const; void setEmail(const QString &email); - QString getPassword(); + QString getPassword() const; void setPassword(const QString &password); - QString getPhone(); + QString getPhone() const; void setPhone(const QString &phone); - qint32 getUserStatus(); + qint32 getUserStatus() const; void setUserStatus(const qint32 &user_status); virtual bool isSet() const override; @@ -95,4 +95,4 @@ private: } -#endif /* OAIUser_H_ */ +#endif // OAIUser_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp index 8f619d3351..1a5953e78b 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp @@ -22,6 +22,10 @@ namespace OpenAPI { OAIPetApiRequest::OAIPetApiRequest(QHttpEngine::Socket *s, OAIPetApiHandler* hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } } OAIPetApiRequest::~OAIPetApiRequest(){ @@ -30,10 +34,17 @@ OAIPetApiRequest::~OAIPetApiRequest(){ } QMap -OAIPetApiRequest::getDefaultHeaders(){ - return defaultHeaders; +OAIPetApiRequest::getRequestHeaders() const { + return requestHeaders; } +void OAIPetApiRequest::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + QHttpEngine::Socket* OAIPetApiRequest::getRawSocket(){ return socket; } @@ -56,7 +67,7 @@ void OAIPetApiRequest::addPetRequest(){ } -void OAIPetApiRequest::deletePetRequest(QString pet_idstr){ +void OAIPetApiRequest::deletePetRequest(const QString& pet_idstr){ qDebug() << "/v2/pet/{petId}"; connect(this, &OAIPetApiRequest::deletePet, handler, &OAIPetApiHandler::deletePet); @@ -106,7 +117,7 @@ void OAIPetApiRequest::findPetsByTagsRequest(){ } -void OAIPetApiRequest::getPetByIdRequest(QString pet_idstr){ +void OAIPetApiRequest::getPetByIdRequest(const QString& pet_idstr){ qDebug() << "/v2/pet/{petId}"; connect(this, &OAIPetApiRequest::getPetById, handler, &OAIPetApiHandler::getPetById); @@ -136,7 +147,7 @@ void OAIPetApiRequest::updatePetRequest(){ } -void OAIPetApiRequest::updatePetWithFormRequest(QString pet_idstr){ +void OAIPetApiRequest::updatePetWithFormRequest(const QString& pet_idstr){ qDebug() << "/v2/pet/{petId}"; connect(this, &OAIPetApiRequest::updatePetWithForm, handler, &OAIPetApiHandler::updatePetWithForm); @@ -151,7 +162,7 @@ void OAIPetApiRequest::updatePetWithFormRequest(QString pet_idstr){ } -void OAIPetApiRequest::uploadFileRequest(QString pet_idstr){ +void OAIPetApiRequest::uploadFileRequest(const QString& pet_idstr){ qDebug() << "/v2/pet/{petId}/uploadImage"; connect(this, &OAIPetApiRequest::uploadFile, handler, &OAIPetApiHandler::uploadFile); @@ -168,137 +179,167 @@ void OAIPetApiRequest::uploadFileRequest(QString pet_idstr){ void OAIPetApiRequest::addPetResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIPetApiRequest::deletePetResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::findPetsByStatusResponse(QList res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIPetApiRequest::findPetsByStatusResponse(const QList& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::findPetsByTagsResponse(QList res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIPetApiRequest::findPetsByTagsResponse(const QList& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::getPetByIdResponse(OAIPet res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIPetApiRequest::getPetByIdResponse(const OAIPet& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIPetApiRequest::updatePetResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIPetApiRequest::updatePetWithFormResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::uploadFileResponse(OAIApiResponse res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIPetApiRequest::uploadFileResponse(const OAIApiResponse& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } void OAIPetApiRequest::addPetError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIPetApiRequest::deletePetError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::findPetsByStatusError(QList res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIPetApiRequest::findPetsByStatusError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::findPetsByTagsError(QList res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIPetApiRequest::findPetsByTagsError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::getPetByIdError(OAIPet res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIPetApiRequest::getPetByIdError(const OAIPet& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIPetApiRequest::updatePetError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIPetApiRequest::updatePetWithFormError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIPetApiRequest::uploadFileError(OAIApiResponse res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIPetApiRequest::uploadFileError(const OAIApiResponse& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } - +void OAIPetApiRequest::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} + +void OAIPetApiRequest::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h index 1d1b0032b8..aba7871567 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h @@ -10,11 +10,12 @@ * Do not edit the class manually. */ -#ifndef _OAI_OAIPetApiRequest_H_ -#define _OAI_OAIPetApiRequest_H_ +#ifndef OAI_OAIPetApiRequest_H +#define OAI_OAIPetApiRequest_H #include #include +#include #include #include @@ -36,38 +37,45 @@ public: virtual ~OAIPetApiRequest(); void addPetRequest(); - void deletePetRequest(QString pet_id); + void deletePetRequest(const QString& pet_id); void findPetsByStatusRequest(); void findPetsByTagsRequest(); - void getPetByIdRequest(QString pet_id); + void getPetByIdRequest(const QString& pet_id); void updatePetRequest(); - void updatePetWithFormRequest(QString pet_id); - void uploadFileRequest(QString pet_id); + void updatePetWithFormRequest(const QString& pet_id); + void uploadFileRequest(const QString& pet_id); void addPetResponse(); void deletePetResponse(); - void findPetsByStatusResponse(QList res); - void findPetsByTagsResponse(QList res); - void getPetByIdResponse(OAIPet res); + void findPetsByStatusResponse(const QList& res); + void findPetsByTagsResponse(const QList& res); + void getPetByIdResponse(const OAIPet& res); void updatePetResponse(); void updatePetWithFormResponse(); - void uploadFileResponse(OAIApiResponse res); + void uploadFileResponse(const OAIApiResponse& res); void addPetError(QNetworkReply::NetworkError error_type, QString& error_str); void deletePetError(QNetworkReply::NetworkError error_type, QString& error_str); - void findPetsByStatusError(QList res, QNetworkReply::NetworkError error_type, QString& error_str); - void findPetsByTagsError(QList res, QNetworkReply::NetworkError error_type, QString& error_str); - void getPetByIdError(OAIPet res, QNetworkReply::NetworkError error_type, QString& error_str); + void findPetsByStatusError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str); + void findPetsByTagsError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str); + void getPetByIdError(const OAIPet& res, QNetworkReply::NetworkError error_type, QString& error_str); void updatePetError(QNetworkReply::NetworkError error_type, QString& error_str); void updatePetWithFormError(QNetworkReply::NetworkError error_type, QString& error_str); - void uploadFileError(OAIApiResponse res, QNetworkReply::NetworkError error_type, QString& error_str); + void uploadFileError(const OAIApiResponse& res, QNetworkReply::NetworkError error_type, QString& error_str); - QMap getDefaultHeaders(); + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + QHttpEngine::Socket* getRawSocket(); + void setResponseHeaders(const QMultiMap& headers); + signals: void addPet(OAIPet oai_pet); void deletePet(qint64 pet_id, QString api_key); @@ -80,11 +88,21 @@ signals: private: - QMap defaultHeaders; + QMap requestHeaders; + QMap responseHeaders; QHttpEngine::Socket *socket; OAIPetApiHandler *handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } }; } -#endif // _OAI_OAIPetApiRequest_H_ +#endif // OAI_OAIPetApiRequest_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp index 85a5f678d8..a383601baa 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp @@ -22,6 +22,10 @@ namespace OpenAPI { OAIStoreApiRequest::OAIStoreApiRequest(QHttpEngine::Socket *s, OAIStoreApiHandler* hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } } OAIStoreApiRequest::~OAIStoreApiRequest(){ @@ -30,16 +34,23 @@ OAIStoreApiRequest::~OAIStoreApiRequest(){ } QMap -OAIStoreApiRequest::getDefaultHeaders(){ - return defaultHeaders; +OAIStoreApiRequest::getRequestHeaders() const { + return requestHeaders; } +void OAIStoreApiRequest::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + QHttpEngine::Socket* OAIStoreApiRequest::getRawSocket(){ return socket; } -void OAIStoreApiRequest::deleteOrderRequest(QString order_idstr){ +void OAIStoreApiRequest::deleteOrderRequest(const QString& order_idstr){ qDebug() << "/v2/store/order/{orderId}"; connect(this, &OAIStoreApiRequest::deleteOrder, handler, &OAIStoreApiHandler::deleteOrder); @@ -63,7 +74,7 @@ void OAIStoreApiRequest::getInventoryRequest(){ } -void OAIStoreApiRequest::getOrderByIdRequest(QString order_idstr){ +void OAIStoreApiRequest::getOrderByIdRequest(const QString& order_idstr){ qDebug() << "/v2/store/order/{orderId}"; connect(this, &OAIStoreApiRequest::getOrderById, handler, &OAIStoreApiHandler::getOrderById); @@ -95,73 +106,93 @@ void OAIStoreApiRequest::placeOrderRequest(){ void OAIStoreApiRequest::deleteOrderResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIStoreApiRequest::getInventoryResponse(QMap res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIStoreApiRequest::getInventoryResponse(const QMap& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIStoreApiRequest::getOrderByIdResponse(OAIOrder res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIStoreApiRequest::getOrderByIdResponse(const OAIOrder& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIStoreApiRequest::placeOrderResponse(OAIOrder res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIStoreApiRequest::placeOrderResponse(const OAIOrder& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } void OAIStoreApiRequest::deleteOrderError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIStoreApiRequest::getInventoryError(QMap res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIStoreApiRequest::getInventoryError(const QMap& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIStoreApiRequest::getOrderByIdError(OAIOrder res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIStoreApiRequest::getOrderByIdError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIStoreApiRequest::placeOrderError(OAIOrder res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIStoreApiRequest::placeOrderError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } - +void OAIStoreApiRequest::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} + +void OAIStoreApiRequest::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h index 6157a9a07e..b9c6ce1c04 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h @@ -10,11 +10,12 @@ * Do not edit the class manually. */ -#ifndef _OAI_OAIStoreApiRequest_H_ -#define _OAI_OAIStoreApiRequest_H_ +#ifndef OAI_OAIStoreApiRequest_H +#define OAI_OAIStoreApiRequest_H #include #include +#include #include #include @@ -34,27 +35,34 @@ public: OAIStoreApiRequest(QHttpEngine::Socket *s, OAIStoreApiHandler* handler); virtual ~OAIStoreApiRequest(); - void deleteOrderRequest(QString order_id); + void deleteOrderRequest(const QString& order_id); void getInventoryRequest(); - void getOrderByIdRequest(QString order_id); + void getOrderByIdRequest(const QString& order_id); void placeOrderRequest(); void deleteOrderResponse(); - void getInventoryResponse(QMap res); - void getOrderByIdResponse(OAIOrder res); - void placeOrderResponse(OAIOrder res); + void getInventoryResponse(const QMap& res); + void getOrderByIdResponse(const OAIOrder& res); + void placeOrderResponse(const OAIOrder& res); void deleteOrderError(QNetworkReply::NetworkError error_type, QString& error_str); - void getInventoryError(QMap res, QNetworkReply::NetworkError error_type, QString& error_str); - void getOrderByIdError(OAIOrder res, QNetworkReply::NetworkError error_type, QString& error_str); - void placeOrderError(OAIOrder res, QNetworkReply::NetworkError error_type, QString& error_str); + void getInventoryError(const QMap& res, QNetworkReply::NetworkError error_type, QString& error_str); + void getOrderByIdError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str); + void placeOrderError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str); - QMap getDefaultHeaders(); + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + QHttpEngine::Socket* getRawSocket(); + void setResponseHeaders(const QMultiMap& headers); + signals: void deleteOrder(QString order_id); void getInventory(); @@ -63,11 +71,21 @@ signals: private: - QMap defaultHeaders; + QMap requestHeaders; + QMap responseHeaders; QHttpEngine::Socket *socket; OAIStoreApiHandler *handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } }; } -#endif // _OAI_OAIStoreApiRequest_H_ +#endif // OAI_OAIStoreApiRequest_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp index 8e6b6c3a36..bdc5b0b688 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp @@ -22,6 +22,10 @@ namespace OpenAPI { OAIUserApiRequest::OAIUserApiRequest(QHttpEngine::Socket *s, OAIUserApiHandler* hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } } OAIUserApiRequest::~OAIUserApiRequest(){ @@ -30,10 +34,17 @@ OAIUserApiRequest::~OAIUserApiRequest(){ } QMap -OAIUserApiRequest::getDefaultHeaders(){ - return defaultHeaders; +OAIUserApiRequest::getRequestHeaders() const { + return requestHeaders; } +void OAIUserApiRequest::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + QHttpEngine::Socket* OAIUserApiRequest::getRawSocket(){ return socket; } @@ -100,7 +111,7 @@ void OAIUserApiRequest::createUsersWithListInputRequest(){ } -void OAIUserApiRequest::deleteUserRequest(QString usernamestr){ +void OAIUserApiRequest::deleteUserRequest(const QString& usernamestr){ qDebug() << "/v2/user/{username}"; connect(this, &OAIUserApiRequest::deleteUser, handler, &OAIUserApiHandler::deleteUser); @@ -113,7 +124,7 @@ void OAIUserApiRequest::deleteUserRequest(QString usernamestr){ } -void OAIUserApiRequest::getUserByNameRequest(QString usernamestr){ +void OAIUserApiRequest::getUserByNameRequest(const QString& usernamestr){ qDebug() << "/v2/user/{username}"; connect(this, &OAIUserApiRequest::getUserByName, handler, &OAIUserApiHandler::getUserByName); @@ -158,7 +169,7 @@ void OAIUserApiRequest::logoutUserRequest(){ } -void OAIUserApiRequest::updateUserRequest(QString usernamestr){ +void OAIUserApiRequest::updateUserRequest(const QString& usernamestr){ qDebug() << "/v2/user/{username}"; connect(this, &OAIUserApiRequest::updateUser, handler, &OAIUserApiHandler::updateUser); @@ -179,137 +190,163 @@ void OAIUserApiRequest::updateUserRequest(QString usernamestr){ void OAIUserApiRequest::createUserResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::createUsersWithArrayInputResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::createUsersWithListInputResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::deleteUserResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIUserApiRequest::getUserByNameResponse(OAIUser res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIUserApiRequest::getUserByNameResponse(const OAIUser& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIUserApiRequest::loginUserResponse(QString res){ - socket->setStatusCode(QHttpEngine::Socket::OK); + +void OAIUserApiRequest::loginUserResponse(const QString& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::logoutUserResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::updateUserResponse(){ + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } void OAIUserApiRequest::createUserError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::createUsersWithArrayInputError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::createUsersWithListInputError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::deleteUserError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIUserApiRequest::getUserByNameError(OAIUser res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIUserApiRequest::getUserByNameError(const OAIUser& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } -void OAIUserApiRequest::loginUserError(QString res, QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); - socket->setStatusCode(QHttpEngine::Socket::NotFound); + +void OAIUserApiRequest::loginUserError(const QString& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::logoutUserError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } + void OAIUserApiRequest::updateUserError(QNetworkReply::NetworkError error_type, QString& error_str){ - Q_UNUSED(error_type); - Q_UNUSED(error_str); + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); if(socket->isOpen()){ - socket->writeHeaders(); socket->close(); } } - +void OAIUserApiRequest::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} + +void OAIUserApiRequest::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(res); // TODO + Q_UNUSED(error_type); // TODO +} } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h index 492b236286..d1b30ef196 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h @@ -10,11 +10,12 @@ * Do not edit the class manually. */ -#ifndef _OAI_OAIUserApiRequest_H_ -#define _OAI_OAIUserApiRequest_H_ +#ifndef OAI_OAIUserApiRequest_H +#define OAI_OAIUserApiRequest_H #include #include +#include #include #include @@ -37,19 +38,19 @@ public: void createUserRequest(); void createUsersWithArrayInputRequest(); void createUsersWithListInputRequest(); - void deleteUserRequest(QString username); - void getUserByNameRequest(QString username); + void deleteUserRequest(const QString& username); + void getUserByNameRequest(const QString& username); void loginUserRequest(); void logoutUserRequest(); - void updateUserRequest(QString username); + void updateUserRequest(const QString& username); void createUserResponse(); void createUsersWithArrayInputResponse(); void createUsersWithListInputResponse(); void deleteUserResponse(); - void getUserByNameResponse(OAIUser res); - void loginUserResponse(QString res); + void getUserByNameResponse(const OAIUser& res); + void loginUserResponse(const QString& res); void logoutUserResponse(); void updateUserResponse(); @@ -58,15 +59,22 @@ public: void createUsersWithArrayInputError(QNetworkReply::NetworkError error_type, QString& error_str); void createUsersWithListInputError(QNetworkReply::NetworkError error_type, QString& error_str); void deleteUserError(QNetworkReply::NetworkError error_type, QString& error_str); - void getUserByNameError(OAIUser res, QNetworkReply::NetworkError error_type, QString& error_str); - void loginUserError(QString res, QNetworkReply::NetworkError error_type, QString& error_str); + void getUserByNameError(const OAIUser& res, QNetworkReply::NetworkError error_type, QString& error_str); + void loginUserError(const QString& res, QNetworkReply::NetworkError error_type, QString& error_str); void logoutUserError(QNetworkReply::NetworkError error_type, QString& error_str); void updateUserError(QNetworkReply::NetworkError error_type, QString& error_str); - QMap getDefaultHeaders(); + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + QHttpEngine::Socket* getRawSocket(); + void setResponseHeaders(const QMultiMap& headers); + signals: void createUser(OAIUser oai_user); void createUsersWithArrayInput(QList oai_user); @@ -79,11 +87,21 @@ signals: private: - QMap defaultHeaders; + QMap requestHeaders; + QMap responseHeaders; QHttpEngine::Socket *socket; OAIUserApiHandler *handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } }; } -#endif // _OAI_OAIUserApiRequest_H_ +#endif // OAI_OAIUserApiRequest_H diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 4f77743ac4..07c44ba768 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -32,7 +32,7 @@ public interface AnotherFakeApi { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * */ @PATCH @@ -42,6 +42,6 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Client testSpecialTags(@Valid Client client); + public Client call123testSpecialTags(@Valid Client client); } diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index bbfbf8e2d7..3718c12451 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -26,10 +26,10 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * */ - public Client testSpecialTags(Client client) { + public Client call123testSpecialTags(Client client) { // TODO: Implement... return null; diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java index 210ea87532..631c28ba04 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/AnotherFakeApiTest.java @@ -74,15 +74,15 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number * * @throws ApiException * if the Api call fails */ @Test - public void testSpecialTagsTest() { + public void call123testSpecialTagsTest() { Client client = null; - //Client response = api.testSpecialTags(client); + //Client response = api.call123testSpecialTags(client); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 042f91ddfa..c1eb8b88c3 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -58,12 +58,12 @@ public class AnotherFakeApi { @Path("/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client + public Response call123testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(client,securityContext); + return delegate.call123testSpecialTags(client,securityContext); } } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index d8df665e2a..fa614bab5a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -17,5 +17,5 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + public abstract Response call123testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index e2d6575d83..05e8901822 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -18,7 +18,7 @@ import javax.validation.constraints.*; public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { @Override - public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { + public Response call123testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java index f4224c0986..cfa8e250ac 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -20,8 +20,8 @@ public interface AnotherFakeApi { @Path("/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "To test special tags", notes = "To test special tags", tags={ "$another-fake?" }) + @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testSpecialTags(@Valid Client client); + Client call123testSpecialTags(@Valid Client client); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 536d1d3912..8ce9975a0a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1016,8 +1016,8 @@ paths: - tag: fake /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 0b3ba505c5..e7671f76c5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -20,11 +20,11 @@ public class AnotherFakeApi { @Path("/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) + @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@Valid Client client) { + public Response call123testSpecialTags(@Valid Client client) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 536d1d3912..8ce9975a0a 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1016,8 +1016,8 @@ paths: - tag: fake /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java index f466cddbf2..2a63ee651b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -38,13 +38,13 @@ public class AnotherFakeApi { @Path("/another-fake/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags( + public Response call123testSpecialTags( @ApiParam(value = "client model" ,required=true) Client client, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(client,securityContext); + return delegate.call123testSpecialTags(client,securityContext); } } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index 10b25b73c6..62343b93c3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -20,6 +20,6 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client client,SecurityContext securityContext) + public abstract Response call123testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 25c44d9658..e6b4fb1079 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -21,7 +21,7 @@ import javax.validation.constraints.*; public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { @Override - public Response testSpecialTags(Client client, SecurityContext securityContext) + public Response call123testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApi.java index c09dfee5a3..b9baefac5b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -38,13 +38,13 @@ public class AnotherFakeApi { @Path("/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags( + public Response call123testSpecialTags( @ApiParam(value = "client model" ,required=true) Client client, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(client,securityContext); + return delegate.call123testSpecialTags(client,securityContext); } } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index 10b25b73c6..62343b93c3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -20,6 +20,6 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client client,SecurityContext securityContext) + public abstract Response call123testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 25c44d9658..e6b4fb1079 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -21,7 +21,7 @@ import javax.validation.constraints.*; public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { @Override - public Response testSpecialTags(Client client, SecurityContext securityContext) + public Response call123testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 4336bd462a..d7af3cd53d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -58,12 +58,12 @@ public class AnotherFakeApi { @Path("/another-fake/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client + public Response call123testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(client,securityContext); + return delegate.call123testSpecialTags(client,securityContext); } } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index d8df665e2a..fa614bab5a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -17,5 +17,5 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + public abstract Response call123testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index e2d6575d83..05e8901822 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -18,7 +18,7 @@ import javax.validation.constraints.*; public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { @Override - public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { + public Response call123testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 042f91ddfa..c1eb8b88c3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -58,12 +58,12 @@ public class AnotherFakeApi { @Path("/dummy") @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client + public Response call123testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(client,securityContext); + return delegate.call123testSpecialTags(client,securityContext); } } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index d8df665e2a..fa614bab5a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -17,5 +17,5 @@ import javax.ws.rs.core.SecurityContext; import javax.validation.constraints.*; public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + public abstract Response call123testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index e2d6575d83..05e8901822 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -18,7 +18,7 @@ import javax.validation.constraints.*; public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { @Override - public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { + public Response call123testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/rust-server/.openapi-generator-ignore b/samples/server/petstore/php-laravel/.openapi-generator-ignore similarity index 100% rename from samples/server/petstore/rust-server/.openapi-generator-ignore rename to samples/server/petstore/php-laravel/.openapi-generator-ignore diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION new file mode 100644 index 0000000000..0f58aa0414 --- /dev/null +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/.env b/samples/server/petstore/php-laravel/lib/.env new file mode 100644 index 0000000000..7aaed2ba7b --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/.env @@ -0,0 +1,39 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY=base64:DLKuAaa5bAytB73eQNHV4KBfRzQxh9ix8J3gc0sbfGc= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=homestead +DB_USERNAME=homestead +DB_PASSWORD=secret + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +SESSION_DRIVER=file +SESSION_LIFETIME=120 +QUEUE_DRIVER=sync + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/samples/server/petstore/php-laravel/lib/.env.example b/samples/server/petstore/php-laravel/lib/.env.example new file mode 100644 index 0000000000..ec44a1259f --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/.env.example @@ -0,0 +1,39 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=homestead +DB_USERNAME=homestead +DB_PASSWORD=secret + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +SESSION_DRIVER=file +SESSION_LIFETIME=120 +QUEUE_DRIVER=sync + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/samples/server/petstore/php-laravel/lib/README.md b/samples/server/petstore/php-laravel/lib/README.md new file mode 100644 index 0000000000..76ceb65d21 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/README.md @@ -0,0 +1,23 @@ +# OpenAPI generated server + +## Overview +This server was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a PHP server. + +This example uses the [laravel Framework](http://laravel.com/). To see how to make this your own, please take a look at the template here: + +## Installation & Usage +### Composer + +Using `composer install` to install the framework and dependencies via [Composer](http://getcomposer.org/). + +### post installation steps + +Change into application folder and execute following commands to get started: + +```sh +cp .env.example .env +php artisan key:generate +php artisan serve +``` \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/app/Console/Kernel.php b/samples/server/petstore/php-laravel/lib/app/Console/Kernel.php new file mode 100644 index 0000000000..a8c5158593 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Console/Kernel.php @@ -0,0 +1,42 @@ +command('inspire') + // ->hourly(); + } + + /** + * Register the commands for the application. + * + * @return void + */ + protected function commands() + { + $this->load(__DIR__.'/Commands'); + + require base_path('routes/console.php'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Exceptions/Handler.php b/samples/server/petstore/php-laravel/lib/app/Exceptions/Handler.php new file mode 100644 index 0000000000..043cad6bcc --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Exceptions/Handler.php @@ -0,0 +1,51 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +class AnotherFakeController extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Operation testSpecialTags + * + * To test special tags. + * + * + * @return Http response + */ + public function testSpecialTags() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['client'])) { + throw new \InvalidArgumentException('Missing the required parameter $client when calling testSpecialTags'); + } + $client = $input['client']; + + + return response('How about implementing testSpecialTags as a patch method ?'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/Controller.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/Controller.php new file mode 100644 index 0000000000..dbaeec7be6 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/Controller.php @@ -0,0 +1,26 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +class FakeClassnameTags123Controller extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Operation testClassname + * + * To test class name in snake case. + * + * + * @return Http response + */ + public function testClassname() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['client'])) { + throw new \InvalidArgumentException('Missing the required parameter $client when calling testClassname'); + } + $client = $input['client']; + + + return response('How about implementing testClassname as a patch method ?'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php new file mode 100644 index 0000000000..165d4b6059 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -0,0 +1,380 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +class FakeController extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Operation testClientModel + * + * To test \"client\" model. + * + * + * @return Http response + */ + public function testClientModel() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['client'])) { + throw new \InvalidArgumentException('Missing the required parameter $client when calling testClientModel'); + } + $client = $input['client']; + + + return response('How about implementing testClientModel as a patch method ?'); + } + /** + * Operation testEndpointParameters + * + * Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íŠ¸. + * + * + * @return Http response + */ + public function testEndpointParameters() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['number'])) { + throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters'); + } + if ($input['number'] > 543.2) { + throw new \InvalidArgumentException('invalid value for $number when calling FakeController.testEndpointParameters, must be smaller than or equal to 543.2.'); + } + if ($input['number'] < 32.1) { + throw new \InvalidArgumentException('invalid value for $number when calling FakeController.testEndpointParameters, must be bigger than or equal to 32.1.'); + } + $number = $input['number']; + + if (!isset($input['double'])) { + throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters'); + } + if ($input['double'] > 123.4) { + throw new \InvalidArgumentException('invalid value for $double when calling FakeController.testEndpointParameters, must be smaller than or equal to 123.4.'); + } + if ($input['double'] < 67.8) { + throw new \InvalidArgumentException('invalid value for $double when calling FakeController.testEndpointParameters, must be bigger than or equal to 67.8.'); + } + $double = $input['double']; + + if (!isset($input['pattern_without_delimiter'])) { + throw new \InvalidArgumentException('Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters'); + } + if (!preg_match("/^[A-Z].*/", $input['pattern_without_delimiter'])) { + throw new \InvalidArgumentException('invalid value for $pattern_without_delimiter when calling FakeController.testEndpointParameters, must conform to the pattern /^[A-Z].*/.'); + } + $pattern_without_delimiter = $input['pattern_without_delimiter']; + + if (!isset($input['byte'])) { + throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters'); + } + $byte = $input['byte']; + + if ($input['integer'] > 100) { + throw new \InvalidArgumentException('invalid value for $integer when calling FakeController.testEndpointParameters, must be smaller than or equal to 100.'); + } + if ($input['integer'] < 10) { + throw new \InvalidArgumentException('invalid value for $integer when calling FakeController.testEndpointParameters, must be bigger than or equal to 10.'); + } + $integer = $input['integer']; + + if ($input['int32'] > 200) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FakeController.testEndpointParameters, must be smaller than or equal to 200.'); + } + if ($input['int32'] < 20) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FakeController.testEndpointParameters, must be bigger than or equal to 20.'); + } + $int32 = $input['int32']; + + $int64 = $input['int64']; + + if ($input['float'] > 987.6) { + throw new \InvalidArgumentException('invalid value for $float when calling FakeController.testEndpointParameters, must be smaller than or equal to 987.6.'); + } + $float = $input['float']; + + if (!preg_match("/[a-z]/i", $input['string'])) { + throw new \InvalidArgumentException('invalid value for $string when calling FakeController.testEndpointParameters, must conform to the pattern /[a-z]/i.'); + } + $string = $input['string']; + + $binary = $input['binary']; + + $date = $input['date']; + + $date_time = $input['date_time']; + + if (strlen($input['password']) > 64) { + throw new \InvalidArgumentException('invalid length for $password when calling FakeController.testEndpointParameters, must be smaller than or equal to 64.'); + } + if (strlen($input['password']) < 10) { + throw new \InvalidArgumentException('invalid length for $password when calling FakeController.testEndpointParameters, must be bigger than or equal to 10.'); + } + $password = $input['password']; + + $callback = $input['callback']; + + + return response('How about implementing testEndpointParameters as a post method ?'); + } + /** + * Operation testEnumParameters + * + * To test enum parameters. + * + * + * @return Http response + */ + public function testEnumParameters() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + $enum_header_string_array = $input['enum_header_string_array']; + + $enum_header_string = $input['enum_header_string']; + + $enum_query_string_array = $input['enum_query_string_array']; + + $enum_query_string = $input['enum_query_string']; + + $enum_query_integer = $input['enum_query_integer']; + + $enum_query_double = $input['enum_query_double']; + + $enum_form_string_array = $input['enum_form_string_array']; + + $enum_form_string = $input['enum_form_string']; + + + return response('How about implementing testEnumParameters as a get method ?'); + } + /** + * Operation testBodyWithFileSchema + * + * . + * + * + * @return Http response + */ + public function testBodyWithFileSchema() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['file_schema_test_class'])) { + throw new \InvalidArgumentException('Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema'); + } + $file_schema_test_class = $input['file_schema_test_class']; + + + return response('How about implementing testBodyWithFileSchema as a put method ?'); + } + /** + * Operation testBodyWithQueryParams + * + * . + * + * + * @return Http response + */ + public function testBodyWithQueryParams() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['query'])) { + throw new \InvalidArgumentException('Missing the required parameter $query when calling testBodyWithQueryParams'); + } + $query = $input['query']; + + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling testBodyWithQueryParams'); + } + $user = $input['user']; + + + return response('How about implementing testBodyWithQueryParams as a put method ?'); + } + /** + * Operation testInlineAdditionalProperties + * + * test inline additionalProperties. + * + * + * @return Http response + */ + public function testInlineAdditionalProperties() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['request_body'])) { + throw new \InvalidArgumentException('Missing the required parameter $request_body when calling testInlineAdditionalProperties'); + } + $request_body = $input['request_body']; + + + return response('How about implementing testInlineAdditionalProperties as a post method ?'); + } + /** + * Operation testJsonFormData + * + * test json serialization of form data. + * + * + * @return Http response + */ + public function testJsonFormData() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['param'])) { + throw new \InvalidArgumentException('Missing the required parameter $param when calling testJsonFormData'); + } + $param = $input['param']; + + if (!isset($input['param2'])) { + throw new \InvalidArgumentException('Missing the required parameter $param2 when calling testJsonFormData'); + } + $param2 = $input['param2']; + + + return response('How about implementing testJsonFormData as a get method ?'); + } + /** + * Operation fakeOuterBooleanSerialize + * + * . + * + * + * @return Http response + */ + public function fakeOuterBooleanSerialize() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + $body = $input['body']; + + + return response('How about implementing fakeOuterBooleanSerialize as a post method ?'); + } + /** + * Operation fakeOuterCompositeSerialize + * + * . + * + * + * @return Http response + */ + public function fakeOuterCompositeSerialize() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + $outer_composite = $input['outer_composite']; + + + return response('How about implementing fakeOuterCompositeSerialize as a post method ?'); + } + /** + * Operation fakeOuterNumberSerialize + * + * . + * + * + * @return Http response + */ + public function fakeOuterNumberSerialize() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + $body = $input['body']; + + + return response('How about implementing fakeOuterNumberSerialize as a post method ?'); + } + /** + * Operation fakeOuterStringSerialize + * + * . + * + * + * @return Http response + */ + public function fakeOuterStringSerialize() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + $body = $input['body']; + + + return response('How about implementing fakeOuterStringSerialize as a post method ?'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php new file mode 100644 index 0000000000..58da9c3cf9 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php @@ -0,0 +1,229 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +class PetController extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Operation uploadFileWithRequiredFile + * + * uploads an image (required). + * + * @param int $pet_id ID of pet to update (required) + * + * @return Http response + */ + public function uploadFileWithRequiredFile($pet_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing uploadFileWithRequiredFile as a post method ?'); + } + /** + * Operation addPet + * + * Add a new pet to the store. + * + * + * @return Http response + */ + public function addPet() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling addPet'); + } + $pet = $input['pet']; + + + return response('How about implementing addPet as a post method ?'); + } + /** + * Operation updatePet + * + * Update an existing pet. + * + * + * @return Http response + */ + public function updatePet() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling updatePet'); + } + $pet = $input['pet']; + + + return response('How about implementing updatePet as a put method ?'); + } + /** + * Operation findPetsByStatus + * + * Finds Pets by status. + * + * + * @return Http response + */ + public function findPetsByStatus() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['status'])) { + throw new \InvalidArgumentException('Missing the required parameter $status when calling findPetsByStatus'); + } + $status = $input['status']; + + + return response('How about implementing findPetsByStatus as a get method ?'); + } + /** + * Operation findPetsByTags + * + * Finds Pets by tags. + * + * + * @return Http response + */ + public function findPetsByTags() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['tags'])) { + throw new \InvalidArgumentException('Missing the required parameter $tags when calling findPetsByTags'); + } + $tags = $input['tags']; + + + return response('How about implementing findPetsByTags as a get method ?'); + } + /** + * Operation deletePet + * + * Deletes a pet. + * + * @param int $pet_id Pet id to delete (required) + * + * @return Http response + */ + public function deletePet($pet_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing deletePet as a delete method ?'); + } + /** + * Operation getPetById + * + * Find pet by ID. + * + * @param int $pet_id ID of pet to return (required) + * + * @return Http response + */ + public function getPetById($pet_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing getPetById as a get method ?'); + } + /** + * Operation updatePetWithForm + * + * Updates a pet in the store with form data. + * + * @param int $pet_id ID of pet that needs to be updated (required) + * + * @return Http response + */ + public function updatePetWithForm($pet_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing updatePetWithForm as a post method ?'); + } + /** + * Operation uploadFile + * + * uploads an image. + * + * @param int $pet_id ID of pet to update (required) + * + * @return Http response + */ + public function uploadFile($pet_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing uploadFile as a post method ?'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php new file mode 100644 index 0000000000..96c2ce5a74 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php @@ -0,0 +1,122 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +class StoreController extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Operation getInventory + * + * Returns pet inventories by status. + * + * + * @return Http response + */ + public function getInventory() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing getInventory as a get method ?'); + } + /** + * Operation placeOrder + * + * Place an order for a pet. + * + * + * @return Http response + */ + public function placeOrder() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['order'])) { + throw new \InvalidArgumentException('Missing the required parameter $order when calling placeOrder'); + } + $order = $input['order']; + + + return response('How about implementing placeOrder as a post method ?'); + } + /** + * Operation deleteOrder + * + * Delete purchase order by ID. + * + * @param string $order_id ID of the order that needs to be deleted (required) + * + * @return Http response + */ + public function deleteOrder($order_id) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing deleteOrder as a delete method ?'); + } + /** + * Operation getOrderById + * + * Find purchase order by ID. + * + * @param int $order_id ID of pet that needs to be fetched (required) + * + * @return Http response + */ + public function getOrderById($order_id) + { + $input = Request::all(); + + //path params validation + if ($order_id > 5) { + throw new \InvalidArgumentException('invalid value for $order_id when calling StoreController.getOrderById, must be smaller than or equal to 5.'); + } + if ($order_id < 1) { + throw new \InvalidArgumentException('invalid value for $order_id when calling StoreController.getOrderById, must be bigger than or equal to 1.'); + } + + + //not path params validation + + return response('How about implementing getOrderById as a get method ?'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php new file mode 100644 index 0000000000..d8288976bf --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php @@ -0,0 +1,213 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +namespace App\Http\Controllers; + +use Illuminate\Support\Facades\Request; + +class UserController extends Controller +{ + /** + * Constructor + */ + public function __construct() + { + } + + /** + * Operation createUser + * + * Create user. + * + * + * @return Http response + */ + public function createUser() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUser'); + } + $user = $input['user']; + + + return response('How about implementing createUser as a post method ?'); + } + /** + * Operation createUsersWithArrayInput + * + * Creates list of users with given input array. + * + * + * @return Http response + */ + public function createUsersWithArrayInput() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithArrayInput'); + } + $user = $input['user']; + + + return response('How about implementing createUsersWithArrayInput as a post method ?'); + } + /** + * Operation createUsersWithListInput + * + * Creates list of users with given input array. + * + * + * @return Http response + */ + public function createUsersWithListInput() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithListInput'); + } + $user = $input['user']; + + + return response('How about implementing createUsersWithListInput as a post method ?'); + } + /** + * Operation loginUser + * + * Logs user into the system. + * + * + * @return Http response + */ + public function loginUser() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['username'])) { + throw new \InvalidArgumentException('Missing the required parameter $username when calling loginUser'); + } + $username = $input['username']; + + if (!isset($input['password'])) { + throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser'); + } + $password = $input['password']; + + + return response('How about implementing loginUser as a get method ?'); + } + /** + * Operation logoutUser + * + * Logs out current logged in user session. + * + * + * @return Http response + */ + public function logoutUser() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing logoutUser as a get method ?'); + } + /** + * Operation deleteUser + * + * Delete user. + * + * @param string $username The name that needs to be deleted (required) + * + * @return Http response + */ + public function deleteUser($username) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing deleteUser as a delete method ?'); + } + /** + * Operation getUserByName + * + * Get user by user name. + * + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * + * @return Http response + */ + public function getUserByName($username) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing getUserByName as a get method ?'); + } + /** + * Operation updateUser + * + * Updated user. + * + * @param string $username name that need to be deleted (required) + * + * @return Http response + */ + public function updateUser($username) + { + $input = Request::all(); + + //path params validation + + + //not path params validation + + return response('How about implementing updateUser as a put method ?'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Kernel.php b/samples/server/petstore/php-laravel/lib/app/Http/Kernel.php new file mode 100644 index 0000000000..3439540c90 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Kernel.php @@ -0,0 +1,63 @@ + [ + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + // \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + + 'api' => [ + 'throttle:60,1', + 'bindings', + ], + ]; + + /** + * The application's route middleware. + * + * These middleware may be assigned to groups or used individually. + * + * @var array + */ + protected $routeMiddleware = [ + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + ]; +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Middleware/EncryptCookies.php b/samples/server/petstore/php-laravel/lib/app/Http/Middleware/EncryptCookies.php new file mode 100644 index 0000000000..033136ad12 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Middleware/EncryptCookies.php @@ -0,0 +1,17 @@ +check()) { + return redirect('/home'); + } + + return $next($request); + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Middleware/TrimStrings.php b/samples/server/petstore/php-laravel/lib/app/Http/Middleware/TrimStrings.php new file mode 100644 index 0000000000..5a50e7b5c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Http/Middleware/TrimStrings.php @@ -0,0 +1,18 @@ + 'App\Policies\ModelPolicy', + ]; + + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + // + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Providers/BroadcastServiceProvider.php b/samples/server/petstore/php-laravel/lib/app/Providers/BroadcastServiceProvider.php new file mode 100644 index 0000000000..352cce44a3 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Providers/BroadcastServiceProvider.php @@ -0,0 +1,21 @@ + [ + 'App\Listeners\EventListener', + ], + ]; + + /** + * Register any events for your application. + * + * @return void + */ + public function boot() + { + parent::boot(); + + // + } +} diff --git a/samples/server/petstore/php-laravel/lib/app/Providers/RouteServiceProvider.php b/samples/server/petstore/php-laravel/lib/app/Providers/RouteServiceProvider.php new file mode 100644 index 0000000000..b36415e85f --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Providers/RouteServiceProvider.php @@ -0,0 +1,72 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + + // + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->namespace) + ->group(base_path('routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); + } +} diff --git a/samples/server/petstore/php-laravel/lib/artisan b/samples/server/petstore/php-laravel/lib/artisan new file mode 100644 index 0000000000..5c23e2e24f --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/artisan @@ -0,0 +1,53 @@ +#!/usr/bin/env php +make(Illuminate\Contracts\Console\Kernel::class); + +$status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput +); + +/* +|-------------------------------------------------------------------------- +| Shutdown The Application +|-------------------------------------------------------------------------- +| +| Once Artisan has finished running, we will fire off the shutdown events +| so that any final work may be done by the application before we shut +| down the process. This is the last thing to happen to the request. +| +*/ + +$kernel->terminate($input, $status); + +exit($status); diff --git a/samples/server/petstore/php-laravel/lib/bootstrap/app.php b/samples/server/petstore/php-laravel/lib/bootstrap/app.php new file mode 100644 index 0000000000..f2801adf6f --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/bootstrap/app.php @@ -0,0 +1,55 @@ +singleton( + Illuminate\Contracts\Http\Kernel::class, + App\Http\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +/* +|-------------------------------------------------------------------------- +| Return The Application +|-------------------------------------------------------------------------- +| +| This script returns the application instance. The instance is given to +| the calling script so we can separate the building of the instances +| from the actual running of the application and sending responses. +| +*/ + +return $app; diff --git a/samples/server/petstore/php-laravel/lib/bootstrap/cache/.gitignore b/samples/server/petstore/php-laravel/lib/bootstrap/cache/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/bootstrap/testingAutoload.php b/samples/server/petstore/php-laravel/lib/bootstrap/testingAutoload.php new file mode 100644 index 0000000000..30a59f187e --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/bootstrap/testingAutoload.php @@ -0,0 +1,6 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services your application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ + + 'locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ + + 'fallback_locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ + + 'key' => env('APP_KEY'), + + 'cipher' => 'AES-256-CBC', + + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ + + 'providers' => [ + + /* + * Laravel Framework Service Providers... + */ + Illuminate\Auth\AuthServiceProvider::class, + Illuminate\Broadcasting\BroadcastServiceProvider::class, + Illuminate\Bus\BusServiceProvider::class, + Illuminate\Cache\CacheServiceProvider::class, + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + Illuminate\Cookie\CookieServiceProvider::class, + Illuminate\Database\DatabaseServiceProvider::class, + Illuminate\Encryption\EncryptionServiceProvider::class, + Illuminate\Filesystem\FilesystemServiceProvider::class, + Illuminate\Foundation\Providers\FoundationServiceProvider::class, + Illuminate\Hashing\HashServiceProvider::class, + Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, + Illuminate\Pagination\PaginationServiceProvider::class, + Illuminate\Pipeline\PipelineServiceProvider::class, + Illuminate\Queue\QueueServiceProvider::class, + Illuminate\Redis\RedisServiceProvider::class, + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + Illuminate\Session\SessionServiceProvider::class, + Illuminate\Translation\TranslationServiceProvider::class, + Illuminate\Validation\ValidationServiceProvider::class, + Illuminate\View\ViewServiceProvider::class, + + /* + * Package Service Providers... + */ + + /* + * Application Service Providers... + */ + App\Providers\AppServiceProvider::class, + App\Providers\AuthServiceProvider::class, + // App\Providers\BroadcastServiceProvider::class, + App\Providers\EventServiceProvider::class, + App\Providers\RouteServiceProvider::class, + + ], + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ + + 'aliases' => [ + + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Notification' => Illuminate\Support\Facades\Notification::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/auth.php b/samples/server/petstore/php-laravel/lib/config/auth.php new file mode 100644 index 0000000000..7817501025 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/auth.php @@ -0,0 +1,102 @@ + [ + 'guard' => 'web', + 'passwords' => 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\User::class, + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => 'password_resets', + 'expire' => 60, + ], + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/broadcasting.php b/samples/server/petstore/php-laravel/lib/config/broadcasting.php new file mode 100644 index 0000000000..3ca45eaa85 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/broadcasting.php @@ -0,0 +1,59 @@ + env('BROADCAST_DRIVER', 'null'), + + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | + */ + + 'connections' => [ + + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'encrypted' => true, + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/cache.php b/samples/server/petstore/php-laravel/lib/config/cache.php new file mode 100644 index 0000000000..fa12e5e4f7 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/cache.php @@ -0,0 +1,94 @@ + env('CACHE_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + */ + + 'stores' => [ + + 'apc' => [ + 'driver' => 'apc', + ], + + 'array' => [ + 'driver' => 'array', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', + 'connection' => null, + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ + + 'prefix' => env( + 'CACHE_PREFIX', + str_slug(env('APP_NAME', 'laravel'), '_').'_cache' + ), + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/database.php b/samples/server/petstore/php-laravel/lib/config/database.php new file mode 100644 index 0000000000..cab5d068f7 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/database.php @@ -0,0 +1,120 @@ + env('DB_CONNECTION', 'mysql'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ + + 'connections' => [ + + 'sqlite' => [ + 'driver' => 'sqlite', + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'strict' => true, + 'engine' => null, + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | + */ + + 'migrations' => 'migrations', + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer set of commands than a typical key-value systems + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ + + 'redis' => [ + + 'client' => 'predis', + + 'default' => [ + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', 6379), + 'database' => 0, + ], + + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/filesystems.php b/samples/server/petstore/php-laravel/lib/config/filesystems.php new file mode 100644 index 0000000000..77fa5ded1d --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/filesystems.php @@ -0,0 +1,69 @@ + env('FILESYSTEM_DRIVER', 'local'), + + /* + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | + */ + + 'cloud' => env('FILESYSTEM_CLOUD', 's3'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'public', + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + ], + + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/hashing.php b/samples/server/petstore/php-laravel/lib/config/hashing.php new file mode 100644 index 0000000000..d3c8e2fb22 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/hashing.php @@ -0,0 +1,52 @@ + 'bcrypt', + + /* + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'bcrypt' => [ + 'rounds' => env('BCRYPT_ROUNDS', 10), + ], + + /* + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'argon' => [ + 'memory' => 1024, + 'threads' => 2, + 'time' => 2, + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/logging.php b/samples/server/petstore/php-laravel/lib/config/logging.php new file mode 100644 index 0000000000..400bc7f464 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/logging.php @@ -0,0 +1,81 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | + */ + + 'channels' => [ + 'stack' => [ + 'driver' => 'stack', + 'channels' => ['single'], + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 7, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => 'Laravel Log', + 'emoji' => ':boom:', + 'level' => 'critical', + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'with' => [ + 'stream' => 'php://stderr', + ], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => 'debug', + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => 'debug', + ], + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/mail.php b/samples/server/petstore/php-laravel/lib/config/mail.php new file mode 100644 index 0000000000..bb92224c59 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/mail.php @@ -0,0 +1,123 @@ + env('MAIL_DRIVER', 'smtp'), + + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Mailgun mail service which will provide reliable deliveries. + | + */ + + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to deliver e-mails to + | users of the application. Like the host we have set this value to + | stay compatible with the Mailgun e-mail application by default. + | + */ + + 'port' => env('MAIL_PORT', 587), + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], + + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ + + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ + + 'username' => env('MAIL_USERNAME'), + + 'password' => env('MAIL_PASSWORD'), + + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ + + 'sendmail' => '/usr/sbin/sendmail -bs', + + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ + + 'markdown' => [ + 'theme' => 'default', + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/queue.php b/samples/server/petstore/php-laravel/lib/config/queue.php new file mode 100644 index 0000000000..391304f363 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/queue.php @@ -0,0 +1,86 @@ + env('QUEUE_DRIVER', 'sync'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('SQS_KEY', 'your-public-key'), + 'secret' => env('SQS_SECRET', 'your-secret-key'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'region' => env('SQS_REGION', 'us-east-1'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => null, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ + + 'failed' => [ + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/services.php b/samples/server/petstore/php-laravel/lib/config/services.php new file mode 100644 index 0000000000..aa1f7f82ca --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/services.php @@ -0,0 +1,38 @@ + [ + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), + ], + + 'ses' => [ + 'key' => env('SES_KEY'), + 'secret' => env('SES_SECRET'), + 'region' => env('SES_REGION', 'us-east-1'), + ], + + 'sparkpost' => [ + 'secret' => env('SPARKPOST_SECRET'), + ], + + 'stripe' => [ + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), + 'secret' => env('STRIPE_SECRET'), + ], + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/session.php b/samples/server/petstore/php-laravel/lib/config/session.php new file mode 100644 index 0000000000..736fb3c79e --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/session.php @@ -0,0 +1,197 @@ + env('SESSION_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | + */ + + 'lifetime' => env('SESSION_LIFETIME', 120), + + 'expire_on_close' => false, + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | + */ + + 'encrypt' => false, + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => null, + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | + */ + + 'table' => 'sessions', + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using the "apc" or "memcached" session drivers, you may specify a + | cache store that should be used for these sessions. This value must + | correspond with one of the application's configured cache stores. + | + */ + + 'store' => null, + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + str_slug(env('APP_NAME', 'laravel'), '_').'_session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | + */ + + 'path' => '/', + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | + */ + + 'domain' => env('SESSION_DOMAIN', null), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE', false), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | + */ + + 'http_only' => true, + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | do not enable this as other CSRF protection services are in place. + | + | Supported: "lax", "strict" + | + */ + + 'same_site' => null, + +]; diff --git a/samples/server/petstore/php-laravel/lib/config/view.php b/samples/server/petstore/php-laravel/lib/config/view.php new file mode 100644 index 0000000000..2acfd9cc9c --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/config/view.php @@ -0,0 +1,33 @@ + [ + resource_path('views'), + ], + + /* + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | + */ + + 'compiled' => realpath(storage_path('framework/views')), + +]; diff --git a/samples/server/petstore/php-laravel/lib/database/.gitignore b/samples/server/petstore/php-laravel/lib/database/.gitignore new file mode 100644 index 0000000000..9b1dffd90f --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/database/.gitignore @@ -0,0 +1 @@ +*.sqlite diff --git a/samples/server/petstore/php-laravel/lib/database/factories/UserFactory.php b/samples/server/petstore/php-laravel/lib/database/factories/UserFactory.php new file mode 100644 index 0000000000..facf2337b9 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/database/factories/UserFactory.php @@ -0,0 +1,23 @@ +define(App\User::class, function (Faker $faker) { + return [ + 'name' => $faker->name, + 'email' => $faker->unique()->safeEmail, + 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret + 'remember_token' => str_random(10), + ]; +}); diff --git a/samples/server/petstore/php-laravel/lib/database/migrations/2014_10_12_000000_create_users_table.php b/samples/server/petstore/php-laravel/lib/database/migrations/2014_10_12_000000_create_users_table.php new file mode 100644 index 0000000000..689cbeea47 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/database/migrations/2014_10_12_000000_create_users_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->string('name'); + $table->string('email')->unique(); + $table->string('password'); + $table->rememberToken(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('users'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/database/migrations/2014_10_12_100000_create_password_resets_table.php b/samples/server/petstore/php-laravel/lib/database/migrations/2014_10_12_100000_create_password_resets_table.php new file mode 100644 index 0000000000..0d5cb84502 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -0,0 +1,32 @@ +string('email')->index(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('password_resets'); + } +} diff --git a/samples/server/petstore/php-laravel/lib/database/seeds/DatabaseSeeder.php b/samples/server/petstore/php-laravel/lib/database/seeds/DatabaseSeeder.php new file mode 100644 index 0000000000..91cb6d1c2d --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/database/seeds/DatabaseSeeder.php @@ -0,0 +1,16 @@ +call(UsersTableSeeder::class); + } +} diff --git a/samples/server/petstore/php-laravel/lib/package.json b/samples/server/petstore/php-laravel/lib/package.json new file mode 100644 index 0000000000..e81ab87fb2 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/package.json @@ -0,0 +1,22 @@ +{ + "private": true, + "scripts": { + "dev": "npm run development", + "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "watch": "npm run development -- --watch", + "watch-poll": "npm run watch -- --watch-poll", + "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", + "prod": "npm run production", + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" + }, + "devDependencies": { + "axios": "^0.18", + "bootstrap": "^4.0.0", + "popper.js": "^1.12", + "cross-env": "^5.1", + "jquery": "^3.2", + "laravel-mix": "^2.0", + "lodash": "^4.17.4", + "vue": "^2.5.7" + } +} diff --git a/samples/server/petstore/php-laravel/lib/phpunit.xml b/samples/server/petstore/php-laravel/lib/phpunit.xml new file mode 100644 index 0000000000..c9e326b695 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/phpunit.xml @@ -0,0 +1,33 @@ + + + + + ./tests/Feature + + + + ./tests/Unit + + + + + ./app + + + + + + + + + + + diff --git a/samples/server/petstore/php-laravel/lib/public/.htaccess b/samples/server/petstore/php-laravel/lib/public/.htaccess new file mode 100644 index 0000000000..b75525bedc --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/public/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Handle Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/samples/server/petstore/php-laravel/lib/public/css/app.css b/samples/server/petstore/php-laravel/lib/public/css/app.css new file mode 100644 index 0000000000..8b4dc7e9e9 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/public/css/app.css @@ -0,0 +1,6 @@ +@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);/*! + * Bootstrap v4.0.0 (https://getbootstrap.com) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:"Raleway",sans-serif;--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:Raleway,sans-serif;font-size:.9rem;font-weight:400;line-height:1.6;color:#212529;text-align:left;background-color:#f5f8fa}[tabindex="-1"]:focus{outline:0!important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{font-style:normal;line-height:inherit}address,dl,ol,ul{margin-bottom:1rem}dl,ol,ul{margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]),a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.25rem}.h2,h2{font-size:1.8rem}.h3,h3{font-size:1.575rem}.h4,h4{font-size:1.35rem}.h5,h5{font-size:1.125rem}.h6,h6{font-size:.9rem}.lead{font-size:1.125rem;font-weight:300}.display-1{font-size:6rem}.display-1,.display-2{font-weight:300;line-height:1.2}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-3,.display-4{font-weight:300;line-height:1.2}.display-4{font-size:3.5rem}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.125rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer:before{content:"\2014 \A0"}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#f5f8fa;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-auto,.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-auto,.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-auto,.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1,.col-auto{-webkit-box-flex:0}.col-1{-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-2{-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-2,.col-3{-webkit-box-flex:0}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-4,.col-5{-webkit-box-flex:0}.col-5{-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-6,.col-7{-webkit-box-flex:0}.col-7{-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-8{-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-8,.col-9{-webkit-box-flex:0}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-10,.col-11{-webkit-box-flex:0}.col-11{-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.33333333%;flex:0 0 8.33333333%;max-width:8.33333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.66666667%;flex:0 0 16.66666667%;max-width:16.66666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.33333333%;flex:0 0 33.33333333%;max-width:33.33333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.66666667%;flex:0 0 41.66666667%;max-width:41.66666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.33333333%;flex:0 0 58.33333333%;max-width:58.33333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.66666667%;flex:0 0 66.66666667%;max-width:66.66666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.33333333%;flex:0 0 83.33333333%;max-width:83.33333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.66666667%;flex:0 0 91.66666667%;max-width:91.66666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table .table{background-color:#f5f8fa}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover,.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover,.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover,.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover,.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover,.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover,.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#f5f8fa;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#f5f8fa;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:hsla(0,0%,100%,.05)}.table-dark.table-hover tbody tr:hover{background-color:hsla(0,0%,100%,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:.9rem;line-height:1.6;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder,.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.19rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.6}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.125rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.7875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.6;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.input-group-append>.form-control-plaintext.btn,.input-group-lg>.input-group-append>.form-control-plaintext.input-group-text,.input-group-lg>.input-group-prepend>.form-control-plaintext.btn,.input-group-lg>.input-group-prepend>.form-control-plaintext.input-group-text,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.input-group-append>.form-control-plaintext.btn,.input-group-sm>.input-group-append>.form-control-plaintext.input-group-text,.input-group-sm>.input-group-prepend>.form-control-plaintext.btn,.input-group-sm>.input-group-prepend>.form-control-plaintext.input-group-text{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.7875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.68125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.125rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.6875rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(40,167,69,.8);border-radius:.2rem}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.25);box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{background-color:#71dd8a}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{-webkit-box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(40,167,69,.25);box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(40,167,69,.25)}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label:before,.was-validated .custom-file-input:valid~.custom-file-label:before{border-color:inherit}.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip{display:block}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.25);box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(220,53,69,.8);border-radius:.2rem}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.25);box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label:before,.was-validated .custom-control-input:invalid~.custom-control-label:before{background-color:#efa2a9}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid:checked~.custom-control-label:before,.was-validated .custom-control-input:invalid:checked~.custom-control-label:before{background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label:before,.was-validated .custom-control-input:invalid:focus~.custom-control-label:before{-webkit-box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(220,53,69,.25);box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(220,53,69,.25)}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label:before,.was-validated .custom-file-input:invalid~.custom-file-label:before{border-color:inherit}.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip{display:block}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.25);box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .form-group,.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;align-items:center;margin-bottom:0}.form-inline .form-group{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:.9rem;line-height:1.6;border-radius:.25rem;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}.btn:not(:disabled):not(.disabled).active,.btn:not(:disabled):not(.disabled):active{background-image:none}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-primary{color:#007bff;background-color:transparent;background-image:none;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.5);box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;background-color:transparent;background-image:none;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5);box-shadow:0 0 0 .2rem hsla(208,7%,46%,.5)}.btn-outline-success{color:#28a745;background-color:transparent;background-image:none;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(40,167,69,.5);box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;background-color:transparent;background-image:none;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(23,162,184,.5);box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;background-color:transparent;background-image:none;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(255,193,7,.5);box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;background-color:transparent;background-image:none;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(220,53,69,.5);box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(248,249,250,.5);box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 .2rem rgba(52,58,64,.5);box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;background-color:transparent}.btn-link:hover{color:#0056b3;background-color:transparent}.btn-link.focus,.btn-link:focus,.btn-link:hover{text-decoration:underline;border-color:transparent}.btn-link.focus,.btn-link:focus{-webkit-box-shadow:none;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.125rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.7875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.show{opacity:1}.collapse{display:none}.collapse.show{display:block}tr.collapse.show{display:table-row}tbody.collapse.show{display:table-row-group}.collapsing{height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}.collapsing,.dropdown,.dropup{position:relative}.dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:.9rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropup .dropdown-menu{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-menu{margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-toggle:after{vertical-align:0}.dropleft .dropdown-menu{margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle:after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropleft .dropdown-toggle:before{display:inline-block;width:0;height:0;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty:after{margin-left:0}.dropleft .dropdown-toggle:before{vertical-align:0}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.7875rem;color:#6c757d;white-space:nowrap}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group,.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split:after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio],.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file:focus,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label:before{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:first-child) .custom-file-label:before{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:.9rem;font-weight:400;line-height:1.6;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.6rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label:before{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-label:before{-webkit-box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 1px #f5f8fa,0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:active~.custom-control-label:before{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label:before{background-color:#e9ecef}.custom-control-label{margin-bottom:0}.custom-control-label:before{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#dee2e6}.custom-control-label:after,.custom-control-label:before{position:absolute;top:.3rem;left:0;display:block;width:1rem;height:1rem;content:""}.custom-control-label:after{background-repeat:no-repeat;background-position:50%;background-size:50% 50%}.custom-checkbox .custom-control-label:before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label:before{background-color:#007bff}.custom-checkbox .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:before{background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label:before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label:before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(2.19rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.6;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 5px rgba(128,189,255,.5);box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 5px rgba(128,189,255,.5)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.68125rem + 2px);font-size:75%}.custom-select-lg,.custom-select-sm{padding-top:.375rem;padding-bottom:.375rem}.custom-select-lg{height:calc(2.6875rem + 2px);font-size:125%}.custom-file{display:inline-block;margin-bottom:0}.custom-file,.custom-file-input{position:relative;width:100%;height:calc(2.19rem + 2px)}.custom-file-input{z-index:2;margin:0;opacity:0}.custom-file-input:focus~.custom-file-control{border-color:#80bdff;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:focus~.custom-file-control:before{border-color:#80bdff}.custom-file-input:lang(en)~.custom-file-label:after{content:"Browse"}.custom-file-label{left:0;z-index:1;height:calc(2.19rem + 2px);background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label,.custom-file-label:after{position:absolute;top:0;right:0;padding:.375rem .75rem;line-height:1.6;color:#495057}.custom-file-label:after{bottom:0;z-index:3;display:block;height:calc((2.19rem + 2px) - 1px * 2);content:"Browse";background-color:#e9ecef;border-left:1px solid #ced4da;border-radius:0 .25rem .25rem 0}.nav{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#f5f8fa;border-color:#dee2e6 #dee2e6 #f5f8fa}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar,.navbar>.container,.navbar>.container-fluid{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.32rem;padding-bottom:.32rem;margin-right:1rem;font-size:1.125rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.125rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler:not(:disabled):not(.disabled){cursor:pointer}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat 50%;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm,.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md,.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg,.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl,.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .dropup .dropdown-menu{top:auto;bottom:100%}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .dropup .dropdown-menu{top:auto;bottom:100%}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:hsla(0,0%,100%,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:hsla(0,0%,100%,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:hsla(0,0%,100%,.5);border-color:hsla(0,0%,100%,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem}.card-subtitle,.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.75rem;border-bottom:0}.card-header-pills,.card-header-tabs{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-webkit-box-orient:horizontal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck,.card-deck .card{-webkit-box-direction:normal}.card-deck .card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:first-child .card-header,.card-group>.card:first-child .card-img-top{border-top-right-radius:0}.card-group>.card:first-child .card-footer,.card-group>.card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:last-child .card-header,.card-group>.card:last-child .card-img-top{border-top-left-radius:0}.card-group>.card:last-child .card-footer,.card-group>.card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.25rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child),.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item:before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover:before{text-decoration:underline;text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-link:not(:disabled):not(.disabled){cursor:pointer}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.125rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.7875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#6c757d}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#545b62}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#212529;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#212529;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3.85rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}.progress{height:1rem;overflow:hidden;font-size:.675rem;background-color:#e9ecef;border-radius:.25rem}.progress,.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex}.progress-bar{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;background-color:#007bff;-webkit-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{z-index:1;text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.35rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}.close:not(:disabled):not(.disabled){cursor:pointer}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}.modal,.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;outline:0}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translateY(-25%);transform:translateY(-25%)}.modal.show .modal-dialog{-webkit-transform:translate(0);transform:translate(0)}.modal-dialog-centered{-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-content,.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex}.modal-content{position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.6}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.7875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow:before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow:before,.bs-tooltip-top .arrow:before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow:before,.bs-tooltip-right .arrow:before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow:before,.bs-tooltip-bottom .arrow:before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow:before,.bs-tooltip-left .arrow:before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{top:0;left:0;z-index:1060;max-width:276px;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.7875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover,.popover .arrow{position:absolute;display:block}.popover .arrow{width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow:after,.popover .arrow:before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow:after,.bs-popover-auto[x-placement^=top] .arrow:before,.bs-popover-top .arrow:after,.bs-popover-top .arrow:before{border-width:.5rem .5rem 0}.bs-popover-auto[x-placement^=top] .arrow:before,.bs-popover-top .arrow:before{bottom:0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top] .arrow:after,.bs-popover-top .arrow:after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right] .arrow:after,.bs-popover-auto[x-placement^=right] .arrow:before,.bs-popover-right .arrow:after,.bs-popover-right .arrow:before{border-width:.5rem .5rem .5rem 0}.bs-popover-auto[x-placement^=right] .arrow:before,.bs-popover-right .arrow:before{left:0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right] .arrow:after,.bs-popover-right .arrow:after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow:after,.bs-popover-auto[x-placement^=bottom] .arrow:before,.bs-popover-bottom .arrow:after,.bs-popover-bottom .arrow:before{border-width:0 .5rem .5rem}.bs-popover-auto[x-placement^=bottom] .arrow:before,.bs-popover-bottom .arrow:before{top:0;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom] .arrow:after,.bs-popover-bottom .arrow:after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header:before,.bs-popover-bottom .popover-header:before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left] .arrow:after,.bs-popover-auto[x-placement^=left] .arrow:before,.bs-popover-left .arrow:after,.bs-popover-left .arrow:before{border-width:.5rem 0 .5rem .5rem}.bs-popover-auto[x-placement^=left] .arrow:before,.bs-popover-left .arrow:before{right:0;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left] .arrow:after,.bs-popover-left .arrow:after{right:1px;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:.9rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;-webkit-transition:-webkit-transform .6s ease;transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateZ(0);transform:translateZ(0)}}.active.carousel-item-right,.carousel-item-next{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-right,.carousel-item-next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat 50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:hsla(0,0%,100%,.5)}.carousel-indicators li:before{top:-10px}.carousel-indicators li:after,.carousel-indicators li:before{position:absolute;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li:after{bottom:-10px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important}.rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0!important}.clearfix:after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive:before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9:before{padding-top:42.85714286%}.embed-responsive-16by9:before{padding-top:56.25%}.embed-responsive-4by3:before{padding-top:75%}.embed-responsive-1by1:before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-column,.flex-row{-webkit-box-direction:normal!important}.flex-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-webkit-box-orient:horizontal!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse,.flex-row-reverse{-webkit-box-direction:reverse!important}.flex-column-reverse{-webkit-box-orient:vertical!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column,.flex-sm-row{-webkit-box-direction:normal!important}.flex-sm-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column,.flex-md-row{-webkit-box-direction:normal!important}.flex-md-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column,.flex-lg-row{-webkit-box-direction:normal!important}.flex-lg-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-webkit-box-orient:horizontal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column,.flex-xl-row{-webkit-box-direction:normal!important}.flex-xl-column{-webkit-box-orient:vertical!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{top:0}.fixed-bottom,.fixed-top{position:fixed;right:0;left:0;z-index:1030}.fixed-bottom{bottom:0}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;-webkit-clip-path:inset(50%);clip-path:inset(50%);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;-webkit-clip-path:none;clip-path:none}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#545b62!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-muted{color:#6c757d!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,:after,:before{text-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]:after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}.container,body{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.navbar-laravel{background-color:#fff;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.04);box-shadow:0 2px 4px rgba(0,0,0,.04)} \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/public/favicon.ico b/samples/server/petstore/php-laravel/lib/public/favicon.ico new file mode 100644 index 0000000000..e69de29bb2 diff --git a/samples/server/petstore/php-laravel/lib/public/index.php b/samples/server/petstore/php-laravel/lib/public/index.php new file mode 100644 index 0000000000..4584cbcd6a --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/public/index.php @@ -0,0 +1,60 @@ + + */ + +define('LARAVEL_START', microtime(true)); + +/* +|-------------------------------------------------------------------------- +| Register The Auto Loader +|-------------------------------------------------------------------------- +| +| Composer provides a convenient, automatically generated class loader for +| our application. We just need to utilize it! We'll simply require it +| into the script here so that we don't have to worry about manual +| loading any of our classes later on. It feels great to relax. +| +*/ + +require __DIR__.'/../vendor/autoload.php'; + +/* +|-------------------------------------------------------------------------- +| Turn On The Lights +|-------------------------------------------------------------------------- +| +| We need to illuminate PHP development, so let us turn on the lights. +| This bootstraps the framework and gets it ready for use, then it +| will load up this application so that we can run it and send +| the responses back to the browser and delight our users. +| +*/ + +$app = require_once __DIR__.'/../bootstrap/app.php'; + +/* +|-------------------------------------------------------------------------- +| Run The Application +|-------------------------------------------------------------------------- +| +| Once we have the application, we can handle the incoming request +| through the kernel, and send the associated response back to +| the client's browser allowing them to enjoy the creative +| and wonderful application we have prepared for them. +| +*/ + +$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); + +$response = $kernel->handle( + $request = Illuminate\Http\Request::capture() +); + +$response->send(); + +$kernel->terminate($request, $response); diff --git a/samples/server/petstore/php-laravel/lib/public/js/app.js b/samples/server/petstore/php-laravel/lib/public/js/app.js new file mode 100644 index 0000000000..c5d3189712 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/public/js/app.js @@ -0,0 +1 @@ +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=n(5),i=n(19),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(o)}),t.exports=u}).call(e,n(6))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n="undefined"!=typeof window&&"undefined"!=typeof document,r=["Edge","Trident","Firefox"],i=0,o=0;o=0){i=1;break}var a=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},i))}};function s(t){return t&&"[object Function]"==={}.toString.call(t)}function u(t,e){if(1!==t.nodeType)return[];var n=getComputedStyle(t,null);return e?n[e]:n}function c(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function l(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=u(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/(auto|scroll)/.test(n+i+r)?t:l(c(t))}function f(t){var e=t&&t.offsetParent,n=e&&e.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(e.nodeName)&&"static"===u(e,"position")?f(e):e:t?t.ownerDocument.documentElement:document.documentElement}function p(t){return null!==t.parentNode?p(t.parentNode):t}function d(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,i=n?e:t,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,u=o.commonAncestorContainer;if(t!==u&&e!==u||r.contains(i))return"BODY"===(s=(a=u).nodeName)||"HTML"!==s&&f(a.firstElementChild)!==a?f(u):u;var c=p(t);return c.host?d(c.host,e):d(t,p(e).host)}function h(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var r=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||r)[e]}return t[e]}function v(t,e){var n="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+r+"Width"],10)}var g=void 0,m=function(){return void 0===g&&(g=-1!==navigator.appVersion.indexOf("MSIE 10")),g};function y(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],m()?n["offset"+t]+r["margin"+("Height"===t?"Top":"Left")]+r["margin"+("Height"===t?"Bottom":"Right")]:0)}function _(){var t=document.body,e=document.documentElement,n=m()&&getComputedStyle(e);return{height:y("Height",t,e,n),width:y("Width",t,e,n)}}var b=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=h(e,"top"),i=h(e,"left"),o=n?-1:1;return t.top+=r*o,t.bottom+=r*o,t.left+=i*o,t.right+=i*o,t}(p,e)),p}function S(t,e,n,r){var i,o,a,s,f,p,v,g={top:0,left:0},m=d(t,e);if("viewport"===r)o=(i=m).ownerDocument.documentElement,a=A(i,o),s=Math.max(o.clientWidth,window.innerWidth||0),f=Math.max(o.clientHeight,window.innerHeight||0),p=h(o),v=h(o,"left"),g=T({top:p-a.top+a.marginTop,left:v-a.left+a.marginLeft,width:s,height:f});else{var y=void 0;"scrollParent"===r?"BODY"===(y=l(c(e))).nodeName&&(y=t.ownerDocument.documentElement):y="window"===r?t.ownerDocument.documentElement:r;var b=A(y,m);if("HTML"!==y.nodeName||function t(e){var n=e.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===u(e,"position")||t(c(e)))}(m))g=b;else{var w=_(),x=w.height,C=w.width;g.top+=b.top-b.marginTop,g.bottom=x+b.top,g.left+=b.left-b.marginLeft,g.right=C+b.left}}return g.left+=n,g.top+=n,g.right-=n,g.bottom-=n,g}function k(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=S(n,r,o,i),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},u=Object.keys(s).map(function(t){return C({key:t},s[t],{area:(e=s[t],e.width*e.height)});var e}).sort(function(t,e){return e.area-t.area}),c=u.filter(function(t){var e=t.width,r=t.height;return e>=n.clientWidth&&r>=n.clientHeight}),l=c.length>0?c[0].key:u[0].key,f=t.split("-")[1];return l+(f?"-"+f:"")}function O(t,e,n){return A(n,d(e,n))}function D(t){var e=getComputedStyle(t),n=parseFloat(e.marginTop)+parseFloat(e.marginBottom),r=parseFloat(e.marginLeft)+parseFloat(e.marginRight);return{width:t.offsetWidth+r,height:t.offsetHeight+n}}function I(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function N(t,e,n){n=n.split("-")[0];var r=D(t),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",c=o?"width":"height";return i[a]=e[a]+e[u]/2-r[u]/2,i[s]=n===s?e[s]-r[c]:e[I(s)],i}function j(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function L(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var r=j(t,function(t){return t[e]===n});return t.indexOf(r)}(t,"name",n))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&s(n)&&(e.offsets.popper=T(e.offsets.popper),e.offsets.reference=T(e.offsets.reference),e=n(e,t))}),e}function $(t,e){return t.some(function(t){var n=t.name;return t.enabled&&n===e})}function R(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=U.indexOf(t),r=U.slice(n+1).concat(U.slice(0,n));return e?r.reverse():r}var V={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function K(t,e,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=t.split(/(\+|\-)/).map(function(t){return t.trim()}),s=a.indexOf(j(a,function(t){return-1!==t.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(c=c.map(function(t,r){var i=(1===r?!o:o)?"height":"width",a=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)},[]).map(function(t){return function(t,e,n,r){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return t;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return T(s)[e]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(t,i,e,n)})})).forEach(function(t,e){t.forEach(function(n,r){H(n)&&(i[e]+=n*("-"===t[r-1]?-1:1))})}),i}var Q={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",c=s?"width":"height",l={start:x({},u,o[u]),end:x({},u,o[u]+o[c]-a[c])};t.offsets.popper=C({},a,l[r])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,r=t.placement,i=t.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return u=H(+n)?[+n,0]:K(n,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||f(t.instance.popper);t.instance.reference===n&&(n=f(n));var r=S(t.instance.popper,t.instance.reference,e.padding,n);e.boundaries=r;var i=e.priority,o=t.offsets.popper,a={primary:function(t){var n=o[t];return o[t]r[t]&&!e.escapeWithReference&&(i=Math.min(o[n],r[t]-("right"===t?o.width:o.height))),x({},n,i)}};return i.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";o=C({},o,a[e](t))}),t.offsets.popper=o,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(t.offsets.popper[u]=o(r[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!W(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if("string"==typeof r){if(!(r=t.instance.popper.querySelector(r)))return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],o=t.offsets,a=o.popper,s=o.reference,c=-1!==["left","right"].indexOf(i),l=c?"height":"width",f=c?"Top":"Left",p=f.toLowerCase(),d=c?"left":"top",h=c?"bottom":"right",v=D(r)[l];s[h]-va[h]&&(t.offsets.popper[p]+=s[p]+v-a[h]),t.offsets.popper=T(t.offsets.popper);var g=s[p]+s[l]/2-v/2,m=u(t.instance.popper),y=parseFloat(m["margin"+f],10),_=parseFloat(m["border"+f+"Width"],10),b=g-t.offsets.popper[p]-y-_;return b=Math.max(Math.min(a[l]-v,b),0),t.arrowElement=r,t.offsets.arrow=(x(n={},p,Math.round(b)),x(n,d,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if($(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=S(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement),r=t.placement.split("-")[0],i=I(r),o=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case V.FLIP:a=[r,i];break;case V.CLOCKWISE:a=z(r);break;case V.COUNTERCLOCKWISE:a=z(r,!0);break;default:a=e.behavior}return a.forEach(function(s,u){if(r!==s||a.length===u+1)return t;r=t.placement.split("-")[0],i=I(r);var c,l=t.offsets.popper,f=t.offsets.reference,p=Math.floor,d="left"===r&&p(l.right)>p(f.left)||"right"===r&&p(l.left)p(f.top)||"bottom"===r&&p(l.top)p(n.right),g=p(l.top)p(n.bottom),y="left"===r&&h||"right"===r&&v||"top"===r&&g||"bottom"===r&&m,_=-1!==["top","bottom"].indexOf(r),b=!!e.flipVariations&&(_&&"start"===o&&h||_&&"end"===o&&v||!_&&"start"===o&&g||!_&&"end"===o&&m);(d||y||b)&&(t.flipped=!0,(d||y)&&(r=a[u+1]),b&&(o="end"===(c=o)?"start":"start"===c?"end":c),t.placement=r+(o?"-"+o:""),t.offsets.popper=C({},t.offsets.popper,N(t.instance.popper,t.offsets.reference,t.placement)),t=L(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),t.placement=I(e),t.offsets.popper=T(i),t}},hide:{order:800,enabled:!0,fn:function(t){if(!W(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=j(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};b(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=C({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(C({},t.Defaults.modifiers,i.modifiers)).forEach(function(e){r.options.modifiers[e]=C({},t.Defaults.modifiers[e]||{},i.modifiers?i.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return C({name:t},r.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&s(t.onLoad)&&t.onLoad(r.reference,r.popper,r.options,t,r.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return w(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=O(this.state,this.popper,this.reference),t.placement=k(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.offsets.popper=N(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position="absolute",t=L(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,$(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[R("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=M(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),t}();G.Utils=("undefined"!=typeof window?window:t).PopperUtils,G.placements=q,G.Defaults=Q,e.default=G}.call(e,n(1))},function(t,e,n){var r;!function(e,n){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],a=n.document,s=Object.getPrototypeOf,u=o.slice,c=o.concat,l=o.push,f=o.indexOf,p={},d=p.toString,h=p.hasOwnProperty,v=h.toString,g=v.call(Object),m={};function y(t,e){var n=(e=e||a).createElement("script");n.text=t,e.head.appendChild(n).parentNode.removeChild(n)}var _=function(t,e){return new _.fn.init(t,e)},b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^-ms-/,x=/-([a-z])/g,C=function(t,e){return e.toUpperCase()};function T(t){var e=!!t&&"length"in t&&t.length,n=_.type(t);return"function"!==n&&!_.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}_.fn=_.prototype={jquery:"3.2.1",constructor:_,length:0,toArray:function(){return u.call(this)},get:function(t){return null==t?u.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),U=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),z=new RegExp(F),V=new RegExp("^"+P+"$"),K={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+$+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),tt=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,nt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},rt=function(){p()},it=yt(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{N.apply(O=j.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(t){N={apply:O.length?function(t,e){I.apply(t,j.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function ot(t,e,r,i){var o,s,c,l,f,h,m,y=e&&e.ownerDocument,x=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return r;if(!i&&((e?e.ownerDocument||e:w)!==d&&p(e),e=e||d,v)){if(11!==x&&(f=X.exec(t)))if(o=f[1]){if(9===x){if(!(c=e.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(y&&(c=y.getElementById(o))&&_(e,c)&&c.id===o)return r.push(c),r}else{if(f[2])return N.apply(r,e.getElementsByTagName(t)),r;if((o=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return N.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!A[t+" "]&&(!g||!g.test(t))){if(1!==x)y=e,m=t;else if("object"!==e.nodeName.toLowerCase()){for((l=e.getAttribute("id"))?l=l.replace(et,nt):e.setAttribute("id",l=b),s=(h=a(t)).length;s--;)h[s]="#"+l+" "+mt(h[s]);m=h.join(","),y=J.test(t)&&vt(e.parentNode)||e}if(m)try{return N.apply(r,y.querySelectorAll(m)),r}catch(t){}finally{l===b&&e.removeAttribute("id")}}}return u(t.replace(B,"$1"),e,r,i)}function at(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function st(t){return t[b]=!0,t}function ut(t){var e=d.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ct(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function lt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function dt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&it(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ht(t){return st(function(e){return e=+e,st(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}n=ot.support={},o=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},p=ot.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:w;return a!==d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,v=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",rt,!1):i.attachEvent&&i.attachEvent("onunload",rt)),n.attributes=ut(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=ut(function(t){return t.appendChild(d.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(d.getElementsByClassName),n.getById=ut(function(t){return h.appendChild(t).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&v)return e.getElementsByClassName(t)},m=[],g=[],(n.qsa=Y.test(d.querySelectorAll))&&(ut(function(t){h.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+R+"*(?:value|"+$+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]")}),ut(function(t){t.innerHTML="";var e=d.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Y.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ut(function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),m.push("!=",F)}),g=g.length&&new RegExp(g.join("|")),m=m.length&&new RegExp(m.join("|")),e=Y.test(h.compareDocumentPosition),_=e||Y.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},S=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t===d||t.ownerDocument===w&&_(w,t)?-1:e===d||e.ownerDocument===w&&_(w,e)?1:l?L(l,t)-L(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t===d?-1:e===d?1:i?-1:o?1:l?L(l,t)-L(l,e):0;if(i===o)return lt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?lt(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==d&&p(t),e=e.replace(U,"='$1']"),n.matchesSelector&&v&&!A[e+" "]&&(!m||!m.test(e))&&(!g||!g.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){}return ot(e,d,null,[t]).length>0},ot.contains=function(t,e){return(t.ownerDocument||t)!==d&&p(t),_(t,e)},ot.attr=function(t,e){(t.ownerDocument||t)!==d&&p(t);var i=r.attrHandle[e.toLowerCase()],o=i&&k.call(r.attrHandle,e.toLowerCase())?i(t,e,!v):void 0;return void 0!==o?o:n.attributes||!v?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ot.escape=function(t){return(t+"").replace(et,nt)},ot.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ot.uniqueSort=function(t){var e,r=[],i=0,o=0;if(f=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort(S),f){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return l=null,t},i=ot.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=ot.selectors={cacheLength:50,createPseudo:st,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,tt),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return K.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&z.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=T[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&T(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var i=ot.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var c,l,f,p,d,h,v=o!==a?"nextSibling":"previousSibling",g=e.parentNode,m=s&&e.nodeName.toLowerCase(),y=!u&&!s,_=!1;if(g){if(o){for(;v;){for(p=e;p=p[v];)if(s?p.nodeName.toLowerCase()===m:1===p.nodeType)return!1;h=v="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(_=(d=(c=(l=(f=(p=g)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[t]||[])[0]===x&&c[1])&&c[2],p=d&&g.childNodes[d];p=++d&&p&&p[v]||(_=d=0)||h.pop();)if(1===p.nodeType&&++_&&p===e){l[t]=[x,d,_];break}}else if(y&&(_=d=(c=(l=(f=(p=e)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[t]||[])[0]===x&&c[1]),!1===_)for(;(p=++d&&p&&p[v]||(_=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==m:1!==p.nodeType)||!++_||(y&&((l=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[t]=[x,_]),p!==e)););return(_-=i)===r||_%r==0&&_/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||ot.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?st(function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=L(t,o[a])]=!(n[r]=o[a])}):function(t){return i(t,0,n)}):i}},pseudos:{not:st(function(t){var e=[],n=[],r=s(t.replace(B,"$1"));return r[b]?st(function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:st(function(t){return function(e){return ot(t,e).length>0}}),contains:st(function(t){return t=t.replace(Z,tt),function(e){return(e.textContent||e.innerText||i(e)).indexOf(t)>-1}}),lang:st(function(t){return V.test(t||"")||ot.error("unsupported lang: "+t),t=t.replace(Z,tt).toLowerCase(),function(e){var n;do{if(n=v?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:dt(!1),disabled:dt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return G.test(t.nodeName)},input:function(t){return Q.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:ht(function(){return[0]}),last:ht(function(t,e){return[e-1]}),eq:ht(function(t,e,n){return[n<0?n+e:n]}),even:ht(function(t,e){for(var n=0;n=0;)t.push(r);return t}),gt:ht(function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function bt(t,e,n,r,i){for(var o,a=[],s=0,u=t.length,c=null!=e;s-1&&(o[c]=!(a[c]=f))}}else m=bt(m===a?m.splice(h,m.length):m),i?i(null,a,m,u):N.apply(a,m)})}function xt(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],u=a?1:0,l=yt(function(t){return t===e},s,!0),f=yt(function(t){return L(e,t)>-1},s,!0),p=[function(t,n,r){var i=!a&&(r||n!==c)||((e=n).nodeType?l(t,n,r):f(t,n,r));return e=null,i}];u1&&_t(p),u>1&&mt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(B,"$1"),n,u0,u=i.length>0,l=function(t,e,n,a,l){var f,h,g,m=0,y="0",_=t&&[],b=[],w=c,C=t||u&&r.find.TAG("*",l),T=x+=null==w?1:Math.random()||.1,E=C.length;for(l&&(c=e===d||e||l);y!==E&&null!=(f=C[y]);y++){if(u&&f){for(h=0,e||f.ownerDocument===d||(p(f),n=!v);g=i[h++];)if(g(f,e||d,n)){a.push(f);break}l&&(x=T)}s&&((f=!g&&f)&&m--,t&&_.push(f))}if(m+=y,s&&y!==m){for(h=0;g=o[h++];)g(_,b,e,n);if(t){if(m>0)for(;y--;)_[y]||b[y]||(b[y]=D.call(a));b=bt(b)}N.apply(a,b),l&&!t&&b.length>0&&m+o.length>1&&ot.uniqueSort(a)}return l&&(x=T,c=w),_},s?st(l):l))).selector=t}return g},u=ot.select=function(t,e,n,i){var o,u,c,l,f,p="function"==typeof t&&t,d=!i&&a(t=p.selector||t);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&9===e.nodeType&&v&&r.relative[u[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(Z,tt),e)||[])[0]))return n;p&&(e=e.parentNode),t=t.slice(u.shift().value.length)}for(o=K.needsContext.test(t)?0:u.length;o--&&(c=u[o],!r.relative[l=c.type]);)if((f=r.find[l])&&(i=f(c.matches[0].replace(Z,tt),J.test(u[0].type)&&vt(e.parentNode)||e))){if(u.splice(o,1),!(t=i.length&&mt(u)))return N.apply(n,i),n;break}}return(p||s(t,d))(i,e,!v,n,!e||J.test(t)&&vt(e.parentNode)||e),n},n.sortStable=b.split("").sort(S).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ut(function(t){return 1&t.compareDocumentPosition(d.createElement("fieldset"))}),ut(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||ct("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&ut(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ct("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ut(function(t){return null==t.getAttribute("disabled")})||ct($,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),ot}(n);_.find=E,_.expr=E.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=E.uniqueSort,_.text=E.getText,_.isXMLDoc=E.isXML,_.contains=E.contains,_.escapeSelector=E.escape;var A=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&_(t).is(n))break;r.push(t)}return r},S=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},k=_.expr.match.needsContext;function O(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,I=/^.[^:#\[\.,]*$/;function N(t,e,n){return _.isFunction(e)?_.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?_.grep(t,function(t){return t===e!==n}):"string"!=typeof e?_.grep(t,function(t){return f.call(e,t)>-1!==n}):I.test(e)?_.filter(e,t,n):(e=_.filter(e,t),_.grep(t,function(t){return f.call(e,t)>-1!==n&&1===t.nodeType}))}_.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?_.find.matchesSelector(r,t)?[r]:[]:_.find.matches(t,_.grep(e,function(t){return 1===t.nodeType}))},_.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(_(t).filter(function(){for(e=0;e1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(N(this,t||[],!1))},not:function(t){return this.pushStack(N(this,t||[],!0))},is:function(t){return!!N(this,"string"==typeof t&&k.test(t)?_(t):t||[],!1).length}});var j,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||j,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:L.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:a,!0)),D.test(r[1])&&_.isPlainObject(e))for(r in e)_.isFunction(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):_.isFunction(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,j=_(a);var $=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function P(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&_.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?f.call(_(t),this[0]):f.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return A(t,"parentNode")},parentsUntil:function(t,e,n){return A(t,"parentNode",n)},next:function(t){return P(t,"nextSibling")},prev:function(t){return P(t,"previousSibling")},nextAll:function(t){return A(t,"nextSibling")},prevAll:function(t){return A(t,"previousSibling")},nextUntil:function(t,e,n){return A(t,"nextSibling",n)},prevUntil:function(t,e,n){return A(t,"previousSibling",n)},siblings:function(t){return S((t.parentNode||{}).firstChild,t)},children:function(t){return S(t.firstChild)},contents:function(t){return O(t,"iframe")?t.contentDocument:(O(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},function(t,e){_.fn[t]=function(n,r){var i=_.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=_.filter(r,i)),this.length>1&&(R[t]||_.uniqueSort(i),$.test(t)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function F(t){return t}function H(t){throw t}function B(t,e,n,r){var i;try{t&&_.isFunction(i=t.promise)?i.call(t).done(e).fail(n):t&&_.isFunction(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){var e,n;t="string"==typeof t?(e=t,n={},_.each(e.match(M)||[],function(t,e){n[e]=!0}),n):_.extend({},t);var r,i,o,a,s=[],u=[],c=-1,l=function(){for(a=a||t.once,o=r=!0;u.length;c=-1)for(i=u.shift();++c-1;)s.splice(n,1),n<=c&&c--}),this},has:function(t){return t?_.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=i="",this},disabled:function(){return!s},lock:function(){return a=u=[],i||r||(s=i=""),this},locked:function(){return!!a},fireWith:function(t,e){return a||(e=[t,(e=e||[]).slice?e.slice():e],u.push(e),r||l()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return _.Deferred(function(n){_.each(e,function(e,r){var i=_.isFunction(t[r[4]])&&t[r[4]];o[r[1]](function(){var t=i&&i.apply(this,arguments);t&&_.isFunction(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,u=arguments,c=function(){var n,c;if(!(t=o&&(r!==H&&(s=void 0,u=[n]),e.rejectWith(s,u))}};t?l():(_.Deferred.getStackHook&&(l.stackTrace=_.Deferred.getStackHook()),n.setTimeout(l))}}return _.Deferred(function(n){e[0][3].add(a(0,n,_.isFunction(i)?i:F,n.notifyWith)),e[1][3].add(a(0,n,_.isFunction(t)?t:F)),e[2][3].add(a(0,n,_.isFunction(r)?r:H))}).promise()},promise:function(t){return null!=t?_.extend(t,i):i}},o={};return _.each(e,function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},e[3-t][2].disable,e[0][2].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=u.call(arguments),o=_.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?u.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(B(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||_.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)B(i[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&W.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout(function(){throw t})};var q=_.Deferred();function U(){a.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),_.ready()}_.fn.ready=function(t){return q.then(t).catch(function(t){_.readyException(t)}),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||q.resolveWith(a,[_]))}}),_.ready.then=q.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(_.ready):(a.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var z=function(t,e,n,r,i,o,a){var s=0,u=t.length,c=null==n;if("object"===_.type(n)){i=!0;for(s in n)z(t,e,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,_.isFunction(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each(function(){G.remove(this,t)})}}),_.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Q.get(t,e),n&&(!r||Array.isArray(n)?r=Q.access(t,e,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),r=n.length,i=n.shift(),o=_._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,function(){_.dequeue(t,e)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Q.get(t,n)||Q.access(t,n,{empty:_.Callbacks("once memory").add(function(){Q.remove(t,[e+"queue",n])})})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]+)/i,ct=/^$|\/(?:java|ecma)script/i,lt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ft(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&O(t,e)?_.merge([t],n):n}function pt(t,e){for(var n=0,r=t.length;n-1)i&&i.push(o);else if(c=_.contains(o.ownerDocument,o),a=ft(f.appendChild(o),"script"),c&&pt(a),n)for(l=0;o=a[l++];)ct.test(o.type||"")&&n.push(o);return f}dt=a.createDocumentFragment().appendChild(a.createElement("div")),(ht=a.createElement("input")).setAttribute("type","radio"),ht.setAttribute("checked","checked"),ht.setAttribute("name","t"),dt.appendChild(ht),m.checkClone=dt.cloneNode(!0).cloneNode(!0).lastChild.checked,dt.innerHTML="",m.noCloneChecked=!!dt.cloneNode(!0).lastChild.defaultValue;var mt=a.documentElement,yt=/^key/,_t=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,bt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function xt(){return!1}function Ct(){try{return a.activeElement}catch(t){}}function Tt(t,e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=void 0);for(s in e)Tt(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=xt;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return _().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=_.guid++)),t.each(function(){_.event.add(this,e,i,r,n)})}_.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,c,l,f,p,d,h,v,g=Q.get(t);if(g)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&_.find.matchesSelector(mt,i),n.guid||(n.guid=_.guid++),(u=g.events)||(u=g.events={}),(a=g.handle)||(a=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(M)||[""]).length;c--;)d=v=(s=bt.exec(e[c])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=_.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=_.event.special[d]||{},l=_.extend({type:d,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&_.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,l):p.push(l),_.event.global[d]=!0)},remove:function(t,e,n,r,i){var o,a,s,u,c,l,f,p,d,h,v,g=Q.hasData(t)&&Q.get(t);if(g&&(u=g.events)){for(c=(e=(e||"").match(M)||[""]).length;c--;)if(d=v=(s=bt.exec(e[c])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=_.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)l=p[o],!i&&v!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(o,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(t,l));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(t,h,g.handle)||_.removeEvent(t,d,g.handle),delete u[d])}else for(d in u)_.event.remove(t,d+e[c],n,r,!0);_.isEmptyObject(u)&&Q.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=_.event.fix(t),u=new Array(arguments.length),c=(Q.get(this,"events")||{})[s.type]||[],l=_.event.special[s.type]||{};for(u[0]=s,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:_.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,At=/\s*$/g;function Dt(t,e){return O(t,"table")&&O(11!==e.nodeType?e:e.firstChild,"tr")&&_(">tbody",t)[0]||t}function It(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Nt(t){var e=kt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function jt(t,e){var n,r,i,o,a,s,u,c;if(1===e.nodeType){if(Q.hasData(t)&&(o=Q.access(t),a=Q.set(e,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(n=0,r=c[i].length;n1&&"string"==typeof h&&!m.checkClone&&St.test(h))return t.each(function(i){var o=t.eq(i);v&&(e[0]=h.call(this,i,o.html())),Lt(o,e,n,r)});if(p&&(o=(i=gt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=_.map(ft(i,"script"),It)).length;f")},clone:function(t,e,n){var r,i,o,a,s,u,c,l=t.cloneNode(!0),f=_.contains(t.ownerDocument,t);if(!(m.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||_.isXMLDoc(t)))for(a=ft(l),r=0,i=(o=ft(t)).length;r0&&pt(a,!f&&ft(t,"script")),l},cleanData:function(t){for(var e,n,r,i=_.event.special,o=0;void 0!==(n=t[o]);o++)if(V(n)){if(e=n[Q.expando]){if(e.events)for(r in e.events)i[r]?_.event.remove(n,r):_.removeEvent(n,r,e.handle);n[Q.expando]=void 0}n[G.expando]&&(n[G.expando]=void 0)}}}),_.fn.extend({detach:function(t){return $t(this,t,!0)},remove:function(t){return $t(this,t)},text:function(t){return z(this,function(t){return void 0===t?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Lt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Dt(this,t).appendChild(t)})},prepend:function(){return Lt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Dt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Lt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Lt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(ft(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return _.clone(this,t,e)})},html:function(t){return z(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!lt[(ut.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n1)}}),_.Tween=Xt,Xt.prototype={constructor:Xt,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var t=Xt.propHooks[this.prop];return t&&t.get?t.get(this):Xt.propHooks._default.get(this)},run:function(t){var e,n=Xt.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Xt.propHooks._default.set(this),this}},Xt.prototype.init.prototype=Xt.prototype,Xt.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[_.cssProps[t.prop]]&&!_.cssHooks[t.prop]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},Xt.propHooks.scrollTop=Xt.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=Xt.prototype.init,_.fx.step={};var Jt,Zt,te,ee,ne=/^(?:toggle|show|hide)$/,re=/queueHooks$/;function ie(){Zt&&(!1===a.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ie):n.setTimeout(ie,_.fx.interval),_.fx.tick())}function oe(){return n.setTimeout(function(){Jt=void 0}),Jt=_.now()}function ae(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=et[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function se(t,e,n){for(var r,i=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each(function(){_.removeAttr(this,t)})}}),_.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?_.prop(t,e,n):(1===o&&_.isXMLDoc(t)||(i=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&O(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(M);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(t,e){var n=le[e]||_.find.attr;le[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=le[a],le[a]=i,i=null!=n(t,e,r)?a:null,le[a]=o),i}});var fe=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function de(t){return(t.match(M)||[]).join(" ")}function he(t){return t.getAttribute&&t.getAttribute("class")||""}_.fn.extend({prop:function(t,e){return z(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[_.propFix[t]||t]})}}),_.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(t)||(e=_.propFix[e]||e,i=_.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):fe.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(_.isFunction(t))return this.each(function(e){_(this).addClass(t.call(this,e,he(this)))});if("string"==typeof t&&t)for(e=t.match(M)||[];n=this[u++];)if(i=he(n),r=1===n.nodeType&&" "+de(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=de(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(_.isFunction(t))return this.each(function(e){_(this).removeClass(t.call(this,e,he(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(M)||[];n=this[u++];)if(i=he(n),r=1===n.nodeType&&" "+de(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=de(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):_.isFunction(t)?this.each(function(n){_(this).toggleClass(t.call(this,n,he(this),e),e)}):this.each(function(){var e,r,i,o;if("string"===n)for(r=0,i=_(this),o=t.match(M)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else void 0!==t&&"boolean"!==n||((e=he(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Q.get(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+de(he(n))+" ").indexOf(e)>-1)return!0;return!1}});var ve=/\r/g;_.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=_.isFunction(t),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,_(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=_.map(i,function(t){return null==t?"":t+""})),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))})):i?(e=_.valHooks[i.type]||_.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ve,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:de(_.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},m.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var ge=/^(?:focusinfocus|focusoutblur)$/;_.extend(_.event,{trigger:function(t,e,r,i){var o,s,u,c,l,f,p,d=[r||a],v=h.call(t,"type")?t.type:t,g=h.call(t,"namespace")?t.namespace.split("."):[];if(s=u=r=r||a,3!==r.nodeType&&8!==r.nodeType&&!ge.test(v+_.event.triggered)&&(v.indexOf(".")>-1&&(v=(g=v.split(".")).shift(),g.sort()),l=v.indexOf(":")<0&&"on"+v,(t=t[_.expando]?t:new _.Event(v,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:_.makeArray(e,[t]),p=_.event.special[v]||{},i||!p.trigger||!1!==p.trigger.apply(r,e))){if(!i&&!p.noBubble&&!_.isWindow(r)){for(c=p.delegateType||v,ge.test(c+v)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(r.ownerDocument||a)&&d.push(u.defaultView||u.parentWindow||n)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)t.type=o>1?c:p.bindType||v,(f=(Q.get(s,"events")||{})[t.type]&&Q.get(s,"handle"))&&f.apply(s,e),(f=l&&s[l])&&f.apply&&V(s)&&(t.result=f.apply(s,e),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(d.pop(),e)||!V(r)||l&&_.isFunction(r[v])&&!_.isWindow(r)&&((u=r[l])&&(r[l]=null),_.event.triggered=v,r[v](),_.event.triggered=void 0,u&&(r[l]=u)),t.result}},simulate:function(t,e,n){var r=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(r,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each(function(){_.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){_.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),_.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),m.focusin="onfocusin"in n,m.focusin||_.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=Q.access(r,e);i||r.addEventListener(t,n,!0),Q.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Q.access(r,e)-1;i?Q.access(r,e,i):(r.removeEventListener(t,n,!0),Q.remove(r,e))}}});var me=n.location,ye=_.now(),_e=/\?/;_.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+t),e};var be=/\[\]$/,we=/\r?\n/g,xe=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;function Te(t,e,n,r){var i;if(Array.isArray(e))_.each(e,function(e,i){n||be.test(t)?r(t,i):Te(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)});else if(n||"object"!==_.type(e))r(t,e);else for(i in e)Te(t+"["+i+"]",e[i],n,r)}_.param=function(t,e){var n,r=[],i=function(t,e){var n=_.isFunction(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,function(){i(this.name,this.value)});else for(n in t)Te(n,t[n],e,i);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&Ce.test(this.nodeName)&&!xe.test(t)&&(this.checked||!st.test(t))}).map(function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(t){return{name:e.name,value:t.replace(we,"\r\n")}}):{name:e.name,value:n.replace(we,"\r\n")}}).get()}});var Ee=/%20/g,Ae=/#.*$/,Se=/([?&])_=[^&]*/,ke=/^(.*?):[ \t]*([^\r\n]*)$/gm,Oe=/^(?:GET|HEAD)$/,De=/^\/\//,Ie={},Ne={},je="*/".concat("*"),Le=a.createElement("a");function $e(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(M)||[];if(_.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Re(t,e,n,r){var i={},o=t===Ne;function a(s){var u;return i[s]=!0,_.each(t[s]||[],function(t,s){var c=s(e,n,r);return"string"!=typeof c||o||i[c]?o?!(u=c):void 0:(e.dataTypes.unshift(c),a(c),!1)}),u}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Pe(t,e){var n,r,i=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&_.extend(!0,t,r),t}Le.href=me.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:me.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(me.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Pe(Pe(t,_.ajaxSettings),e):Pe(_.ajaxSettings,t)},ajaxPrefilter:$e(Ie),ajaxTransport:$e(Ne),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,s,u,c,l,f,p,d,h=_.ajaxSetup({},e),v=h.context||h,g=h.context&&(v.nodeType||v.jquery)?_(v):_.event,m=_.Deferred(),y=_.Callbacks("once memory"),b=h.statusCode||{},w={},x={},C="canceled",T={readyState:0,getResponseHeader:function(t){var e;if(l){if(!s)for(s={};e=ke.exec(o);)s[e[1].toLowerCase()]=e[2];e=s[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(t,e){return null==l&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)T.always(t[T.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),E(0,e),this}};if(m.promise(T),h.url=((t||h.url||me.href)+"").replace(De,me.protocol+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){c=a.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Le.protocol+"//"+Le.host!=c.protocol+"//"+c.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=_.param(h.data,h.traditional)),Re(Ie,h,e,T),l)return T;(f=_.event&&h.global)&&0==_.active++&&_.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Oe.test(h.type),i=h.url.replace(Ae,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Ee,"+")):(d=h.url.slice(i.length),h.data&&(i+=(_e.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(Se,"$1"),d=(_e.test(i)?"&":"?")+"_="+ye+++d),h.url=i+d),h.ifModified&&(_.lastModified[i]&&T.setRequestHeader("If-Modified-Since",_.lastModified[i]),_.etag[i]&&T.setRequestHeader("If-None-Match",_.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&T.setRequestHeader("Content-Type",h.contentType),T.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+je+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)T.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(v,T,h)||l))return T.abort();if(C="abort",y.add(h.complete),T.done(h.success),T.fail(h.error),r=Re(Ne,h,e,T)){if(T.readyState=1,f&&g.trigger("ajaxSend",[T,h]),l)return T;h.async&&h.timeout>0&&(u=n.setTimeout(function(){T.abort("timeout")},h.timeout));try{l=!1,r.send(w,E)}catch(t){if(l)throw t;E(-1,t)}}else E(-1,"No Transport");function E(t,e,a,s){var c,p,d,w,x,C=e;l||(l=!0,u&&n.clearTimeout(u),r=void 0,o=s||"",T.readyState=t>0?4:0,c=t>=200&&t<300||304===t,a&&(w=function(t,e,n){for(var r,i,o,a,s=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(h,T,a)),w=function(t,e,n,r){var i,o,a,s,u,c={},l=t.dataTypes.slice();if(l[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=c[u+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(h,w,T,c),c?(h.ifModified&&((x=T.getResponseHeader("Last-Modified"))&&(_.lastModified[i]=x),(x=T.getResponseHeader("etag"))&&(_.etag[i]=x)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=w.state,p=w.data,c=!(d=w.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(e||C)+"",c?m.resolveWith(v,[p,C,T]):m.rejectWith(v,[T,C,d]),T.statusCode(b),b=void 0,f&&g.trigger(c?"ajaxSuccess":"ajaxError",[T,h,c?p:d]),y.fireWith(v,[T,C]),f&&(g.trigger("ajaxComplete",[T,h]),--_.active||_.event.trigger("ajaxStop")))}return T},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],function(t,e){_[e]=function(t,n,r,i){return _.isFunction(n)&&(i=i||r,r=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:i,data:n,success:r},_.isPlainObject(t)&&t))}}),_._evalUrl=function(t){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(_.isFunction(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return _.isFunction(t)?this.each(function(e){_(this).wrapInner(t.call(this,e))}):this.each(function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=_.isFunction(t);return this.each(function(n){_(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Me={0:200,1223:204},Fe=_.ajaxSettings.xhr();m.cors=!!Fe&&"withCredentials"in Fe,m.ajax=Fe=!!Fe,_.ajaxTransport(function(t){var e,r;if(m.cors||Fe&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Me[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){e&&r()})},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),_.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),_.ajaxTransport("script",function(t){var e,n;if(t.crossDomain)return{send:function(r,i){e=_(" diff --git a/samples/server/petstore/php-laravel/lib/resources/assets/sass/_variables.scss b/samples/server/petstore/php-laravel/lib/resources/assets/sass/_variables.scss new file mode 100644 index 0000000000..70ecfdb39d --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/assets/sass/_variables.scss @@ -0,0 +1,8 @@ + +// Body +$body-bg: #f5f8fa; + +// Typography +$font-family-sans-serif: "Raleway", sans-serif; +$font-size-base: 0.9rem; +$line-height-base: 1.6; diff --git a/samples/server/petstore/php-laravel/lib/resources/assets/sass/app.scss b/samples/server/petstore/php-laravel/lib/resources/assets/sass/app.scss new file mode 100644 index 0000000000..0077cb141b --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/assets/sass/app.scss @@ -0,0 +1,14 @@ + +// Fonts +@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); + +// Variables +@import "variables"; + +// Bootstrap +@import '~bootstrap/scss/bootstrap'; + +.navbar-laravel { + background-color: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); +} diff --git a/samples/server/petstore/php-laravel/lib/resources/lang/en/auth.php b/samples/server/petstore/php-laravel/lib/resources/lang/en/auth.php new file mode 100644 index 0000000000..e5506df290 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/lang/en/auth.php @@ -0,0 +1,19 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/samples/server/petstore/php-laravel/lib/resources/lang/en/pagination.php b/samples/server/petstore/php-laravel/lib/resources/lang/en/pagination.php new file mode 100644 index 0000000000..d481411877 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/lang/en/pagination.php @@ -0,0 +1,19 @@ + '« Previous', + 'next' => 'Next »', + +]; diff --git a/samples/server/petstore/php-laravel/lib/resources/lang/en/passwords.php b/samples/server/petstore/php-laravel/lib/resources/lang/en/passwords.php new file mode 100644 index 0000000000..e5544d2016 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/lang/en/passwords.php @@ -0,0 +1,22 @@ + 'Passwords must be at least six characters and match the confirmation.', + 'reset' => 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that e-mail address.", + +]; diff --git a/samples/server/petstore/php-laravel/lib/resources/lang/en/validation.php b/samples/server/petstore/php-laravel/lib/resources/lang/en/validation.php new file mode 100644 index 0000000000..0d47547aa9 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/lang/en/validation.php @@ -0,0 +1,146 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'email' => 'The :attribute must be a valid email address.', + 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'gt' => [ + 'numeric' => 'The :attribute must be greater than :value.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'string' => 'The :attribute must be greater than :value characters.', + 'array' => 'The :attribute must have more than :value items.', + ], + 'gte' => [ + 'numeric' => 'The :attribute must be greater than or equal :value.', + 'file' => 'The :attribute must be greater than or equal :value kilobytes.', + 'string' => 'The :attribute must be greater than or equal :value characters.', + 'array' => 'The :attribute must have :value items or more.', + ], + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'ipv4' => 'The :attribute must be a valid IPv4 address.', + 'ipv6' => 'The :attribute must be a valid IPv6 address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'lt' => [ + 'numeric' => 'The :attribute must be less than :value.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'string' => 'The :attribute must be less than :value characters.', + 'array' => 'The :attribute must have less than :value items.', + ], + 'lte' => [ + 'numeric' => 'The :attribute must be less than or equal :value.', + 'file' => 'The :attribute must be less than or equal :value kilobytes.', + 'string' => 'The :attribute must be less than or equal :value characters.', + 'array' => 'The :attribute must not have more than :value items.', + ], + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimetypes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'present' => 'The :attribute field must be present.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'url' => 'The :attribute format is invalid.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/samples/server/petstore/php-laravel/lib/resources/views/welcome.blade.php b/samples/server/petstore/php-laravel/lib/resources/views/welcome.blade.php new file mode 100644 index 0000000000..a246e106a5 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/resources/views/welcome.blade.php @@ -0,0 +1,95 @@ + + + + + + + + Laravel + + + + + + + + +

+ @if (Route::has('login')) + + @endif + +
+
+ Laravel +
+ + +
+
+ + diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php new file mode 100644 index 0000000000..f1b9f3f14a --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -0,0 +1,257 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + +/** + * patch testSpecialTags + * Summary: To test special tags + * Notes: To test special tags + * Output-Formats: [application/json] + */ +Route::patch('/v2/another-fake/dummy', 'AnotherFakeController@testSpecialTags'); +/** + * patch testClientModel + * Summary: To test \"client\" model + * Notes: To test \"client\" model + * Output-Formats: [application/json] + */ +Route::patch('/v2/fake', 'FakeController@testClientModel'); +/** + * post testEndpointParameters + * Summary: Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íŠ¸ + * Notes: Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íŠ¸ + + */ +Route::post('/v2/fake', 'FakeController@testEndpointParameters'); +/** + * get testEnumParameters + * Summary: To test enum parameters + * Notes: To test enum parameters + + */ +Route::get('/v2/fake', 'FakeController@testEnumParameters'); +/** + * put testBodyWithFileSchema + * Summary: + * Notes: For this test, the body for this request much reference a schema named `File`. + + */ +Route::put('/v2/fake/body-with-file-schema', 'FakeController@testBodyWithFileSchema'); +/** + * put testBodyWithQueryParams + * Summary: + * Notes: + + */ +Route::put('/v2/fake/body-with-query-params', 'FakeController@testBodyWithQueryParams'); +/** + * post testInlineAdditionalProperties + * Summary: test inline additionalProperties + * Notes: + + */ +Route::post('/v2/fake/inline-additionalProperties', 'FakeController@testInlineAdditionalProperties'); +/** + * get testJsonFormData + * Summary: test json serialization of form data + * Notes: + + */ +Route::get('/v2/fake/jsonFormData', 'FakeController@testJsonFormData'); +/** + * post fakeOuterBooleanSerialize + * Summary: + * Notes: Test serialization of outer boolean types + * Output-Formats: [*_/_*] + */ +Route::post('/v2/fake/outer/boolean', 'FakeController@fakeOuterBooleanSerialize'); +/** + * post fakeOuterCompositeSerialize + * Summary: + * Notes: Test serialization of object with outer number type + * Output-Formats: [*_/_*] + */ +Route::post('/v2/fake/outer/composite', 'FakeController@fakeOuterCompositeSerialize'); +/** + * post fakeOuterNumberSerialize + * Summary: + * Notes: Test serialization of outer number types + * Output-Formats: [*_/_*] + */ +Route::post('/v2/fake/outer/number', 'FakeController@fakeOuterNumberSerialize'); +/** + * post fakeOuterStringSerialize + * Summary: + * Notes: Test serialization of outer string types + * Output-Formats: [*_/_*] + */ +Route::post('/v2/fake/outer/string', 'FakeController@fakeOuterStringSerialize'); +/** + * patch testClassname + * Summary: To test class name in snake case + * Notes: To test class name in snake case + * Output-Formats: [application/json] + */ +Route::patch('/v2/fake_classname_test', 'FakeClassnameTags123Controller@testClassname'); +/** + * post uploadFileWithRequiredFile + * Summary: uploads an image (required) + * Notes: + * Output-Formats: [application/json] + */ +Route::post('/v2/fake/{petId}/uploadImageWithRequiredFile', 'PetController@uploadFileWithRequiredFile'); +/** + * post addPet + * Summary: Add a new pet to the store + * Notes: + + */ +Route::post('/v2/pet', 'PetController@addPet'); +/** + * put updatePet + * Summary: Update an existing pet + * Notes: + + */ +Route::put('/v2/pet', 'PetController@updatePet'); +/** + * get findPetsByStatus + * Summary: Finds Pets by status + * Notes: Multiple status values can be provided with comma separated strings + * Output-Formats: [application/xml, application/json] + */ +Route::get('/v2/pet/findByStatus', 'PetController@findPetsByStatus'); +/** + * get findPetsByTags + * Summary: Finds Pets by tags + * Notes: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Output-Formats: [application/xml, application/json] + */ +Route::get('/v2/pet/findByTags', 'PetController@findPetsByTags'); +/** + * delete deletePet + * Summary: Deletes a pet + * Notes: + + */ +Route::delete('/v2/pet/{petId}', 'PetController@deletePet'); +/** + * get getPetById + * Summary: Find pet by ID + * Notes: Returns a single pet + * Output-Formats: [application/xml, application/json] + */ +Route::get('/v2/pet/{petId}', 'PetController@getPetById'); +/** + * post updatePetWithForm + * Summary: Updates a pet in the store with form data + * Notes: + + */ +Route::post('/v2/pet/{petId}', 'PetController@updatePetWithForm'); +/** + * post uploadFile + * Summary: uploads an image + * Notes: + * Output-Formats: [application/json] + */ +Route::post('/v2/pet/{petId}/uploadImage', 'PetController@uploadFile'); +/** + * get getInventory + * Summary: Returns pet inventories by status + * Notes: Returns a map of status codes to quantities + * Output-Formats: [application/json] + */ +Route::get('/v2/store/inventory', 'StoreController@getInventory'); +/** + * post placeOrder + * Summary: Place an order for a pet + * Notes: + * Output-Formats: [application/xml, application/json] + */ +Route::post('/v2/store/order', 'StoreController@placeOrder'); +/** + * delete deleteOrder + * Summary: Delete purchase order by ID + * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + */ +Route::delete('/v2/store/order/{order_id}', 'StoreController@deleteOrder'); +/** + * get getOrderById + * Summary: Find purchase order by ID + * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Output-Formats: [application/xml, application/json] + */ +Route::get('/v2/store/order/{order_id}', 'StoreController@getOrderById'); +/** + * post createUser + * Summary: Create user + * Notes: This can only be done by the logged in user. + + */ +Route::post('/v2/user', 'UserController@createUser'); +/** + * post createUsersWithArrayInput + * Summary: Creates list of users with given input array + * Notes: + + */ +Route::post('/v2/user/createWithArray', 'UserController@createUsersWithArrayInput'); +/** + * post createUsersWithListInput + * Summary: Creates list of users with given input array + * Notes: + + */ +Route::post('/v2/user/createWithList', 'UserController@createUsersWithListInput'); +/** + * get loginUser + * Summary: Logs user into the system + * Notes: + * Output-Formats: [application/xml, application/json] + */ +Route::get('/v2/user/login', 'UserController@loginUser'); +/** + * get logoutUser + * Summary: Logs out current logged in user session + * Notes: + + */ +Route::get('/v2/user/logout', 'UserController@logoutUser'); +/** + * delete deleteUser + * Summary: Delete user + * Notes: This can only be done by the logged in user. + + */ +Route::delete('/v2/user/{username}', 'UserController@deleteUser'); +/** + * get getUserByName + * Summary: Get user by user name + * Notes: + * Output-Formats: [application/xml, application/json] + */ +Route::get('/v2/user/{username}', 'UserController@getUserByName'); +/** + * put updateUser + * Summary: Updated user + * Notes: This can only be done by the logged in user. + + */ +Route::put('/v2/user/{username}', 'UserController@updateUser'); + diff --git a/samples/server/petstore/php-laravel/lib/routes/channels.php b/samples/server/petstore/php-laravel/lib/routes/channels.php new file mode 100644 index 0000000000..377c860eee --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/routes/channels.php @@ -0,0 +1,22 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +Broadcast::channel('App.User.{id}', function ($user, $id) { + return (int) $user->id === (int) $id; +}); diff --git a/samples/server/petstore/php-laravel/lib/routes/console.php b/samples/server/petstore/php-laravel/lib/routes/console.php new file mode 100644 index 0000000000..440612ae78 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/routes/console.php @@ -0,0 +1,22 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +Artisan::command('inspire', function () { + $this->comment(Inspiring::quote()); +})->describe('Display an inspiring quote'); \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/routes/web.php b/samples/server/petstore/php-laravel/lib/routes/web.php new file mode 100644 index 0000000000..4fca1f1b56 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/routes/web.php @@ -0,0 +1,20 @@ + swagger-codegen/modules/swagger-codegen/src/main/resources/php-laravel/ + */ + + +Route::get('/', 'Controller@welcome'); \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/server.php b/samples/server/petstore/php-laravel/lib/server.php new file mode 100644 index 0000000000..5fb6379e71 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/server.php @@ -0,0 +1,21 @@ + + */ + +$uri = urldecode( + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) +); + +// This file allows us to emulate Apache's "mod_rewrite" functionality from the +// built-in PHP web server. This provides a convenient way to test a Laravel +// application without having installed a "real" web server software here. +if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { + return false; +} + +require_once __DIR__.'/public/index.php'; diff --git a/samples/server/petstore/php-laravel/lib/storage/app/.gitignore b/samples/server/petstore/php-laravel/lib/storage/app/.gitignore new file mode 100644 index 0000000000..8f4803c056 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/app/.gitignore @@ -0,0 +1,3 @@ +* +!public/ +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/storage/app/public/.gitignore b/samples/server/petstore/php-laravel/lib/storage/app/public/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/storage/framework/.gitignore b/samples/server/petstore/php-laravel/lib/storage/framework/.gitignore new file mode 100644 index 0000000000..b02b700f1b --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/framework/.gitignore @@ -0,0 +1,8 @@ +config.php +routes.php +schedule-* +compiled.php +services.json +events.scanned.php +routes.scanned.php +down diff --git a/samples/server/petstore/php-laravel/lib/storage/framework/cache/.gitignore b/samples/server/petstore/php-laravel/lib/storage/framework/cache/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/framework/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/storage/framework/sessions/.gitignore b/samples/server/petstore/php-laravel/lib/storage/framework/sessions/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/framework/sessions/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/storage/framework/testing/.gitignore b/samples/server/petstore/php-laravel/lib/storage/framework/testing/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/framework/testing/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/storage/framework/views/.gitignore b/samples/server/petstore/php-laravel/lib/storage/framework/views/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/storage/logs/.gitignore b/samples/server/petstore/php-laravel/lib/storage/logs/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/samples/server/petstore/php-laravel/lib/tests/CreatesApplication.php b/samples/server/petstore/php-laravel/lib/tests/CreatesApplication.php new file mode 100644 index 0000000000..547152f6a9 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/tests/CreatesApplication.php @@ -0,0 +1,22 @@ +make(Kernel::class)->bootstrap(); + + return $app; + } +} diff --git a/samples/server/petstore/php-laravel/lib/tests/Feature/ExampleTest.php b/samples/server/petstore/php-laravel/lib/tests/Feature/ExampleTest.php new file mode 100644 index 0000000000..f31e495ca3 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/tests/Feature/ExampleTest.php @@ -0,0 +1,21 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/samples/server/petstore/php-laravel/lib/tests/TestCase.php b/samples/server/petstore/php-laravel/lib/tests/TestCase.php new file mode 100644 index 0000000000..2932d4a69d --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/tests/TestCase.php @@ -0,0 +1,10 @@ +assertTrue(true); + } +} diff --git a/samples/server/petstore/php-laravel/lib/webpack.mix.js b/samples/server/petstore/php-laravel/lib/webpack.mix.js new file mode 100644 index 0000000000..72fdbb16d6 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/webpack.mix.js @@ -0,0 +1,15 @@ +let mix = require('laravel-mix'); + +/* + |-------------------------------------------------------------------------- + | Mix Asset Management + |-------------------------------------------------------------------------- + | + | Mix provides a clean, fluent API for defining some Webpack build steps + | for your Laravel application. By default, we are compiling the Sass + | file for the application as well as bundling up all the JS files. + | + */ + +mix.js('resources/assets/js/app.js', 'public/js') + .sass('resources/assets/sass/app.scss', 'public/css'); diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php index f029754fae..8bf2758fd9 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php @@ -27,14 +27,14 @@ class AnotherFakeApi extends Controller } /** - * Operation testSpecialTags + * Operation 123testSpecialTags * * To test special tags. * * * @return Http response */ - public function testSpecialTags() + public function 123testSpecialTags() { $input = Request::all(); @@ -43,11 +43,11 @@ class AnotherFakeApi extends Controller //not path params validation if (!isset($input['client'])) { - throw new \InvalidArgumentException('Missing the required parameter $client when calling testSpecialTags'); + throw new \InvalidArgumentException('Missing the required parameter $client when calling 123testSpecialTags'); } $client = $input['client']; - return response('How about implementing testSpecialTags as a patch method ?'); + return response('How about implementing 123testSpecialTags as a patch method ?'); } } diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index 07e6252208..6e68f5a002 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -22,11 +22,11 @@ $router->get('/', function () use ($router) { }); /** - * patch testSpecialTags + * patch 123testSpecialTags * Summary: To test special tags - * Notes: To test special tags + * Notes: To test special tags and operation ID starting with number */ -$router->patch('/v2/another-fake/dummy', 'AnotherFakeApi@testSpecialTags'); +$router->patch('/v2/another-fake/dummy', 'AnotherFakeApi@123testSpecialTags'); /** * patch testClientModel * Summary: To test \"client\" model diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 4f701ed192..9847411dd7 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -7,4 +7,8 @@ is an example of building a PHP Slim server. This example uses the [Slim Framework](http://www.slimframework.com/). To see how to make this your own, please take a look at the template here: -[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/slim/) +[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/php-slim-server/) + +## Authentication +> Important! To make Basic Authentication work you need to implement `authenticator` function in [SlimRouter](lib/SlimRouter.php) class. +> Documentation [tuupola/slim-basic-auth](https://github.com/tuupola/slim-basic-auth) diff --git a/samples/server/petstore/php-slim/composer.json b/samples/server/petstore/php-slim/composer.json index 7509c8ea95..ca19917902 100644 --- a/samples/server/petstore/php-slim/composer.json +++ b/samples/server/petstore/php-slim/composer.json @@ -2,7 +2,8 @@ "minimum-stability": "RC", "require": { "php": ">=5.5", - "slim/slim": "3.*" + "slim/slim": "3.*", + "tuupola/slim-basic-auth": "^3.0.0" }, "require-dev": { "phpunit/phpunit": "^4.8" diff --git a/samples/server/petstore/php-slim/composer.lock b/samples/server/petstore/php-slim/composer.lock index 24e93daec4..75bac6e27b 100644 --- a/samples/server/petstore/php-slim/composer.lock +++ b/samples/server/petstore/php-slim/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "dd09324f4c42e91ef9a7865e277effe6", + "content-hash": "7abeaa62669cac171aa0692df2e1943b", "packages": [ { "name": "container-interop/container-interop", @@ -37,6 +37,58 @@ "homepage": "https://github.com/container-interop/container-interop", "time": "2017-02-14T19:40:03+00:00" }, + { + "name": "http-interop/http-factory", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory.git", + "reference": "c2587cc0a6f74987fefb5b8074acfd32c69a4b0f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory/zipball/c2587cc0a6f74987fefb5b8074acfd32c69a4b0f", + "reference": "c2587cc0a6f74987fefb5b8074acfd32c69a4b0f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Interop\\Http\\Factory\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2017-03-24T14:48:51+00:00" + }, { "name": "nikic/fast-route", "version": "v1.3.0", @@ -232,6 +284,112 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/http-server-handler", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "439d92054dc06097f2406ec074a2627839955a02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/439d92054dc06097f2406ec074a2627839955a02", + "reference": "439d92054dc06097f2406ec074a2627839955a02", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "time": "2018-01-22T17:04:15+00:00" + }, + { + "name": "psr/http-server-middleware", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-middleware.git", + "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", + "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side middleware", + "keywords": [ + "http", + "http-interop", + "middleware", + "psr", + "psr-15", + "psr-7", + "request", + "response" + ], + "time": "2018-01-22T17:08:31+00:00" + }, { "name": "slim/slim", "version": "3.10.0", @@ -302,6 +460,167 @@ "router" ], "time": "2018-04-19T19:29:08+00:00" + }, + { + "name": "tuupola/callable-handler", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/callable-handler.git", + "reference": "5141efa1e974687a3fa53338811a988198f50662" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/callable-handler/zipball/5141efa1e974687a3fa53338811a988198f50662", + "reference": "5141efa1e974687a3fa53338811a988198f50662", + "shasum": "" + }, + "require": { + "php": "^7.0", + "psr/http-server-middleware": "^1.0" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": "^0.4.4", + "overtrue/phplint": "^1.0", + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^3.2", + "tuupola/http-factory": "^0.3.0", + "zendframework/zend-diactoros": "^1.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Middleware\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "Compatibility layer for PSR-7 double pass and PSR-15 middlewares.", + "homepage": "https://github.com/tuupola/callable-handler", + "keywords": [ + "middleware", + "psr-15", + "psr-7" + ], + "time": "2018-01-23T04:07:25+00:00" + }, + { + "name": "tuupola/http-factory", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/http-factory.git", + "reference": "57b2e19ff3f4af0bbee4e31fd282689be351f1ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/http-factory/zipball/57b2e19ff3f4af0bbee4e31fd282689be351f1ad", + "reference": "57b2e19ff3f4af0bbee4e31fd282689be351f1ad", + "shasum": "" + }, + "require": { + "http-interop/http-factory": "^0.3.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.3.0", + "overtrue/phplint": "^0.2.1", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Http\\Factory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "http://www.appelsiini.net/", + "role": "Developer" + } + ], + "description": "Lightweight autodiscovering PSR-17 HTTP factories", + "homepage": "https://github.com/tuupola/http-factory", + "keywords": [ + "http", + "psr-17", + "psr-7" + ], + "time": "2017-07-15T22:03:15+00:00" + }, + { + "name": "tuupola/slim-basic-auth", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/slim-basic-auth.git", + "reference": "b169fba3113059548e3a2ac4096b1b08616b070e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/slim-basic-auth/zipball/b169fba3113059548e3a2ac4096b1b08616b070e", + "reference": "b169fba3113059548e3a2ac4096b1b08616b070e", + "shasum": "" + }, + "require": { + "http-interop/http-factory": "^0.3.0", + "php": "^7.1", + "psr/http-message": "^1.0", + "psr/http-server-middleware": "^1.0", + "tuupola/callable-handler": "^0.3.0", + "tuupola/http-factory": "^0.3.0" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": "^0.6.0", + "equip/dispatch": "^2.0", + "overtrue/phplint": "^0.2.4", + "phpstan/phpstan": "^0.9.2", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.2", + "zendframework/zend-diactoros": "^1.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Middleware\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/" + } + ], + "description": "PSR-7 and PSR-15 HTTP Basic Authentication Middleware", + "homepage": "https://appelsiini.net/projects/slim-basic-auth", + "keywords": [ + "auth", + "middleware", + "psr-15", + "psr-7" + ], + "time": "2018-05-06T05:41:44+00:00" } ], "packages-dev": [ @@ -1379,7 +1698,7 @@ }, { "name": "symfony/yaml", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", diff --git a/samples/server/petstore/php-slim/lib/Api/AnotherFakeApi.php b/samples/server/petstore/php-slim/lib/Api/AnotherFakeApi.php index 1888e1319c..8521f9fef9 100644 --- a/samples/server/petstore/php-slim/lib/Api/AnotherFakeApi.php +++ b/samples/server/petstore/php-slim/lib/Api/AnotherFakeApi.php @@ -40,18 +40,18 @@ use OpenAPIServer\AbstractApiController; class AnotherFakeApi extends AbstractApiController { /** - * PATCH testSpecialTags + * PATCH 123testSpecialTags * Summary: To test special tags - * Notes: To test special tags + * Notes: To test special tags and operation ID starting with number * Output-Formats: [application/json] * * @param \Psr\Http\Message\ServerRequestInterface $request Request * @param \Psr\Http\Message\ResponseInterface $response Response * @param array|null $args Path arguments */ - public function testSpecialTags($request, $response, $args) { + public function 123testSpecialTags($request, $response, $args) { $body = $request->getParsedBody(); - $response->write('How about implementing testSpecialTags as a PATCH method ?'); + $response->write('How about implementing 123testSpecialTags as a PATCH method ?'); return $response; } diff --git a/samples/server/petstore/php-slim/lib/SlimRouter.php b/samples/server/petstore/php-slim/lib/SlimRouter.php index af592d7656..2042a5f7ad 100644 --- a/samples/server/petstore/php-slim/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim/lib/SlimRouter.php @@ -34,6 +34,7 @@ use OpenAPIServer\Api\UserApi; use Slim\App; use Psr\Container\ContainerInterface; use InvalidArgumentException; +use Tuupola\Middleware\HttpBasicAuthentication; /** * SlimRouter Class Doc Comment @@ -61,40 +62,119 @@ class SlimRouter { public function __construct($container = []) { $app = new App($container); - $app->PATCH('/v2/another-fake/dummy', AnotherFakeApi::class . ':testSpecialTags'); - $app->POST('/v2/fake/outer/boolean', FakeApi::class . ':fakeOuterBooleanSerialize'); - $app->POST('/v2/fake/outer/composite', FakeApi::class . ':fakeOuterCompositeSerialize'); - $app->POST('/v2/fake/outer/number', FakeApi::class . ':fakeOuterNumberSerialize'); - $app->POST('/v2/fake/outer/string', FakeApi::class . ':fakeOuterStringSerialize'); - $app->PUT('/v2/fake/body-with-file-schema', FakeApi::class . ':testBodyWithFileSchema'); - $app->PUT('/v2/fake/body-with-query-params', FakeApi::class . ':testBodyWithQueryParams'); - $app->PATCH('/v2/fake', FakeApi::class . ':testClientModel'); - $app->POST('/v2/fake', FakeApi::class . ':testEndpointParameters'); - $app->GET('/v2/fake', FakeApi::class . ':testEnumParameters'); - $app->POST('/v2/fake/inline-additionalProperties', FakeApi::class . ':testInlineAdditionalProperties'); - $app->GET('/v2/fake/jsonFormData', FakeApi::class . ':testJsonFormData'); - $app->PATCH('/v2/fake_classname_test', FakeClassnameTags123Api::class . ':testClassname'); - $app->POST('/v2/pet', PetApi::class . ':addPet'); - $app->GET('/v2/pet/findByStatus', PetApi::class . ':findPetsByStatus'); - $app->GET('/v2/pet/findByTags', PetApi::class . ':findPetsByTags'); - $app->PUT('/v2/pet', PetApi::class . ':updatePet'); - $app->DELETE('/v2/pet/{petId}', PetApi::class . ':deletePet'); - $app->GET('/v2/pet/{petId}', PetApi::class . ':getPetById'); - $app->POST('/v2/pet/{petId}', PetApi::class . ':updatePetWithForm'); - $app->POST('/v2/pet/{petId}/uploadImage', PetApi::class . ':uploadFile'); - $app->POST('/v2/fake/{petId}/uploadImageWithRequiredFile', PetApi::class . ':uploadFileWithRequiredFile'); - $app->GET('/v2/store/inventory', StoreApi::class . ':getInventory'); - $app->POST('/v2/store/order', StoreApi::class . ':placeOrder'); - $app->DELETE('/v2/store/order/{order_id}', StoreApi::class . ':deleteOrder'); - $app->GET('/v2/store/order/{order_id}', StoreApi::class . ':getOrderById'); - $app->POST('/v2/user', UserApi::class . ':createUser'); - $app->POST('/v2/user/createWithArray', UserApi::class . ':createUsersWithArrayInput'); - $app->POST('/v2/user/createWithList', UserApi::class . ':createUsersWithListInput'); - $app->GET('/v2/user/login', UserApi::class . ':loginUser'); - $app->GET('/v2/user/logout', UserApi::class . ':logoutUser'); - $app->DELETE('/v2/user/{username}', UserApi::class . ':deleteUser'); - $app->GET('/v2/user/{username}', UserApi::class . ':getUserByName'); - $app->PUT('/v2/user/{username}', UserApi::class . ':updateUser'); + $basicAuth = new HttpBasicAuthentication([ + "secure" => false, + "authenticator" => function ($arguments) { + $user = $arguments["user"]; + $password = $arguments["password"]; + return false; + } + ]); + + $app->PATCH( + '/v2/another-fake/dummy', AnotherFakeApi::class . ':123testSpecialTags' + ); + $app->POST( + '/v2/fake/outer/boolean', FakeApi::class . ':fakeOuterBooleanSerialize' + ); + $app->POST( + '/v2/fake/outer/composite', FakeApi::class . ':fakeOuterCompositeSerialize' + ); + $app->POST( + '/v2/fake/outer/number', FakeApi::class . ':fakeOuterNumberSerialize' + ); + $app->POST( + '/v2/fake/outer/string', FakeApi::class . ':fakeOuterStringSerialize' + ); + $app->PUT( + '/v2/fake/body-with-file-schema', FakeApi::class . ':testBodyWithFileSchema' + ); + $app->PUT( + '/v2/fake/body-with-query-params', FakeApi::class . ':testBodyWithQueryParams' + ); + $app->PATCH( + '/v2/fake', FakeApi::class . ':testClientModel' + ); + $app->POST( + '/v2/fake', FakeApi::class . ':testEndpointParameters' + )->add( + $basicAuth + ); + $app->GET( + '/v2/fake', FakeApi::class . ':testEnumParameters' + ); + $app->POST( + '/v2/fake/inline-additionalProperties', FakeApi::class . ':testInlineAdditionalProperties' + ); + $app->GET( + '/v2/fake/jsonFormData', FakeApi::class . ':testJsonFormData' + ); + $app->PATCH( + '/v2/fake_classname_test', FakeClassnameTags123Api::class . ':testClassname' + ); + $app->POST( + '/v2/pet', PetApi::class . ':addPet' + ); + $app->GET( + '/v2/pet/findByStatus', PetApi::class . ':findPetsByStatus' + ); + $app->GET( + '/v2/pet/findByTags', PetApi::class . ':findPetsByTags' + ); + $app->PUT( + '/v2/pet', PetApi::class . ':updatePet' + ); + $app->DELETE( + '/v2/pet/{petId}', PetApi::class . ':deletePet' + ); + $app->GET( + '/v2/pet/{petId}', PetApi::class . ':getPetById' + ); + $app->POST( + '/v2/pet/{petId}', PetApi::class . ':updatePetWithForm' + ); + $app->POST( + '/v2/pet/{petId}/uploadImage', PetApi::class . ':uploadFile' + ); + $app->POST( + '/v2/fake/{petId}/uploadImageWithRequiredFile', PetApi::class . ':uploadFileWithRequiredFile' + ); + $app->GET( + '/v2/store/inventory', StoreApi::class . ':getInventory' + ); + $app->POST( + '/v2/store/order', StoreApi::class . ':placeOrder' + ); + $app->DELETE( + '/v2/store/order/{order_id}', StoreApi::class . ':deleteOrder' + ); + $app->GET( + '/v2/store/order/{order_id}', StoreApi::class . ':getOrderById' + ); + $app->POST( + '/v2/user', UserApi::class . ':createUser' + ); + $app->POST( + '/v2/user/createWithArray', UserApi::class . ':createUsersWithArrayInput' + ); + $app->POST( + '/v2/user/createWithList', UserApi::class . ':createUsersWithListInput' + ); + $app->GET( + '/v2/user/login', UserApi::class . ':loginUser' + ); + $app->GET( + '/v2/user/logout', UserApi::class . ':logoutUser' + ); + $app->DELETE( + '/v2/user/{username}', UserApi::class . ':deleteUser' + ); + $app->GET( + '/v2/user/{username}', UserApi::class . ':getUserByName' + ); + $app->PUT( + '/v2/user/{username}', UserApi::class . ':updateUser' + ); $this->slimApp = $app; } diff --git a/samples/server/petstore/php-slim/test/Api/FakeApiTest.php b/samples/server/petstore/php-slim/test/Api/FakeApiTest.php index 8c1dee7833..f020953e05 100644 --- a/samples/server/petstore/php-slim/test/Api/FakeApiTest.php +++ b/samples/server/petstore/php-slim/test/Api/FakeApiTest.php @@ -139,7 +139,7 @@ class FakeApiTest extends \PHPUnit_Framework_TestCase { /** * Test case for testEndpointParameters * - * Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íŠ¸ . + * Fake endpoint for testing various parameters å‡ç«¯é»ž å½ã®ã‚¨ãƒ³ãƒ‰ãƒã‚¤ãƒ³ãƒˆ 가짜 엔드 í¬ì¸íŠ¸. * @covers ::testEndpointParameters */ public function testTestEndpointParameters() { diff --git a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION index dde25ef08e..4395ff5923 100644 --- a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-on-rails/Dockerfile b/samples/server/petstore/ruby-on-rails/Dockerfile new file mode 100644 index 0000000000..d53cf3aacd --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/Dockerfile @@ -0,0 +1,29 @@ +FROM ruby:2.5-alpine + +ENV BUILD_PACKAGES="curl-dev ruby-dev build-base" \ + DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev sqlite-dev" \ + RUBY_PACKAGES="ruby-json yaml nodejs" + +RUN apk update && \ + apk upgrade && \ + apk add --no-cache --update\ + $BUILD_PACKAGES \ + $DEV_PACKAGES \ + $RUBY_PACKAGES && \ + mkdir -p /usr/src/myapp + +WORKDIR /usr/src/myapp + +COPY Gemfile ./ +RUN gem install bundler +RUN bundle config build.nokogiri --use-system-libraries && \ + bundle install --jobs=4 --retry=10 --clean + +COPY . ./ +RUN chmod +x bin/rails + +COPY docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-entrypoint.sh +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["bin/rails", "s", "-b", "0.0.0.0"] diff --git a/samples/server/petstore/ruby-on-rails/Gemfile b/samples/server/petstore/ruby-on-rails/Gemfile index a46942406d..3471246b1b 100644 --- a/samples/server/petstore/ruby-on-rails/Gemfile +++ b/samples/server/petstore/ruby-on-rails/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' -# Use mysql as the database for Active Record -gem 'mysql2', '>= 0.3.18', '< 0.5' +# Use sqlite as the database for Active Record +gem 'sqlite3', '~> 1.3' # Use Puma as the app server gem 'puma', '~> 3.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder @@ -33,4 +33,4 @@ group :development do end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] \ No newline at end of file diff --git a/samples/server/petstore/ruby-on-rails/config/database.yml b/samples/server/petstore/ruby-on-rails/config/database.yml index e536d9f37d..025d62a8d8 100644 --- a/samples/server/petstore/ruby-on-rails/config/database.yml +++ b/samples/server/petstore/ruby-on-rails/config/database.yml @@ -1,54 +1,22 @@ -# MySQL. Versions 5.0 and up are supported. -# -# Install the MySQL driver -# gem install mysql2 -# -# Ensure the MySQL gem is defined in your Gemfile -# gem 'mysql2' -# -# And be sure to use new-style password hashing: -# http://dev.mysql.com/doc/refman/5.7/en/old-client.html -# -default: &default - adapter: mysql2 - encoding: utf8 - pool: 5 - username: root - password: - socket: /tmp/mysql.sock - +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) development: - <<: *default - database: api_demo_development + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - <<: *default - database: api_demo_test + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# production: - <<: *default - database: api_demo_production - username: api_demo - password: <%= ENV['API_DEMO_DATABASE_PASSWORD'] %> + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/samples/server/petstore/ruby-on-rails/docker-entrypoint.sh b/samples/server/petstore/ruby-on-rails/docker-entrypoint.sh new file mode 100644 index 0000000000..93372e8393 --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +if [ "$1" = 'bin/rails' ] && [ "$2" = 's' ]; then + rm -f /myapp/tmp/pids/server.pid + bin/rails db:migrate +fi + +exec "$@" diff --git a/samples/server/petstore/ruby-on-rails/pom.xml b/samples/server/petstore/ruby-on-rails/pom.xml new file mode 100644 index 0000000000..53cf1b97ad --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + org.opoenapitools + RORPetstoreServerTests + pom + 1.0-SNAPSHOT + ROR Petstore Server + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-install + pre-integration-test + + exec + + + bundle + + install + --path + vendor/bundle + + + + + + + + + diff --git a/samples/server/petstore/rust-server/Cargo.toml b/samples/server/petstore/rust-server/Cargo.toml index 2cbbb4cc2e..68d06c5410 100644 --- a/samples/server/petstore/rust-server/Cargo.toml +++ b/samples/server/petstore/rust-server/Cargo.toml @@ -1,48 +1,2 @@ -[package] -name = "petstore_api" -version = "1.0.0" -authors = [] -description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" -license = "Unlicense" - -[features] -default = ["client", "server"] -client = ["serde_json", "serde_urlencoded", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] -server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] - -[dependencies] -# Required by example server. -# -chrono = { version = "0.4", features = ["serde"] } -futures = "0.1" -hyper = {version = "0.11", optional = true} -hyper-tls = {version = "0.1.2", optional = true} -swagger = "1.0.1" - -# Not required by example server. -# -lazy_static = "0.2" -log = "0.3.0" -mime = "0.3.3" -multipart = {version = "0.13.3", optional = true} -native-tls = {version = "0.1.4", optional = true} -openssl = {version = "0.9.14", optional = true} -percent-encoding = {version = "1.0.0", optional = true} -regex = {version = "0.2", optional = true} -serde = "1.0" -serde_derive = "1.0" -serde_ignored = {version = "0.0.4", optional = true} -serde_json = {version = "1.0", optional = true} -serde_urlencoded = {version = "0.5.1", optional = true} -tokio-core = {version = "0.1.6", optional = true} -tokio-proto = {version = "0.1.1", optional = true} -tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} -url = {version = "1.5", optional = true} -uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} -# ToDo: this should be updated to point at the official crate once -# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master", optional = true} - -[dev-dependencies] -clap = "2.25" -error-chain = "0.12" +[workspace] +members = ["output/*"] diff --git a/samples/server/petstore/rust-server/.cargo/config b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.cargo/config similarity index 100% rename from samples/server/petstore/rust-server/.cargo/config rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.cargo/config diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.gitignore b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.gitignore new file mode 100644 index 0000000000..a9d37c560c --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator-ignore b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/rust-server/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION similarity index 100% rename from samples/server/petstore/rust-server/.openapi-generator/VERSION rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml new file mode 100644 index 0000000000..e5dc334269 --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "petstore-with-fake-endpoints-models-for-testing" +version = "1.0.0" +authors = [] +description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" +license = "Unlicense" + +[features] +default = ["client", "server"] +client = ["serde_json", "serde_urlencoded", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] +server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] + +[dependencies] +# Required by example server. +# +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +swagger = "1.0.1" + +# Not required by example server. +# +lazy_static = "0.2" +log = "0.3.0" +mime = "0.3.3" +multipart = {version = "0.13.3", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} +serde = "1.0" +serde_derive = "1.0" +serde_ignored = {version = "0.0.4", optional = true} +serde_json = {version = "1.0", optional = true} +serde_urlencoded = {version = "0.5.1", optional = true} +tokio-core = {version = "0.1.6", optional = true} +tokio-proto = {version = "0.1.1", optional = true} +tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} +url = {version = "1.5", optional = true} +uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} +# ToDo: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master", optional = true} + +[dev-dependencies] +clap = "2.25" +error-chain = "0.12" diff --git a/samples/server/petstore/rust-server/README.md b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md similarity index 79% rename from samples/server/petstore/rust-server/README.md rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md index 9d56541b6a..f8b30f1711 100644 --- a/samples/server/petstore/rust-server/README.md +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md @@ -1,4 +1,4 @@ -# Rust API for petstore_api +# Rust API for petstore-with-fake-endpoints-models-for-testing This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ @@ -14,17 +14,17 @@ To see how to make this your own, look here: - API version: 1.0.0 -This autogenerated project defines an API crate `petstore_api` which contains: +This autogenerated project defines an API crate `petstore-with-fake-endpoints-models-for-testing` which contains: * An `Api` trait defining the API in Rust. * Data types representing the underlying data model. * A `Client` type which implements `Api` and issues HTTP requests for each operation. * A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. -It also contains an example server and client which make use of `petstore_api`: -* The example server starts up a web server using the `petstore_api` router, +It also contains an example server and client which make use of `petstore-with-fake-endpoints-models-for-testing`: +* The example server starts up a web server using the `petstore-with-fake-endpoints-models-for-testing` router, and supplies a trivial implementation of `Api` which returns failure for every operation. * The example client provides a CLI which lets you invoke any single operation on the - `petstore_api` client by passing appropriate arguments on the command line. + `petstore-with-fake-endpoints-models-for-testing` client by passing appropriate arguments on the command line. You can use the example server and client as a basis for your own code. See below for [more detail on implementing a server](#writing-a-server). @@ -105,17 +105,17 @@ This will use the keys/certificates from the examples directory. Note that the s The server example is designed to form the basis for implementing your own server. Simply follow these steps. * Set up a new Rust project, e.g., with `cargo init --bin`. -* Insert `petstore_api` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "petstore_api" ]`. -* Add `petstore_api = {version = "1.0.0", path = "petstore_api"}` under `[dependencies]` in the root `Cargo.toml`. -* Copy the `[dependencies]` and `[dev-dependencies]` from `petstore_api/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. +* Insert `petstore-with-fake-endpoints-models-for-testing` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "petstore-with-fake-endpoints-models-for-testing" ]`. +* Add `petstore-with-fake-endpoints-models-for-testing = {version = "1.0.0", path = "petstore-with-fake-endpoints-models-for-testing"}` under `[dependencies]` in the root `Cargo.toml`. +* Copy the `[dependencies]` and `[dev-dependencies]` from `petstore-with-fake-endpoints-models-for-testing/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. * Remove `"optional = true"` from each of these lines if present. Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: ``` -cp petstore_api/examples/server.rs src/main.rs -cp petstore_api/examples/server_lib/mod.rs src/lib.rs -cp petstore_api/examples/server_lib/server.rs src/server.rs +cp petstore-with-fake-endpoints-models-for-testing/examples/server.rs src/main.rs +cp petstore-with-fake-endpoints-models-for-testing/examples/server_lib/mod.rs src/lib.rs +cp petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs src/server.rs ``` Now diff --git a/samples/server/petstore/rust-server/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml similarity index 100% rename from samples/server/petstore/rust-server/api/openapi.yaml rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml diff --git a/samples/server/petstore/rust-server/examples/ca.pem b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/ca.pem similarity index 100% rename from samples/server/petstore/rust-server/examples/ca.pem rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/ca.pem diff --git a/samples/server/petstore/rust-server/examples/client.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs similarity index 97% rename from samples/server/petstore/rust-server/examples/client.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs index d87dd25b87..be8c084e7b 100644 --- a/samples/server/petstore/rust-server/examples/client.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, unused_variables, trivial_casts)] -extern crate petstore_api; +extern crate petstore_with_fake_endpoints_models_for_testing; #[allow(unused_extern_crates)] extern crate futures; #[allow(unused_extern_crates)] @@ -17,7 +17,7 @@ use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; use futures::{Future, future, Stream, stream}; use tokio_core::reactor; #[allow(unused_imports)] -use petstore_api::{ApiNoContext, ContextWrapperExt, +use petstore_with_fake_endpoints_models_for_testing::{ApiNoContext, ContextWrapperExt, ApiError, TestSpecialTagsResponse, FakeOuterBooleanSerializeResponse, @@ -107,11 +107,11 @@ fn main() { matches.value_of("port").unwrap()); let client = if matches.is_present("https") { // Using Simple HTTPS - petstore_api::Client::try_new_https(core.handle(), &base_url, "examples/ca.pem") + petstore_with_fake_endpoints_models_for_testing::Client::try_new_https(core.handle(), &base_url, "examples/ca.pem") .expect("Failed to create HTTPS client") } else { // Using HTTP - petstore_api::Client::try_new_http(core.handle(), &base_url) + petstore_with_fake_endpoints_models_for_testing::Client::try_new_http(core.handle(), &base_url) .expect("Failed to create HTTP client") }; diff --git a/samples/server/petstore/rust-server/examples/server-chain.pem b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server-chain.pem similarity index 100% rename from samples/server/petstore/rust-server/examples/server-chain.pem rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server-chain.pem diff --git a/samples/server/petstore/rust-server/examples/server-key.pem b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server-key.pem similarity index 100% rename from samples/server/petstore/rust-server/examples/server-key.pem rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server-key.pem diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs new file mode 100644 index 0000000000..0f2aba9655 --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs @@ -0,0 +1,75 @@ +//! Main binary entry point for petstore_with_fake_endpoints_models_for_testing implementation. + +#![allow(missing_docs)] + +// Imports required by this file. +// extern crate ; +extern crate petstore_with_fake_endpoints_models_for_testing; +extern crate swagger; +extern crate hyper; +extern crate openssl; +extern crate native_tls; +extern crate tokio_proto; +extern crate tokio_tls; +extern crate clap; + +// Imports required by server library. +// extern crate petstore_with_fake_endpoints_models_for_testing; +// extern crate swagger; +extern crate futures; +extern crate chrono; +#[macro_use] +extern crate error_chain; + + +use openssl::x509::X509_FILETYPE_PEM; +use openssl::ssl::{SslAcceptorBuilder, SslMethod}; +use openssl::error::ErrorStack; +use hyper::server::Http; +use tokio_proto::TcpServer; +use clap::{App, Arg}; +use swagger::auth::AllowAllAuthenticator; +use swagger::EmptyContext; + +mod server_lib; + +// Builds an SSL implementation for Simple HTTPS from some hard-coded file names +fn ssl() -> Result { + let mut ssl = SslAcceptorBuilder::mozilla_intermediate_raw(SslMethod::tls())?; + + // Server authentication + ssl.set_private_key_file("examples/server-key.pem", X509_FILETYPE_PEM)?; + ssl.set_certificate_chain_file("examples/server-chain.pem")?; + ssl.check_private_key()?; + + Ok(ssl) +} + +/// Create custom server, wire it to the autogenerated router, +/// and pass it to the web server. +fn main() { + let matches = App::new("server") + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let service_fn = + petstore_with_fake_endpoints_models_for_testing::server::context::NewAddContext::<_, EmptyContext>::new( + AllowAllAuthenticator::new( + server_lib::NewService::new(), + "cosmo" + ) + ); + + let addr = "127.0.0.1:80".parse().expect("Failed to parse bind address"); + if matches.is_present("https") { + let ssl = ssl().expect("Failed to load SSL keys"); + let builder: native_tls::TlsAcceptorBuilder = native_tls::backend::openssl::TlsAcceptorBuilderExt::from_openssl(ssl); + let tls_acceptor = builder.build().expect("Failed to build TLS acceptor"); + TcpServer::new(tokio_tls::proto::Server::new(Http::new(), tls_acceptor), addr).serve(service_fn); + } else { + // Using HTTP + TcpServer::new(Http::new(), addr).serve(service_fn); + } +} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/mod.rs new file mode 100644 index 0000000000..9c406c28aa --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/mod.rs @@ -0,0 +1,38 @@ +//! Main library entry point for petstore_with_fake_endpoints_models_for_testing implementation. + +mod server; + +mod errors { + error_chain!{} +} + +pub use self::errors::*; +use std::io; +use std::clone::Clone; +use std::marker::PhantomData; +use hyper; +use petstore_with_fake_endpoints_models_for_testing; +use swagger::{Has, XSpanIdString}; +use swagger::auth::Authorization; + +pub struct NewService{ + marker: PhantomData +} + +impl NewService{ + pub fn new() -> Self { + NewService{marker:PhantomData} + } +} + +impl hyper::server::NewService for NewService where C: Has + Has> + Clone + 'static { + type Request = (hyper::Request, C); + type Response = hyper::Response; + type Error = hyper::Error; + type Instance = petstore_with_fake_endpoints_models_for_testing::server::Service, C>; + + /// Instantiate a new server. + fn new_service(&self) -> io::Result { + Ok(petstore_with_fake_endpoints_models_for_testing::server::Service::new(server::Server::new())) + } +} diff --git a/samples/server/petstore/rust-server/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs similarity index 98% rename from samples/server/petstore/rust-server/examples/server_lib/server.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs index c470b7be10..1f1d1e00a2 100644 --- a/samples/server/petstore/rust-server/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs @@ -1,4 +1,4 @@ -//! Server implementation of petstore_api. +//! Server implementation of petstore_with_fake_endpoints_models_for_testing. #![allow(unused_imports)] @@ -10,7 +10,7 @@ use std::marker::PhantomData; use swagger; use swagger::{Has, XSpanIdString}; -use petstore_api::{Api, ApiError, +use petstore_with_fake_endpoints_models_for_testing::{Api, ApiError, TestSpecialTagsResponse, FakeOuterBooleanSerializeResponse, FakeOuterCompositeSerializeResponse, @@ -44,7 +44,7 @@ use petstore_api::{Api, ApiError, LogoutUserResponse, UpdateUserResponse }; -use petstore_api::models; +use petstore_with_fake_endpoints_models_for_testing::models; #[derive(Copy, Clone)] pub struct Server { diff --git a/samples/server/petstore/rust-server/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs similarity index 99% rename from samples/server/petstore/rust-server/src/client/mod.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index 42c2aac4b0..c0c3432933 100644 --- a/samples/server/petstore/rust-server/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -74,6 +74,14 @@ use {Api, }; use models; +define_encode_set! { + /// This encode set is used for object IDs + /// + /// Aside from the special characters defined in the `PATH_SEGMENT_ENCODE_SET`, + /// the vertical bar (|) is encoded. + pub ID_ENCODE_SET = [PATH_SEGMENT_ENCODE_SET] | {'|'} +} + /// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result { // First convert to Uri, since a base path is a subset of Uri. @@ -1236,7 +1244,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/pet/{petId}", - self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -1461,7 +1469,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/pet/{petId}", - self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -1629,7 +1637,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/pet/{petId}", - self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -1693,7 +1701,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/pet/{petId}/uploadImage", - self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -1767,7 +1775,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/store/order/{order_id}", - self.base_path, order_id=utf8_percent_encode(¶m_order_id.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, order_id=utf8_percent_encode(¶m_order_id.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -1900,7 +1908,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/store/order/{order_id}", - self.base_path, order_id=utf8_percent_encode(¶m_order_id.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, order_id=utf8_percent_encode(¶m_order_id.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -2262,7 +2270,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/user/{username}", - self.base_path, username=utf8_percent_encode(¶m_username.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, username=utf8_percent_encode(¶m_username.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -2328,7 +2336,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/user/{username}", - self.base_path, username=utf8_percent_encode(¶m_username.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, username=utf8_percent_encode(¶m_username.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { @@ -2566,7 +2574,7 @@ if let Some(body) = body { let uri = format!( "{}/v2/user/{username}", - self.base_path, username=utf8_percent_encode(¶m_username.to_string(), PATH_SEGMENT_ENCODE_SET) + self.base_path, username=utf8_percent_encode(¶m_username.to_string(), ID_ENCODE_SET) ); let uri = match Uri::from_str(&uri) { diff --git a/samples/server/petstore/rust-server/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs similarity index 99% rename from samples/server/petstore/rust-server/src/lib.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 2e3dc8744b..a3034479d5 100644 --- a/samples/server/petstore/rust-server/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -19,6 +19,9 @@ extern crate hyper; extern crate swagger; +#[macro_use] +extern crate url; + use futures::Stream; use std::io::Error; diff --git a/samples/server/petstore/rust-server/src/mimetypes.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs similarity index 100% rename from samples/server/petstore/rust-server/src/mimetypes.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs diff --git a/samples/server/petstore/rust-server/src/models.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs similarity index 100% rename from samples/server/petstore/rust-server/src/models.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs diff --git a/samples/server/petstore/rust-server/src/server/context.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/context.rs similarity index 100% rename from samples/server/petstore/rust-server/src/server/context.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/context.rs diff --git a/samples/server/petstore/rust-server/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs similarity index 100% rename from samples/server/petstore/rust-server/src/server/mod.rs rename to samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.cargo/config b/samples/server/petstore/rust-server/output/rust-server-test/.cargo/config new file mode 100644 index 0000000000..b8acc9c00c --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/.cargo/config @@ -0,0 +1,18 @@ +[build] +rustflags = [ + "-W", "missing_docs", # detects missing documentation for public members + + "-W", "trivial_casts", # detects trivial casts which could be removed + + "-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed + + "-W", "unsafe_code", # usage of `unsafe` code + + "-W", "unused_qualifications", # detects unnecessarily qualified names + + "-W", "unused_extern_crates", # extern crates that are never used + + "-W", "unused_import_braces", # unnecessary braces around an imported item + + "-D", "warnings", # all warnings should be denied +] diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.gitignore b/samples/server/petstore/rust-server/output/rust-server-test/.gitignore new file mode 100644 index 0000000000..a9d37c560c --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator-ignore b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION new file mode 100644 index 0000000000..4395ff5923 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml new file mode 100644 index 0000000000..1b40c9c33c --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "rust-server-test" +version = "1.0.0" +authors = [] +description = "This spec is for testing rust-server-specific things" +license = "Unlicense" + +[features] +default = ["client", "server"] +client = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] +server = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] + +[dependencies] +# Required by example server. +# +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +swagger = "1.0.1" + +# Not required by example server. +# +lazy_static = "0.2" +log = "0.3.0" +mime = "0.3.3" +multipart = {version = "0.13.3", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} +serde = "1.0" +serde_derive = "1.0" +serde_ignored = {version = "0.0.4", optional = true} +serde_json = {version = "1.0", optional = true} +serde_urlencoded = {version = "0.5.1", optional = true} +tokio-core = {version = "0.1.6", optional = true} +tokio-proto = {version = "0.1.1", optional = true} +tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} +url = {version = "1.5", optional = true} +uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} +# ToDo: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + + +[dev-dependencies] +clap = "2.25" +error-chain = "0.12" diff --git a/samples/server/petstore/rust-server/output/rust-server-test/README.md b/samples/server/petstore/rust-server/output/rust-server-test/README.md new file mode 100644 index 0000000000..5be314fa09 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/README.md @@ -0,0 +1,104 @@ +# Rust API for rust-server-test + +This spec is for testing rust-server-specific things + +## Overview +This client/server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README]((https://openapi-generator.tech)) + +- API version: 1.0.0 + +This autogenerated project defines an API crate `rust-server-test` which contains: +* An `Api` trait defining the API in Rust. +* Data types representing the underlying data model. +* A `Client` type which implements `Api` and issues HTTP requests for each operation. +* A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. + +It also contains an example server and client which make use of `rust-server-test`: +* The example server starts up a web server using the `rust-server-test` router, + and supplies a trivial implementation of `Api` which returns failure for every operation. +* The example client provides a CLI which lets you invoke any single operation on the + `rust-server-test` client by passing appropriate arguments on the command line. + +You can use the example server and client as a basis for your own code. +See below for [more detail on implementing a server](#writing-a-server). + + +## Examples + +Run examples with: + +``` +cargo run --example +``` + +To pass in arguments to the examples, put them after `--`, for example: + +``` +cargo run --example client -- --help +``` + +### Running the server +To run the server, follow these simple steps: + +``` +cargo run --example server +``` + +### Running a client +To run a client, follow one of the following simple steps: + +``` +cargo run --example client DummyGet +``` + +### HTTPS +The examples can be run in HTTPS mode by passing in the flag `--https`, for example: + +``` +cargo run --example server -- --https +``` + +This will use the keys/certificates from the examples directory. Note that the server chain is signed with +`CN=localhost`. + + +## Writing a server + +The server example is designed to form the basis for implementing your own server. Simply follow these steps. + +* Set up a new Rust project, e.g., with `cargo init --bin`. +* Insert `rust-server-test` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "rust-server-test" ]`. +* Add `rust-server-test = {version = "1.0.0", path = "rust-server-test"}` under `[dependencies]` in the root `Cargo.toml`. +* Copy the `[dependencies]` and `[dev-dependencies]` from `rust-server-test/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. + * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. + * Remove `"optional = true"` from each of these lines if present. + +Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: +``` +cp rust-server-test/examples/server.rs src/main.rs +cp rust-server-test/examples/server_lib/mod.rs src/lib.rs +cp rust-server-test/examples/server_lib/server.rs src/server.rs +``` + +Now + +* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. +* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. +* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. +* Run `cargo build` to check it builds. +* Run `cargo fmt` to reformat the code. +* Commit the result before making any further changes (lest format changes get confused with your own updates). + +Now replace the implementations in `src/server.rs` with your own code as required. + +## Updating your server to track API changes + +Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. +Alternatively, implement the now-missing methods based on the compiler's error messages. diff --git a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml new file mode 100644 index 0000000000..65b747a3f8 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml @@ -0,0 +1,22 @@ +openapi: 3.0.1 +info: + description: This spec is for testing rust-server-specific things + title: rust-server-test + version: 1.0.0 +paths: + /dummy: + get: + responses: + 200: + content: {} + description: Success + summary: A dummy endpoint to make the spec valid. +components: + schemas: + additionalPropertiesObject: + additionalProperties: + type: string + description: An additionalPropertiesObject + example: foo + type: object + diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/ca.pem b/samples/server/petstore/rust-server/output/rust-server-test/examples/ca.pem new file mode 100644 index 0000000000..d2317fb5db --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/ca.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICtjCCAZ4CCQDpKecRERZ0xDANBgkqhkiG9w0BAQsFADAdMQswCQYDVQQGEwJV +UzEOMAwGA1UEAxMFTXkgQ0EwHhcNMTcwNTIzMTYwMDIzWhcNMTcwNjIyMTYwMDIz +WjAdMQswCQYDVQQGEwJVUzEOMAwGA1UEAxMFTXkgQ0EwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCt66py3x7sCSASRF2D05L5wkNDxAUjQKYx23W8Gbwv +GMGykk89BIdU5LX1JB1cKiUOkoIxfwAYuWc2V/wzTvVV7+11besnk3uX1c9KiqUF +LIX7kn/z5hzS4aelhKvH+MJlSZCSlp1ytpZbwo5GB5Pi2SGH56jDBiBoDRNBVdWL +z4wH7TdrQjqWwNxIZumD5OGMtcfJyuX08iPiEOaslOeoMqzObhvjc9aUgjVjhqyA +FkJGTXsi0oaD7oml+NE+mTNfEeZvEJQpLSjBY0OvQHzuHkyGBShBnfu/9x7/NRwd +WaqsLiF7/re9KDGYdJwP7Cu6uxYfKAyWarp6h2mG/GIdAgMBAAEwDQYJKoZIhvcN +AQELBQADggEBAGIl/VVIafeq/AJOQ9r7TzzB2ABJYr7NZa6bTu5O1jSp1Fonac15 +SZ8gvRxODgH22ZYSqghPG4xzq4J3hkytlQqm57ZEt2I2M3OqIp17Ndcc1xDYzpLl +tA0FrVn6crQTM8vQkTDtGesaCWX+7Fir5dK7HnYWzfpSmsOpST07PfbNisEXKOxG +Dj4lBL1OnhTjsJeymVS1pFvkKkrcEJO+IxFiHL3CDsWjcXB0Z+E1zBtPoYyYsNsO +rBrjUxcZewF4xqWZhpW90Mt61fY2nRgU0uUwHcvDQUqvmzKcsqYa4mPKzfBI5mxo +01Ta96cDD6pS5Y1hOflZ0g84f2g/7xBLLDA= +-----END CERTIFICATE----- diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs new file mode 100644 index 0000000000..51c9c627c0 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs @@ -0,0 +1,82 @@ +#![allow(missing_docs, unused_variables, trivial_casts)] + +extern crate rust_server_test; +#[allow(unused_extern_crates)] +extern crate futures; +#[allow(unused_extern_crates)] +#[macro_use] +extern crate swagger; +#[allow(unused_extern_crates)] +extern crate uuid; +extern crate clap; +extern crate tokio_core; + +use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; + +#[allow(unused_imports)] +use futures::{Future, future, Stream, stream}; +use tokio_core::reactor; +#[allow(unused_imports)] +use rust_server_test::{ApiNoContext, ContextWrapperExt, + ApiError, + DummyGetResponse + }; +use clap::{App, Arg}; + +fn main() { + let matches = App::new("client") + .arg(Arg::with_name("operation") + .help("Sets the operation to run") + .possible_values(&[ + "DummyGet", +]) + .required(true) + .index(1)) + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .arg(Arg::with_name("host") + .long("host") + .takes_value(true) + .default_value("localhost") + .help("Hostname to contact")) + .arg(Arg::with_name("port") + .long("port") + .takes_value(true) + .default_value("80") + .help("Port to contact")) + .get_matches(); + + let mut core = reactor::Core::new().unwrap(); + let is_https = matches.is_present("https"); + let base_url = format!("{}://{}:{}", + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); + let client = if matches.is_present("https") { + // Using Simple HTTPS + rust_server_test::Client::try_new_https(core.handle(), &base_url, "examples/ca.pem") + .expect("Failed to create HTTPS client") + } else { + // Using HTTP + rust_server_test::Client::try_new_http(core.handle(), &base_url) + .expect("Failed to create HTTP client") + }; + + let context: make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString) = + make_context!(ContextBuilder, EmptyContext, None, XSpanIdString(self::uuid::Uuid::new_v4().to_string())); + let client = client.with_context(context); + + match matches.value_of("operation") { + + Some("DummyGet") => { + let result = core.run(client.dummy_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + _ => { + panic!("Invalid operation provided") + } + } +} + diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server-chain.pem b/samples/server/petstore/rust-server/output/rust-server-test/examples/server-chain.pem new file mode 100644 index 0000000000..47d7e20140 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server-chain.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 1 (0x0) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, CN=My CA + Validity + Not Before: May 23 16:00:23 2017 GMT + Not After : Apr 29 16:00:23 2117 GMT + Subject: CN=localhost, C=US + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:c9:d4:43:60:50:fc:d6:0f:38:4d:5d:5e:aa:7c: + c0:5e:a9:ec:d9:93:78:d3:93:72:28:41:f5:08:a5: + ea:ac:67:07:d7:1f:f7:7d:74:69:7e:46:89:20:4b: + 7a:2d:9b:02:08:e7:6f:0f:1d:0c:0f:c7:60:69:19: + 4b:df:7e:ca:75:94:0b:49:71:e3:6d:f2:e8:79:fd: + ed:0a:94:67:55:f3:ca:6b:61:ba:58:b7:2e:dd:7b: + ca:b9:02:9f:24:36:ac:26:8f:04:8f:81:c8:35:10: + f4:aa:33:b2:24:16:f8:f7:1e:ea:f7:16:fe:fa:34: + c3:dd:bb:2c:ba:7a:df:4d:e2:da:1e:e5:d2:28:44: + 6e:c8:96:e0:fd:09:0c:14:0c:31:dc:e0:ca:c1:a7: + 9b:bf:16:8c:f7:36:3f:1b:2e:dd:90:eb:45:78:51: + bf:59:22:1e:c6:8c:0a:69:88:e5:03:5e:73:b7:fc: + 93:7f:1b:46:1b:97:68:c5:c0:8b:35:1f:bb:1e:67: + 7f:55:b7:3b:55:3f:ea:f2:ca:db:cc:52:cd:16:89: + db:15:47:bd:f2:cd:6c:7a:d7:b4:1a:ac:c8:15:6c: + 6a:fb:77:c4:e9:f2:30:e0:14:24:66:65:6f:2a:e5: + 2d:cc:f6:81:ae:57:c8:d1:9b:38:90:dc:60:93:02: + 5e:cb + Exponent: 65537 (0x10001) + Signature Algorithm: sha256WithRSAEncryption + 1c:7c:39:e8:3d:49:b2:09:1e:68:5a:2f:74:18:f4:63:b5:8c: + f6:e6:a1:e3:4d:95:90:99:ef:32:5c:34:40:e8:55:13:0e:e0: + 1c:be:cd:ab:3f:64:38:99:5e:2b:c1:81:53:a0:18:a8:f6:ee: + 6a:33:73:6c:9a:73:9d:86:08:5d:c7:11:38:46:4c:cd:a0:47: + 37:8f:fe:a6:50:a9:02:21:99:42:86:5e:47:fe:65:56:60:1d: + 16:53:86:bd:e4:63:c5:69:cf:fa:30:51:ab:a1:c3:50:53:cc: + 66:1c:4c:ff:3f:2a:39:4d:a2:8f:9d:d1:a7:8b:22:e4:78:69: + 24:06:83:4d:cc:0a:c0:87:69:9b:bc:80:a9:d2:b7:a5:23:84: + 7e:a2:32:26:7c:78:0e:bd:db:cd:3b:69:18:33:b8:44:ef:96: + b4:99:86:ee:06:bd:51:1c:c7:a1:a4:0c:c4:4c:51:a0:df:ac: + 14:07:88:8e:d7:39:45:fe:52:e0:a3:4c:db:5d:7a:ab:4d:e4: + ca:06:e8:bd:74:6f:46:e7:93:4a:4f:1b:67:e7:a5:9f:ef:9c: + 02:49:d1:f2:d5:e9:53:ee:09:21:ac:08:c8:15:f7:af:35:b9: + 4f:11:0f:43:ae:46:8e:fd:5b:8d:a3:4e:a7:2c:b7:25:ed:e4: + e5:94:1d:e3 +-----BEGIN CERTIFICATE----- +MIICtTCCAZ0CAhAAMA0GCSqGSIb3DQEBCwUAMB0xCzAJBgNVBAYTAlVTMQ4wDAYD +VQQDEwVNeSBDQTAgFw0xNzA1MjMxNjAwMjNaGA8yMTE3MDQyOTE2MDAyM1owITES +MBAGA1UEAxMJbG9jYWxob3N0MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMnUQ2BQ/NYPOE1dXqp8wF6p7NmTeNOTcihB9Qil6qxn +B9cf9310aX5GiSBLei2bAgjnbw8dDA/HYGkZS99+ynWUC0lx423y6Hn97QqUZ1Xz +ymthuli3Lt17yrkCnyQ2rCaPBI+ByDUQ9KozsiQW+Pce6vcW/vo0w927LLp6303i +2h7l0ihEbsiW4P0JDBQMMdzgysGnm78WjPc2Pxsu3ZDrRXhRv1kiHsaMCmmI5QNe +c7f8k38bRhuXaMXAizUfux5nf1W3O1U/6vLK28xSzRaJ2xVHvfLNbHrXtBqsyBVs +avt3xOnyMOAUJGZlbyrlLcz2ga5XyNGbOJDcYJMCXssCAwEAATANBgkqhkiG9w0B +AQsFAAOCAQEAHHw56D1JsgkeaFovdBj0Y7WM9uah402VkJnvMlw0QOhVEw7gHL7N +qz9kOJleK8GBU6AYqPbuajNzbJpznYYIXccROEZMzaBHN4/+plCpAiGZQoZeR/5l +VmAdFlOGveRjxWnP+jBRq6HDUFPMZhxM/z8qOU2ij53Rp4si5HhpJAaDTcwKwIdp +m7yAqdK3pSOEfqIyJnx4Dr3bzTtpGDO4RO+WtJmG7ga9URzHoaQMxExRoN+sFAeI +jtc5Rf5S4KNM2116q03kygbovXRvRueTSk8bZ+eln++cAknR8tXpU+4JIawIyBX3 +rzW5TxEPQ65Gjv1bjaNOpyy3Je3k5ZQd4w== +-----END CERTIFICATE----- diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server-key.pem b/samples/server/petstore/rust-server/output/rust-server-test/examples/server-key.pem new file mode 100644 index 0000000000..29c0068292 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJ1ENgUPzWDzhN +XV6qfMBeqezZk3jTk3IoQfUIpeqsZwfXH/d9dGl+RokgS3otmwII528PHQwPx2Bp +GUvffsp1lAtJceNt8uh5/e0KlGdV88prYbpYty7de8q5Ap8kNqwmjwSPgcg1EPSq +M7IkFvj3Hur3Fv76NMPduyy6et9N4toe5dIoRG7IluD9CQwUDDHc4MrBp5u/Foz3 +Nj8bLt2Q60V4Ub9ZIh7GjAppiOUDXnO3/JN/G0Ybl2jFwIs1H7seZ39VtztVP+ry +ytvMUs0WidsVR73yzWx617QarMgVbGr7d8Tp8jDgFCRmZW8q5S3M9oGuV8jRmziQ +3GCTAl7LAgMBAAECggEBAKEd1q9j14KWYc64s6KLthGbutyxsinMMbxbct11fdIk +6YhdF3fJ35ETg9IJDr6rWEN9ZRX+jStncNpVfFEs6ThVd3Eo/nI+EEGaaIkikR93 +X2a7fEPn7/yVHu70XdBN6L1bPDvHUeiy4W2hmRrgT90OjGm1rNRWHOm7yugOwIZu +HclzbR9Ca7EInFnotUiDQm9sw9VKHbJHqWx6OORdZrxR2ytYs0Qkq0XpGMvti2HW +7WAmKTg5QM8myXW7+/4iqb/u68wVBR2BBalShKmIf7lim9O3W2a1RjDdsvm/wNe9 +I+D+Iq825vpqkKXcrxYlpVg7hYiaQaW/MNsEb7lQRjECgYEA/RJYby0POW+/k0Jn +jO8UmJVEMiuGa8WIUu/JJWMOmzRCukjSRNQOkt7niQrZPJYE8W6clM6RJTolWf9L +IL6mIb+mRaoudUk8SHGDq7ho1iMg9GK8lhYxvKh1Q6uv8EyVSkgLknAEY0NANKC1 +zNdU5Dhven9aRX2gq9vP4XwMz2MCgYEAzCogQ7IFk+gkp3k491dOZnrGRoRCfuzo +4CJtyKFgOSd7BjmpcKkj0IPfVBjw6GjMIxfQRMTQmxAjjWevH45vG8l0Iiwz/gSp +81b5nsDEX5uv2Olcmcz5zxRFy36jOZ9ihMWinxcIlT2oDbyCdbruDKZq9ieJ9S8g +4qGx0OkwE3kCgYEA7CmAiU89U9YqqttfEq/RQoqY91CSwmO10d+ej9seuEtOsdRf +FIfnibulycdr7hP5TOxyBpO1802NqayJiWcgVYIpQf2MGTtcnCYCP+95NcvWZvj1 +EAJqK6nwtFO1fcOZ1ZXh5qfOEGujsPkAbsXLnKXlsiTCMvMHSxl3pu5Cbg0CgYBf +JjbZNctRrjv+7Qj2hPLd4dQsIxGWc7ToWENP4J2mpVa5hQAJqFovoHXhjKohtk2F +AWEn243Y5oGbMjo0e74edhmwn2cvuF64MM2vBem/ISCn98IXT6cQskMA3qkVfsl8 +VVs/x41ReGWs2TD3y0GMFbb9t1mdMfSiincDhNnKCQKBgGfeT4jKyYeCoCw4OLI1 +G75Gd0METt/IkppwODPpNwj3Rp9I5jctWZFA/3wCX/zk0HgBeou5AFNS4nQZ/X/L +L9axbSdR7UJTGkT1r4gu3rLkPV4Tk+8XM03/JT2cofMlzQBuhvl1Pn4SgKowz7hl +lS76ECw4Av3T0S34VW9Z5oye +-----END PRIVATE KEY----- diff --git a/samples/server/petstore/rust-server/examples/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs similarity index 91% rename from samples/server/petstore/rust-server/examples/server.rs rename to samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs index 270b1e5cdb..ab9887d7ef 100644 --- a/samples/server/petstore/rust-server/examples/server.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs @@ -1,10 +1,10 @@ -//! Main binary entry point for petstore_api implementation. +//! Main binary entry point for rust_server_test implementation. #![allow(missing_docs)] // Imports required by this file. // extern crate ; -extern crate petstore_api; +extern crate rust_server_test; extern crate swagger; extern crate hyper; extern crate openssl; @@ -14,7 +14,7 @@ extern crate tokio_tls; extern crate clap; // Imports required by server library. -// extern crate petstore_api; +// extern crate rust_server_test; // extern crate swagger; extern crate futures; extern crate chrono; @@ -55,7 +55,7 @@ fn main() { .get_matches(); let service_fn = - petstore_api::server::context::NewAddContext::<_, EmptyContext>::new( + rust_server_test::server::context::NewAddContext::<_, EmptyContext>::new( AllowAllAuthenticator::new( server_lib::NewService::new(), "cosmo" diff --git a/samples/server/petstore/rust-server/examples/server_lib/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/mod.rs similarity index 69% rename from samples/server/petstore/rust-server/examples/server_lib/mod.rs rename to samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/mod.rs index c4f682d653..3b3f990979 100644 --- a/samples/server/petstore/rust-server/examples/server_lib/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/mod.rs @@ -1,4 +1,4 @@ -//! Main library entry point for petstore_api implementation. +//! Main library entry point for rust_server_test implementation. mod server; @@ -11,7 +11,7 @@ use std::io; use std::clone::Clone; use std::marker::PhantomData; use hyper; -use petstore_api; +use rust_server_test; use swagger::{Has, XSpanIdString}; use swagger::auth::Authorization; @@ -25,14 +25,14 @@ impl NewService{ } } -impl hyper::server::NewService for NewService where C: Has + Has> + Clone + 'static { +impl hyper::server::NewService for NewService where C: Has + Clone + 'static { type Request = (hyper::Request, C); type Response = hyper::Response; type Error = hyper::Error; - type Instance = petstore_api::server::Service, C>; + type Instance = rust_server_test::server::Service, C>; /// Instantiate a new server. fn new_service(&self) -> io::Result { - Ok(petstore_api::server::Service::new(server::Server::new())) + Ok(rust_server_test::server::Service::new(server::Server::new())) } } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs new file mode 100644 index 0000000000..e7b86f0313 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs @@ -0,0 +1,38 @@ +//! Server implementation of rust_server_test. + +#![allow(unused_imports)] + +use futures::{self, Future}; +use chrono; +use std::collections::HashMap; +use std::marker::PhantomData; + +use swagger; +use swagger::{Has, XSpanIdString}; + +use rust_server_test::{Api, ApiError, + DummyGetResponse +}; +use rust_server_test::models; + +#[derive(Copy, Clone)] +pub struct Server { + marker: PhantomData, +} + +impl Server { + pub fn new() -> Self { + Server{marker: PhantomData} + } +} + +impl Api for Server where C: Has{ + + /// A dummy endpoint to make the spec valid. + fn dummy_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("dummy_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs new file mode 100644 index 0000000000..78aa49e008 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs @@ -0,0 +1,337 @@ +#![allow(unused_extern_crates)] +extern crate tokio_core; +extern crate native_tls; +extern crate hyper_tls; +extern crate openssl; +extern crate mime; +extern crate chrono; +extern crate url; + + + +use hyper; +use hyper::header::{Headers, ContentType}; +use hyper::Uri; +use self::url::percent_encoding::{utf8_percent_encode, PATH_SEGMENT_ENCODE_SET, QUERY_ENCODE_SET}; +use futures; +use futures::{Future, Stream}; +use futures::{future, stream}; +use self::tokio_core::reactor::Handle; +use std::borrow::Cow; +use std::io::{Read, Error, ErrorKind}; +use std::error; +use std::fmt; +use std::path::Path; +use std::sync::Arc; +use std::str; +use std::str::FromStr; + +use mimetypes; + +use serde_json; + + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; + +use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; + +use {Api, + DummyGetResponse + }; +use models; + +define_encode_set! { + /// This encode set is used for object IDs + /// + /// Aside from the special characters defined in the `PATH_SEGMENT_ENCODE_SET`, + /// the vertical bar (|) is encoded. + pub ID_ENCODE_SET = [PATH_SEGMENT_ENCODE_SET] | {'|'} +} + +/// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. +fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result { + // First convert to Uri, since a base path is a subset of Uri. + let uri = Uri::from_str(input)?; + + let scheme = uri.scheme().ok_or(ClientInitError::InvalidScheme)?; + + // Check the scheme if necessary + if let Some(correct_scheme) = correct_scheme { + if scheme != correct_scheme { + return Err(ClientInitError::InvalidScheme); + } + } + + let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?; + let port = uri.port().map(|x| format!(":{}", x)).unwrap_or_default(); + Ok(format!("{}://{}{}", scheme, host, port)) +} + +/// A client that implements the API by making HTTP calls out to a server. +pub struct Client where + F: Future + 'static { + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + base_path: String, +} + +impl fmt::Debug for Client where + F: Future + 'static { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Client {{ base_path: {} }}", self.base_path) + } +} + +impl Clone for Client where + F: Future + 'static { + fn clone(&self) -> Self { + Client { + client_service: self.client_service.clone(), + base_path: self.base_path.clone() + } + } +} + +impl Client { + + /// Create an HTTP client. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + pub fn try_new_http(handle: Handle, base_path: &str) -> Result, ClientInitError> { + let http_connector = swagger::http_connector(); + Self::try_new_with_connector::( + handle, + base_path, + Some("http"), + http_connector, + ) + } + + /// Create a client with a TLS connection to the server. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `ca_certificate` - Path to CA certificate used to authenticate the server + pub fn try_new_https( + handle: Handle, + base_path: &str, + ca_certificate: CA, + ) -> Result, ClientInitError> + where + CA: AsRef, + { + let https_connector = swagger::https_connector(ca_certificate); + Self::try_new_with_connector::>( + handle, + base_path, + Some("https"), + https_connector, + ) + } + + /// Create a client with a mutually authenticated TLS connection to the server. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `ca_certificate` - Path to CA certificate used to authenticate the server + /// * `client_key` - Path to the client private key + /// * `client_certificate` - Path to the client's public certificate associated with the private key + pub fn try_new_https_mutual( + handle: Handle, + base_path: &str, + ca_certificate: CA, + client_key: K, + client_certificate: C, + ) -> Result, ClientInitError> + where + CA: AsRef, + K: AsRef, + C: AsRef, + { + let https_connector = + swagger::https_mutual_connector(ca_certificate, client_key, client_certificate); + Self::try_new_with_connector::>( + handle, + base_path, + Some("https"), + https_connector, + ) + } + + /// Create a client with a custom implementation of hyper::client::Connect. + /// + /// Intended for use with custom implementations of connect for e.g. protocol logging + /// or similar functionality which requires wrapping the transport layer. When wrapping a TCP connection, + /// this function should be used in conjunction with + /// `swagger::{http_connector, https_connector, https_mutual_connector}`. + /// + /// For ordinary tcp connections, prefer the use of `try_new_http`, `try_new_https` + /// and `try_new_https_mutual`, to avoid introducing a dependency on the underlying transport layer. + /// + /// # Arguments + /// + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `protocol` - Which protocol to use when constructing the request url, e.g. `Some("http")` + /// * `connector_fn` - Function which returns an implementation of `hyper::client::Connect` + pub fn try_new_with_connector( + handle: Handle, + base_path: &str, + protocol: Option<&'static str>, + connector_fn: Box C + Send + Sync>, + ) -> Result, ClientInitError> + where + C: hyper::client::Connect + hyper::client::Service, + { + let connector = connector_fn(&handle); + let client_service = Box::new(hyper::Client::configure().connector(connector).build( + &handle, + )); + + Ok(Client { + client_service: Arc::new(client_service), + base_path: into_base_path(base_path, protocol)?, + }) + } + + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client. + /// + /// One should avoid relying on this function if possible, since it adds a dependency on the underlying transport + /// implementation, which it would be better to abstract away. Therefore, using this function may lead to a loss of + /// code generality, which may make it harder to move the application to a serverless environment, for example. + /// + /// The reason for this function's existence is to support legacy test code, which did mocking at the hyper layer. + /// This is not a recommended way to write new tests. If other reasons are found for using this function, they + /// should be mentioned here. + #[deprecated(note="Use try_new_with_client_service instead")] + pub fn try_new_with_hyper_client( + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + handle: Handle, + base_path: &str + ) -> Result, ClientInitError> + { + Ok(Client { + client_service: hyper_client, + base_path: into_base_path(base_path, None)?, + }) + } +} + +impl Client where + F: Future + 'static +{ + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. + /// + /// This allows adding custom wrappers around the underlying transport, for example for logging. + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + handle: Handle, + base_path: &str) + -> Result, ClientInitError> + { + Ok(Client { + client_service: client_service, + base_path: into_base_path(base_path, None)?, + }) + } +} + +impl Api for Client where + F: Future + 'static, + C: Has { + + fn dummy_get(&self, context: &C) -> Box> { + + + let uri = format!( + "{}/dummy", + self.base_path + ); + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + DummyGetResponse::Success + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + +} + +#[derive(Debug)] +pub enum ClientInitError { + InvalidScheme, + InvalidUri(hyper::error::UriError), + MissingHost, + SslError(openssl::error::ErrorStack) +} + +impl From for ClientInitError { + fn from(err: hyper::error::UriError) -> ClientInitError { + ClientInitError::InvalidUri(err) + } +} + +impl From for ClientInitError { + fn from(err: openssl::error::ErrorStack) -> ClientInitError { + ClientInitError::SslError(err) + } +} + +impl fmt::Display for ClientInitError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + (self as &fmt::Debug).fmt(f) + } +} + +impl error::Error for ClientInitError { + fn description(&self) -> &str { + "Failed to produce a hyper client." + } +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs new file mode 100644 index 0000000000..aceb8e42cc --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -0,0 +1,100 @@ +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] +extern crate serde; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; + + +extern crate futures; +extern crate chrono; +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; + +// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. +#[cfg(any(feature = "client", feature = "server"))] +#[macro_use] +extern crate hyper; + +extern crate swagger; + +#[macro_use] +extern crate url; + +use futures::Stream; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::HashMap; + +pub use futures::Future; + +#[cfg(any(feature = "client", feature = "server"))] +mod mimetypes; + +pub use swagger::{ApiError, ContextWrapper}; + +pub const BASE_PATH: &'static str = ""; +pub const API_VERSION: &'static str = "1.0.0"; + + +#[derive(Debug, PartialEq)] +pub enum DummyGetResponse { + /// Success + Success , +} + + +/// API +pub trait Api { + + /// A dummy endpoint to make the spec valid. + fn dummy_get(&self, context: &C) -> Box>; + +} + +/// API without a `Context` +pub trait ApiNoContext { + + /// A dummy endpoint to make the spec valid. + fn dummy_get(&self) -> Box>; + +} + +/// Trait to extend an API to make it easy to bind it to a context. +pub trait ContextWrapperExt<'a, C> where Self: Sized { + /// Binds this API to a context. + fn with_context(self: &'a Self, context: C) -> ContextWrapper<'a, Self, C>; +} + +impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { + fn with_context(self: &'a T, context: C) -> ContextWrapper<'a, T, C> { + ContextWrapper::::new(self, context) + } +} + +impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { + + /// A dummy endpoint to make the spec valid. + fn dummy_get(&self) -> Box> { + self.api().dummy_get(&self.context()) + } + +} + +#[cfg(feature = "client")] +pub mod client; + +// Re-export Client as a top-level name +#[cfg(feature = "client")] +pub use self::client::Client; + +#[cfg(feature = "server")] +pub mod server; + +// Re-export router() as a top-level name +#[cfg(feature = "server")] +pub use self::server::Service; + +pub mod models; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs new file mode 100644 index 0000000000..304c686b3e --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs @@ -0,0 +1,13 @@ +/// mime types for requests and responses + +pub mod responses { + use hyper::mime::*; + + // The macro is called per-operation to beat the recursion limit + +} + +pub mod requests { + use hyper::mime::*; + +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs new file mode 100644 index 0000000000..796339d130 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs @@ -0,0 +1,23 @@ +#![allow(unused_imports, unused_qualifications, unused_extern_crates)] +extern crate chrono; +extern crate uuid; + + +use serde::ser::Serializer; + +use std::collections::HashMap; +use models; +use swagger; + + +/// An additionalPropertiesObject +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AdditionalPropertiesObject { +} + +impl AdditionalPropertiesObject { + pub fn new() -> AdditionalPropertiesObject { + AdditionalPropertiesObject { + } + } +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/context.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/context.rs new file mode 100644 index 0000000000..6f2900b3d7 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/context.rs @@ -0,0 +1,91 @@ +use std::io; +use std::marker::PhantomData; +use std::default::Default; +use hyper; +use hyper::{Request, Response, Error, StatusCode}; +use server::url::form_urlencoded; +use swagger::auth::{Authorization, AuthData, Scopes}; +use swagger::{Has, Pop, Push, XSpanIdString}; +use Api; + +pub struct NewAddContext +{ + inner: T, + marker: PhantomData, +} + +impl NewAddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::NewService + 'static, +{ + pub fn new(inner: T) -> NewAddContext { + NewAddContext { + inner, + marker: PhantomData, + } + } +} + +impl hyper::server::NewService for NewAddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::NewService + 'static, +{ + type Request = Request; + type Response = Response; + type Error = Error; + type Instance = AddContext; + + fn new_service(&self) -> Result { + self.inner.new_service().map(|s| AddContext::new(s)) + } +} + +/// Middleware to extract authentication data from request +pub struct AddContext +{ + inner: T, + marker: PhantomData, +} + +impl AddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::Service, +{ + pub fn new(inner: T) -> AddContext { + AddContext { + inner, + marker: PhantomData, + } + } +} + +impl hyper::server::Service for AddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::Service, +{ + type Request = Request; + type Response = Response; + type Error = Error; + type Future = T::Future; + + fn call(&self, req: Self::Request) -> Self::Future { + let context = A::default().push(XSpanIdString::get_or_generate(&req)); + + + let context = context.push(None::); + let context = context.push(None::); + return self.inner.call((req, context)); + } +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs new file mode 100644 index 0000000000..919e430b08 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -0,0 +1,182 @@ +#![allow(unused_extern_crates)] +extern crate serde_ignored; +extern crate tokio_core; +extern crate native_tls; +extern crate hyper_tls; +extern crate openssl; +extern crate mime; +extern crate uuid; +extern crate chrono; +extern crate percent_encoding; +extern crate url; + + +use std::sync::Arc; +use std::marker::PhantomData; +use futures::{Future, future, Stream, stream}; +use hyper; +use hyper::{Request, Response, Error, StatusCode}; +use hyper::header::{Headers, ContentType}; +use self::url::form_urlencoded; +use mimetypes; + +use serde_json; + + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; +use std::io; + +#[allow(unused_imports)] +use std::collections::BTreeSet; + +pub use swagger::auth::Authorization; +use swagger::{ApiError, XSpanId, XSpanIdString, Has, RequestParser}; +use swagger::auth::Scopes; + +use {Api, + DummyGetResponse + }; +#[allow(unused_imports)] +use models; + +pub mod context; + +header! { (Warning, "Warning") => [String] } + +mod paths { + extern crate regex; + + lazy_static! { + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + r"^/dummy$" + ]).unwrap(); + } + pub static ID_DUMMY: usize = 0; +} + +pub struct NewService { + api_impl: Arc, + marker: PhantomData, +} + +impl NewService +where + T: Api + Clone + 'static, + C: Has + 'static +{ + pub fn new>>(api_impl: U) -> NewService { + NewService{api_impl: api_impl.into(), marker: PhantomData} + } +} + +impl hyper::server::NewService for NewService +where + T: Api + Clone + 'static, + C: Has + 'static +{ + type Request = (Request, C); + type Response = Response; + type Error = Error; + type Instance = Service; + + fn new_service(&self) -> Result { + Ok(Service::new(self.api_impl.clone())) + } +} + +pub struct Service { + api_impl: Arc, + marker: PhantomData, +} + +impl Service +where + T: Api + Clone + 'static, + C: Has + 'static { + pub fn new>>(api_impl: U) -> Service { + Service{api_impl: api_impl.into(), marker: PhantomData} + } +} + +impl hyper::server::Service for Service +where + T: Api + Clone + 'static, + C: Has + 'static +{ + type Request = (Request, C); + type Response = Response; + type Error = Error; + type Future = Box>; + + fn call(&self, (req, mut context): Self::Request) -> Self::Future { + let api_impl = self.api_impl.clone(); + let (method, uri, _, headers, body) = req.deconstruct(); + let path = paths::GLOBAL_REGEX_SET.matches(uri.path()); + + // This match statement is duplicated below in `parse_operation_id()`. + // Please update both places if changing how this code is autogenerated. + match &method { + + // DummyGet - GET /dummy + &hyper::Method::Get if path.matched(paths::ID_DUMMY) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.dummy_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + DummyGetResponse::Success + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + } + } +} + +impl Clone for Service +{ + fn clone(&self) -> Self { + Service { + api_impl: self.api_impl.clone(), + marker: self.marker.clone(), + } + } +} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3b57817d49..8e3ddec588 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,14 +36,14 @@ public interface AnotherFakeApi { return Optional.empty(); } - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default CompletableFuture> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + default CompletableFuture> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 2e9417031e..b9cdc6298f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,14 +35,14 @@ public interface AnotherFakeApi { return Optional.empty(); } - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8b4cb79307..f2164c1e0f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,13 +27,13 @@ import java.util.Map; @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client); + ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java index b2bef57740..67f1fcd713 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -31,7 +31,7 @@ public class AnotherFakeApiController implements AnotherFakeApi { this.request = request; } - public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8b4cb79307..f2164c1e0f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,13 +27,13 @@ import java.util.Map; @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client); + ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4be8a57963..d182689774 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -31,7 +31,7 @@ public class AnotherFakeApiController implements AnotherFakeApi { this.request = request; } - public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9a61b8dbb3..eb2cb1634f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,15 +31,15 @@ public interface AnotherFakeApi { return new AnotherFakeApiDelegate() {}; } - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { - return getDelegate().testSpecialTags(client); + default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 7215de9751..4db3394773 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -24,9 +24,9 @@ public interface AnotherFakeApiDelegate { } /** - * @see AnotherFakeApi#testSpecialTags + * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity testSpecialTags( Client client) { + default ResponseEntity call123testSpecialTags( Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8b4cb79307..f2164c1e0f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,13 +27,13 @@ import java.util.Map; @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client); + ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index a139724020..254904f899 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -29,8 +29,8 @@ public class AnotherFakeApiController implements AnotherFakeApi { this.delegate = delegate; } - public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { - return delegate.testSpecialTags(client); + public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + return delegate.call123testSpecialTags(client); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 8e88f2092c..569d1299b9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -16,8 +16,8 @@ import java.util.Map; public interface AnotherFakeApiDelegate { /** - * @see AnotherFakeApi#testSpecialTags + * @see AnotherFakeApi#call123testSpecialTags */ - ResponseEntity testSpecialTags( Client client); + ResponseEntity call123testSpecialTags( Client client); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 22fa7b13e7..00df30e683 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { return Optional.empty(); } - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ @@ -44,7 +44,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index f8b40faf84..6f607601a7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -33,14 +33,14 @@ import java.util.Optional; @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono client, ServerWebExchange exchange) { + default ResponseEntity> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 526dd125d8..5765e33f9c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1067,8 +1067,8 @@ paths: - tag: fake /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 2e9417031e..b9cdc6298f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,14 +35,14 @@ public interface AnotherFakeApi { return Optional.empty(); } - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 2e9417031e..b9cdc6298f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,14 +35,14 @@ public interface AnotherFakeApi { return Optional.empty(); } - @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { + default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {