forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
This commit is contained in:
commit
85c8eb3d76
@ -879,6 +879,8 @@ Here is a list of template creators:
|
|||||||
* PHP Lumen: @abcsum
|
* PHP Lumen: @abcsum
|
||||||
* PHP Slim: @jfastnacht
|
* PHP Slim: @jfastnacht
|
||||||
* Ruby on Rails 5: @zlx
|
* Ruby on Rails 5: @zlx
|
||||||
|
* Documentation
|
||||||
|
* HTML Doc 2: @jhitchcock
|
||||||
|
|
||||||
## How to join the core team
|
## How to join the core team
|
||||||
|
|
||||||
|
11
appveyor.yml
11
appveyor.yml
@ -1,7 +1,9 @@
|
|||||||
# for CI with appveyor.yml
|
# for CI with appveyor.yml
|
||||||
# Ref: http://www.yegor256.com/2015/01/10/windows-appveyor-maven.html
|
# Ref: http://www.yegor256.com/2015/01/10/windows-appveyor-maven.html
|
||||||
version: '{build}'
|
version: '{branch}-{build}'
|
||||||
os: Windows Server 2012
|
os: Windows Server 2012
|
||||||
|
hosts:
|
||||||
|
petstore.swagger.io: 127.0.0.1
|
||||||
install:
|
install:
|
||||||
- ps: |
|
- ps: |
|
||||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||||
@ -15,9 +17,16 @@ install:
|
|||||||
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;%PATH%
|
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;%PATH%
|
||||||
- cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
- cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
||||||
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
||||||
|
- git clone https://github.com/wing328/swagger-samples
|
||||||
|
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs"
|
||||||
build_script:
|
build_script:
|
||||||
|
- nuget restore samples\client\petstore\csharp\SwaggerClient\IO.Swagger.sln
|
||||||
|
- msbuild samples\client\petstore\csharp\SwaggerClient\IO.Swagger.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||||
- mvn clean install --batch-mode
|
- mvn clean install --batch-mode
|
||||||
test_script:
|
test_script:
|
||||||
|
# test c# API client
|
||||||
|
- nunit-console samples\client\petstore\csharp\SwaggerClient\src\IO.Swagger.Test\bin\Debug\IO.Swagger.Test.dll --result=myresults.xml;format=AppVeyor
|
||||||
|
# generate all petstore clients
|
||||||
- .\bin\windows\run-all-petstore.cmd
|
- .\bin\windows\run-all-petstore.cmd
|
||||||
cache:
|
cache:
|
||||||
- C:\maven\
|
- C:\maven\
|
||||||
|
@ -0,0 +1,641 @@
|
|||||||
|
package io.swagger.codegen.languages;
|
||||||
|
|
||||||
|
import io.swagger.codegen.CliOption;
|
||||||
|
import io.swagger.codegen.CodegenConfig;
|
||||||
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.CodegenOperation;
|
||||||
|
import io.swagger.codegen.CodegenParameter;
|
||||||
|
import io.swagger.codegen.CodegenProperty;
|
||||||
|
import io.swagger.codegen.CodegenType;
|
||||||
|
import io.swagger.codegen.DefaultCodegen;
|
||||||
|
import io.swagger.codegen.SupportingFile;
|
||||||
|
import io.swagger.models.properties.*;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public abstract class AbstractPhpCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
|
|
||||||
|
static Logger LOGGER = LoggerFactory.getLogger(AbstractPhpCodegen.class);
|
||||||
|
|
||||||
|
public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention";
|
||||||
|
public static final String PACKAGE_PATH = "packagePath";
|
||||||
|
public static final String SRC_BASE_PATH = "srcBasePath";
|
||||||
|
// composerVendorName/composerProjectName has be replaced by gitUserId/gitRepoId. prepare to remove these.
|
||||||
|
// public static final String COMPOSER_VENDOR_NAME = "composerVendorName";
|
||||||
|
// public static final String COMPOSER_PROJECT_NAME = "composerProjectName";
|
||||||
|
// protected String composerVendorName = null;
|
||||||
|
// protected String composerProjectName = null;
|
||||||
|
protected String invokerPackage = "php";
|
||||||
|
protected String packagePath = "php-base";
|
||||||
|
protected String artifactVersion = null;
|
||||||
|
protected String srcBasePath = "lib";
|
||||||
|
protected String testBasePath = "test";
|
||||||
|
protected String docsBasePath = "docs";
|
||||||
|
protected String apiDirName = "Api";
|
||||||
|
protected String modelDirName = "Model";
|
||||||
|
protected String variableNamingConvention= "snake_case";
|
||||||
|
protected String apiDocPath = docsBasePath + "/" + apiDirName;
|
||||||
|
protected String modelDocPath = docsBasePath + "/" + modelDirName;
|
||||||
|
|
||||||
|
public AbstractPhpCodegen() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
modelTemplateFiles.put("model.mustache", ".php");
|
||||||
|
apiTemplateFiles.put("api.mustache", ".php");
|
||||||
|
apiTestTemplateFiles.put("api_test.mustache", ".php");
|
||||||
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
|
apiPackage = invokerPackage + "\\" + apiDirName;
|
||||||
|
modelPackage = invokerPackage + "\\" + modelDirName;
|
||||||
|
|
||||||
|
setReservedWordsLowerCase(
|
||||||
|
Arrays.asList(
|
||||||
|
// local variables used in api methods (endpoints)
|
||||||
|
"resourcePath", "httpBody", "queryParams", "headerParams",
|
||||||
|
"formParams", "_header_accept", "_tempBody",
|
||||||
|
|
||||||
|
// PHP reserved words
|
||||||
|
"__halt_compiler", "abstract", "and", "array", "as", "break", "callable", "case", "catch", "class", "clone", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "eval", "exit", "extends", "final", "for", "foreach", "function", "global", "goto", "if", "implements", "include", "include_once", "instanceof", "insteadof", "interface", "isset", "list", "namespace", "new", "or", "print", "private", "protected", "public", "require", "require_once", "return", "static", "switch", "throw", "trait", "try", "unset", "use", "var", "while", "xor")
|
||||||
|
);
|
||||||
|
|
||||||
|
// ref: http://php.net/manual/en/language.types.intro.php
|
||||||
|
languageSpecificPrimitives = new HashSet<String>(
|
||||||
|
Arrays.asList(
|
||||||
|
"bool",
|
||||||
|
"boolean",
|
||||||
|
"int",
|
||||||
|
"integer",
|
||||||
|
"double",
|
||||||
|
"float",
|
||||||
|
"string",
|
||||||
|
"object",
|
||||||
|
"DateTime",
|
||||||
|
"mixed",
|
||||||
|
"number",
|
||||||
|
"void",
|
||||||
|
"byte")
|
||||||
|
);
|
||||||
|
|
||||||
|
instantiationTypes.put("array", "array");
|
||||||
|
instantiationTypes.put("map", "map");
|
||||||
|
|
||||||
|
|
||||||
|
// provide primitives to mustache template
|
||||||
|
String primitives = "'" + StringUtils.join(languageSpecificPrimitives, "', '") + "'";
|
||||||
|
additionalProperties.put("primitives", primitives);
|
||||||
|
|
||||||
|
// ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
|
||||||
|
typeMapping = new HashMap<String, String>();
|
||||||
|
typeMapping.put("integer", "int");
|
||||||
|
typeMapping.put("long", "int");
|
||||||
|
typeMapping.put("number", "float");
|
||||||
|
typeMapping.put("float", "float");
|
||||||
|
typeMapping.put("double", "double");
|
||||||
|
typeMapping.put("string", "string");
|
||||||
|
typeMapping.put("byte", "int");
|
||||||
|
typeMapping.put("boolean", "bool");
|
||||||
|
typeMapping.put("Date", "\\DateTime");
|
||||||
|
typeMapping.put("DateTime", "\\DateTime");
|
||||||
|
typeMapping.put("file", "\\SplFileObject");
|
||||||
|
typeMapping.put("map", "map");
|
||||||
|
typeMapping.put("array", "array");
|
||||||
|
typeMapping.put("list", "array");
|
||||||
|
typeMapping.put("object", "object");
|
||||||
|
typeMapping.put("binary", "string");
|
||||||
|
typeMapping.put("ByteArray", "string");
|
||||||
|
typeMapping.put("UUID", "string");
|
||||||
|
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||||
|
cliOptions.add(new CliOption(VARIABLE_NAMING_CONVENTION, "naming convention of variable name, e.g. camelCase.")
|
||||||
|
.defaultValue("snake_case"));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay\\Pets"));
|
||||||
|
cliOptions.add(new CliOption(PACKAGE_PATH, "The main package name for classes. e.g. GeneratedPetstore"));
|
||||||
|
cliOptions.add(new CliOption(SRC_BASE_PATH, "The directory under packagePath to serve as source root."));
|
||||||
|
// cliOptions.add(new CliOption(COMPOSER_VENDOR_NAME, "The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets. IMPORTANT NOTE (2016/03): composerVendorName will be deprecated and replaced by gitUserId in the next swagger-codegen release"));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC));
|
||||||
|
// cliOptions.add(new CliOption(COMPOSER_PROJECT_NAME, "The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client. IMPORTANT NOTE (2016/03): composerProjectName will be deprecated and replaced by gitRepoId in the next swagger-codegen release"));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, "The version to use in the composer package version field. e.g. 1.2.3"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processOpts() {
|
||||||
|
super.processOpts();
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(PACKAGE_PATH)) {
|
||||||
|
this.setPackagePath((String) additionalProperties.get(PACKAGE_PATH));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(PACKAGE_PATH, packagePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(SRC_BASE_PATH)) {
|
||||||
|
this.setSrcBasePath((String) additionalProperties.get(SRC_BASE_PATH));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(SRC_BASE_PATH, srcBasePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
|
||||||
|
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) {
|
||||||
|
additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
|
||||||
|
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (additionalProperties.containsKey(COMPOSER_PROJECT_NAME)) {
|
||||||
|
// this.setComposerProjectName((String) additionalProperties.get(COMPOSER_PROJECT_NAME));
|
||||||
|
// } else {
|
||||||
|
// additionalProperties.put(COMPOSER_PROJECT_NAME, composerProjectName);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.GIT_USER_ID)) {
|
||||||
|
this.setGitUserId((String) additionalProperties.get(CodegenConstants.GIT_USER_ID));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(CodegenConstants.GIT_USER_ID, gitUserId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (additionalProperties.containsKey(COMPOSER_VENDOR_NAME)) {
|
||||||
|
// this.setComposerVendorName((String) additionalProperties.get(COMPOSER_VENDOR_NAME));
|
||||||
|
// } else {
|
||||||
|
// additionalProperties.put(COMPOSER_VENDOR_NAME, composerVendorName);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.GIT_REPO_ID)) {
|
||||||
|
this.setGitRepoId((String) additionalProperties.get(CodegenConstants.GIT_REPO_ID));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(CodegenConstants.GIT_REPO_ID, gitRepoId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) {
|
||||||
|
this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(VARIABLE_NAMING_CONVENTION)) {
|
||||||
|
this.setParameterNamingConvention((String) additionalProperties.get(VARIABLE_NAMING_CONVENTION));
|
||||||
|
}
|
||||||
|
|
||||||
|
additionalProperties.put("escapedInvokerPackage", invokerPackage.replace("\\", "\\\\"));
|
||||||
|
|
||||||
|
// make api and model doc path available in mustache template
|
||||||
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
|
|
||||||
|
// make test path available in mustache template
|
||||||
|
additionalProperties.put("testBasePath", testBasePath);
|
||||||
|
|
||||||
|
// // apache v2 license
|
||||||
|
// supportingFiles.add(new SupportingFile("LICENSE", getPackagePath(), "LICENSE"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPackagePath() {
|
||||||
|
return packagePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toPackagePath(String packageName, String basePath) {
|
||||||
|
packageName = packageName.replace(invokerPackage, ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
if (basePath != null && basePath.length() > 0) {
|
||||||
|
basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar; // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
}
|
||||||
|
|
||||||
|
String regFirstPathSeparator;
|
||||||
|
if ("/".equals(File.separator)) { // for mac, linux
|
||||||
|
regFirstPathSeparator = "^/";
|
||||||
|
} else { // for windows
|
||||||
|
regFirstPathSeparator = "^\\\\";
|
||||||
|
}
|
||||||
|
|
||||||
|
String regLastPathSeparator;
|
||||||
|
if ("/".equals(File.separator)) { // for mac, linux
|
||||||
|
regLastPathSeparator = "/$";
|
||||||
|
} else { // for windows
|
||||||
|
regLastPathSeparator = "\\\\$";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (getPackagePath() + File.separatorChar + basePath
|
||||||
|
// Replace period, backslash, forward slash with file separator in package name
|
||||||
|
+ packageName.replaceAll("[\\.\\\\/]", Matcher.quoteReplacement(File.separator))
|
||||||
|
// Trim prefix file separators from package path
|
||||||
|
.replaceAll(regFirstPathSeparator, ""))
|
||||||
|
// Trim trailing file separators from the overall path
|
||||||
|
.replaceAll(regLastPathSeparator+ "$", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String escapeReservedWord(String name) {
|
||||||
|
return "_" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiFileFolder() {
|
||||||
|
return (outputFolder + "/" + toPackagePath(apiPackage, srcBasePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelFileFolder() {
|
||||||
|
return (outputFolder + "/" + toPackagePath(modelPackage, srcBasePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiTestFileFolder() {
|
||||||
|
return (outputFolder + "/" + getPackagePath() + "/" + testBasePath + "/" + apiDirName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelTestFileFolder() {
|
||||||
|
return (outputFolder + "/" + getPackagePath() + "/" + testBasePath + "/" + modelDirName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + getPackagePath() + "/" + apiDocPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + getPackagePath() + "/" + modelDocPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelDocFilename(String name) {
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toApiDocFilename(String name) {
|
||||||
|
return toApiName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTypeDeclaration(Property p) {
|
||||||
|
if (p instanceof ArrayProperty) {
|
||||||
|
ArrayProperty ap = (ArrayProperty) p;
|
||||||
|
Property inner = ap.getItems();
|
||||||
|
return getTypeDeclaration(inner) + "[]";
|
||||||
|
} else if (p instanceof MapProperty) {
|
||||||
|
MapProperty mp = (MapProperty) p;
|
||||||
|
Property inner = mp.getAdditionalProperties();
|
||||||
|
return getSwaggerType(p) + "[string," + getTypeDeclaration(inner) + "]";
|
||||||
|
} else if (p instanceof RefProperty) {
|
||||||
|
String type = super.getTypeDeclaration(p);
|
||||||
|
return (!languageSpecificPrimitives.contains(type))
|
||||||
|
? "\\" + modelPackage + "\\" + type : type;
|
||||||
|
}
|
||||||
|
return super.getTypeDeclaration(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTypeDeclaration(String name) {
|
||||||
|
if (!languageSpecificPrimitives.contains(name)) {
|
||||||
|
return "\\" + modelPackage + "\\" + name;
|
||||||
|
}
|
||||||
|
return super.getTypeDeclaration(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSwaggerType(Property p) {
|
||||||
|
String swaggerType = super.getSwaggerType(p);
|
||||||
|
String type = null;
|
||||||
|
if (typeMapping.containsKey(swaggerType)) {
|
||||||
|
type = typeMapping.get(swaggerType);
|
||||||
|
if (languageSpecificPrimitives.contains(type)) {
|
||||||
|
return type;
|
||||||
|
} else if (instantiationTypes.containsKey(type)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
type = swaggerType;
|
||||||
|
}
|
||||||
|
if (type == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return toModelName(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInvokerPackage(String invokerPackage) {
|
||||||
|
this.invokerPackage = invokerPackage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArtifactVersion(String artifactVersion) {
|
||||||
|
this.artifactVersion = artifactVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackagePath(String packagePath) {
|
||||||
|
this.packagePath = packagePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSrcBasePath(String srcBasePath) {
|
||||||
|
this.srcBasePath = srcBasePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameterNamingConvention(String variableNamingConvention) {
|
||||||
|
this.variableNamingConvention = variableNamingConvention;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void setComposerVendorName(String composerVendorName) {
|
||||||
|
// this.composerVendorName = composerVendorName;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public void setComposerProjectName(String composerProjectName) {
|
||||||
|
// this.composerProjectName = composerProjectName;
|
||||||
|
// }
|
||||||
|
|
||||||
|
@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 ("camelCase".equals(variableNamingConvention)) {
|
||||||
|
// return the name in camelCase style
|
||||||
|
// phone_number => phoneNumber
|
||||||
|
name = camelize(name, true);
|
||||||
|
} else { // default to snake case
|
||||||
|
// return the name in underscore style
|
||||||
|
// PhoneNumber => phone_number
|
||||||
|
name = underscore(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// parameter name starting with number won't compile
|
||||||
|
// need to escape it by appending _ at the beginning
|
||||||
|
if (name.matches("^\\d.*")) {
|
||||||
|
name = "_" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toParamName(String name) {
|
||||||
|
// should be the same as variable name
|
||||||
|
return toVarName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelName(String name) {
|
||||||
|
// remove [
|
||||||
|
name = name.replaceAll("\\]", "");
|
||||||
|
|
||||||
|
// Note: backslash ("\\") is allowed for e.g. "\\DateTime"
|
||||||
|
name = name.replaceAll("[^\\w\\\\]+", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
|
// remove dollar sign
|
||||||
|
name = name.replaceAll("$", "");
|
||||||
|
|
||||||
|
// model name cannot use reserved keyword
|
||||||
|
if (isReservedWord(name)) {
|
||||||
|
LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name));
|
||||||
|
name = "model_" + name; // e.g. return => ModelReturn (after camelize)
|
||||||
|
}
|
||||||
|
|
||||||
|
// model name starts with number
|
||||||
|
if (name.matches("^\\d.*")) {
|
||||||
|
LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name));
|
||||||
|
name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
|
||||||
|
}
|
||||||
|
|
||||||
|
// add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime)
|
||||||
|
if (!name.matches("^\\\\.*")) {
|
||||||
|
name = modelNamePrefix + name + modelNameSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
// camelize the model name
|
||||||
|
// phone_number => PhoneNumber
|
||||||
|
return camelize(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelFilename(String name) {
|
||||||
|
// should be the same as the model name
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelTestFilename(String name) {
|
||||||
|
// should be the same as the model name
|
||||||
|
return toModelName(name) + "Test";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toOperationId(String operationId) {
|
||||||
|
// throw exception if method name is empty
|
||||||
|
if (StringUtils.isEmpty(operationId)) {
|
||||||
|
throw new RuntimeException("Empty method name (operationId) not allowed");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 " + camelize(sanitizeName("call_" + operationId), true));
|
||||||
|
operationId = "call_" + operationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return camelize(sanitizeName(operationId), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the default value of the property
|
||||||
|
*
|
||||||
|
* @param p Swagger property object
|
||||||
|
* @return string presentation of the default value of the property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toDefaultValue(Property p) {
|
||||||
|
if (p instanceof StringProperty) {
|
||||||
|
StringProperty dp = (StringProperty) p;
|
||||||
|
if (dp.getDefault() != null) {
|
||||||
|
return "'" + dp.getDefault().toString() + "'";
|
||||||
|
}
|
||||||
|
} else if (p instanceof BooleanProperty) {
|
||||||
|
BooleanProperty dp = (BooleanProperty) p;
|
||||||
|
if (dp.getDefault() != null) {
|
||||||
|
return dp.getDefault().toString();
|
||||||
|
}
|
||||||
|
} else if (p instanceof DateProperty) {
|
||||||
|
// TODO
|
||||||
|
} else if (p instanceof DateTimeProperty) {
|
||||||
|
// TODO
|
||||||
|
} else if (p instanceof DoubleProperty) {
|
||||||
|
DoubleProperty dp = (DoubleProperty) p;
|
||||||
|
if (dp.getDefault() != null) {
|
||||||
|
return dp.getDefault().toString();
|
||||||
|
}
|
||||||
|
} else if (p instanceof FloatProperty) {
|
||||||
|
FloatProperty dp = (FloatProperty) p;
|
||||||
|
if (dp.getDefault() != null) {
|
||||||
|
return dp.getDefault().toString();
|
||||||
|
}
|
||||||
|
} else if (p instanceof IntegerProperty) {
|
||||||
|
IntegerProperty dp = (IntegerProperty) p;
|
||||||
|
if (dp.getDefault() != null) {
|
||||||
|
return dp.getDefault().toString();
|
||||||
|
}
|
||||||
|
} else if (p instanceof LongProperty) {
|
||||||
|
LongProperty dp = (LongProperty) p;
|
||||||
|
if (dp.getDefault() != null) {
|
||||||
|
return dp.getDefault().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 ("String".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = p.paramName + "_example";
|
||||||
|
}
|
||||||
|
example = "\"" + escapeText(example) + "\"";
|
||||||
|
} else if ("Integer".equals(type) || "int".equals(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "56";
|
||||||
|
}
|
||||||
|
} else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "3.4";
|
||||||
|
}
|
||||||
|
} else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "True";
|
||||||
|
}
|
||||||
|
} else if ("\\SplFileObject".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "/path/to/file";
|
||||||
|
}
|
||||||
|
example = "\"" + escapeText(example) + "\"";
|
||||||
|
} else if ("Date".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "2013-10-20";
|
||||||
|
}
|
||||||
|
example = "new \\DateTime(\"" + escapeText(example) + "\")";
|
||||||
|
} else if ("DateTime".equalsIgnoreCase(type)) {
|
||||||
|
if (example == null) {
|
||||||
|
example = "2013-10-20T19:20:30+01:00";
|
||||||
|
}
|
||||||
|
example = "new \\DateTime(\"" + escapeText(example) + "\")";
|
||||||
|
} else if (!languageSpecificPrimitives.contains(type)) {
|
||||||
|
// type is a model class, e.g. User
|
||||||
|
example = "new " + type + "()";
|
||||||
|
} else {
|
||||||
|
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (example == null) {
|
||||||
|
example = "NULL";
|
||||||
|
} else if (Boolean.TRUE.equals(p.isListContainer)) {
|
||||||
|
example = "array(" + example + ")";
|
||||||
|
} else if (Boolean.TRUE.equals(p.isMapContainer)) {
|
||||||
|
example = "array('key' => " + example + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
p.example = example;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toEnumValue(String value, String datatype) {
|
||||||
|
if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
return "\'" + escapeText(value) + "\'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toEnumDefaultValue(String value, String datatype) {
|
||||||
|
return datatype + "_" + value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toEnumVarName(String name, String datatype) {
|
||||||
|
// number
|
||||||
|
if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) {
|
||||||
|
String varName = new String(name);
|
||||||
|
varName = varName.replaceAll("-", "MINUS_");
|
||||||
|
varName = varName.replaceAll("\\+", "PLUS_");
|
||||||
|
varName = varName.replaceAll("\\.", "_DOT_");
|
||||||
|
return varName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// string
|
||||||
|
String enumName = sanitizeName(underscore(name).toUpperCase());
|
||||||
|
enumName = enumName.replaceFirst("^_", "");
|
||||||
|
enumName = enumName.replaceFirst("_$", "");
|
||||||
|
|
||||||
|
if (enumName.matches("\\d.*")) { // starts with number
|
||||||
|
return "_" + enumName;
|
||||||
|
} else {
|
||||||
|
return enumName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toEnumName(CodegenProperty property) {
|
||||||
|
String enumName = underscore(toModelName(property.name)).toUpperCase();
|
||||||
|
|
||||||
|
if (enumName.matches("\\d.*")) { // starts with number
|
||||||
|
return "_" + enumName;
|
||||||
|
} else {
|
||||||
|
return enumName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
||||||
|
// process enum in models
|
||||||
|
return postProcessModelsEnum(objs);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
|
||||||
|
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
||||||
|
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
||||||
|
for (CodegenOperation op : operationList) {
|
||||||
|
op.vendorExtensions.put("x-testOperationId", camelize(op.operationId));
|
||||||
|
}
|
||||||
|
return objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String escapeQuotationMark(String input) {
|
||||||
|
// remove ' to avoid code injection
|
||||||
|
return input.replace("'", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String escapeUnsafeCharacters(String input) {
|
||||||
|
return input.replace("*/", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,10 +10,9 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig {
|
public class LumenServerCodegen extends AbstractPhpCodegen
|
||||||
|
{
|
||||||
// source folder where to write the files
|
@SuppressWarnings("hiding")
|
||||||
protected String sourceFolder = "";
|
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,47 +42,19 @@ public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
* @return A string value for the help message
|
* @return A string value for the help message
|
||||||
*/
|
*/
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a LumenServerCodegen client library.";
|
return "Generates a LumenServerCodegen server library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public LumenServerCodegen() {
|
public LumenServerCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
// set the output folder here
|
embeddedTemplateDir = templateDir = "lumen";
|
||||||
outputFolder = "lumen";
|
|
||||||
String packagePath = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Models. You can write model files using the modelTemplateFiles map.
|
* packPath
|
||||||
* if you want to create one template for file, you can do so here.
|
|
||||||
* for multiple files for model, just put another entry in the `modelTemplateFiles` with
|
|
||||||
* a different extension
|
|
||||||
*/
|
*/
|
||||||
// modelTemplateFiles.put(
|
invokerPackage = "lumen";
|
||||||
// "model.mustache", // the template to use
|
packagePath = "";
|
||||||
// ".sample"); // the extension for each file to write
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Api classes. You can write classes for each Api file with the apiTemplateFiles map.
|
|
||||||
* as with models, add multiple entries with different extensions for multiple files per
|
|
||||||
* class
|
|
||||||
*/
|
|
||||||
// apiTemplateFiles.put(
|
|
||||||
// "api.mustache", // the template to use
|
|
||||||
// ".sample"); // the extension for each file to write
|
|
||||||
|
|
||||||
|
|
||||||
// no api files
|
|
||||||
// apiTemplateFiles.clear();
|
|
||||||
apiTemplateFiles.put("api.mustache", ".php");
|
|
||||||
|
|
||||||
// embeddedTemplateDir = templateDir = "slim";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Template Location. This is the location which templates will be read from. The generator
|
|
||||||
* will use the resource stream to attempt to read the templates.
|
|
||||||
*/
|
|
||||||
templateDir = "lumen";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Api Package. Optional, if needed, this can be used in templates
|
* Api Package. Optional, if needed, this can be used in templates
|
||||||
@ -95,14 +66,11 @@ public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
*/
|
*/
|
||||||
modelPackage = "models";
|
modelPackage = "models";
|
||||||
|
|
||||||
/**
|
// template files want to be ignored
|
||||||
* Reserved words. Override this with reserved words specific to your language
|
modelTemplateFiles.clear();
|
||||||
*/
|
apiTestTemplateFiles.clear();
|
||||||
reservedWords = new HashSet<String> (
|
apiDocTemplateFiles.clear();
|
||||||
Arrays.asList(
|
modelDocTemplateFiles.clear();
|
||||||
"sample1", // replace with static values
|
|
||||||
"sample2")
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional Properties. These values can be passed to the templates and
|
* Additional Properties. These values can be passed to the templates and
|
||||||
@ -115,55 +83,18 @@ public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
* entire object tree available. If the input file has a suffix of `.mustache
|
* 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
|
* it will be processed by the template engine. Otherwise, it will be copied
|
||||||
*/
|
*/
|
||||||
supportingFiles.add(new SupportingFile("composer.mustache", packagePath, "composer.json"));
|
supportingFiles.add(new SupportingFile("composer.mustache", packagePath + File.separator + srcBasePath, "composer.json"));
|
||||||
supportingFiles.add(new SupportingFile("readme.md", packagePath, "readme.md"));
|
supportingFiles.add(new SupportingFile("readme.md", packagePath + File.separator + srcBasePath, "readme.md"));
|
||||||
supportingFiles.add(new SupportingFile("app.php", packagePath + File.separator + "bootstrap", "app.php"));
|
supportingFiles.add(new SupportingFile("app.php", packagePath + File.separator + srcBasePath + File.separator + "bootstrap", "app.php"));
|
||||||
supportingFiles.add(new SupportingFile("index.php", packagePath + File.separator + "public", "index.php"));
|
supportingFiles.add(new SupportingFile("index.php", packagePath + File.separator + srcBasePath + File.separator + "public", "index.php"));
|
||||||
supportingFiles.add(new SupportingFile("User.php", packagePath + File.separator + "app", "User.php"));
|
supportingFiles.add(new SupportingFile("User.php", packagePath + File.separator + srcBasePath + File.separator + "app", "User.php"));
|
||||||
supportingFiles.add(new SupportingFile("Kernel.php", packagePath + File.separator + "app" + File.separator + "Console", "Kernel.php"));
|
supportingFiles.add(new SupportingFile("Kernel.php", packagePath + File.separator + srcBasePath + File.separator + "app" + File.separator + "Console", "Kernel.php"));
|
||||||
supportingFiles.add(new SupportingFile("Handler.php", packagePath + File.separator + "app" + File.separator + "Exceptions", "Handler.php"));
|
supportingFiles.add(new SupportingFile("Handler.php", packagePath + File.separator + srcBasePath + File.separator + "app" + File.separator + "Exceptions", "Handler.php"));
|
||||||
supportingFiles.add(new SupportingFile("routes.mustache", packagePath + File.separator + "app" + File.separator + "Http", "routes.php"));
|
supportingFiles.add(new SupportingFile("routes.mustache", packagePath + File.separator + srcBasePath + File.separator + "app" + File.separator + "Http", "routes.php"));
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("Controller.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers" + File.separator, "Controller.php"));
|
supportingFiles.add(new SupportingFile("Controller.php", packagePath + File.separator + srcBasePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers" + File.separator, "Controller.php"));
|
||||||
supportingFiles.add(new SupportingFile("Authenticate.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware" + File.separator, "Authenticate.php"));
|
supportingFiles.add(new SupportingFile("Authenticate.php", packagePath + File.separator + srcBasePath + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware" + File.separator, "Authenticate.php"));
|
||||||
|
|
||||||
/**
|
|
||||||
* Language Specific Primitives. These types will not trigger imports by
|
|
||||||
* the client generator
|
|
||||||
*/
|
|
||||||
languageSpecificPrimitives = new HashSet<String>(
|
|
||||||
Arrays.asList(
|
|
||||||
"Type1", // replace these with your types
|
|
||||||
"Type2")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 reseved 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
|
|
||||||
*/
|
|
||||||
public String modelFileFolder() {
|
|
||||||
return outputFolder + "/" + modelPackage().replace('.', File.separatorChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Location to write api files. You can use the apiPackage() as defined when the class is
|
|
||||||
* instantiated
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String apiFileFolder() {
|
|
||||||
return outputFolder + "/" + apiPackage().replace('.', File.separatorChar);//"/app/Http/controllers";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// override with any special post-processing
|
// override with any special post-processing
|
||||||
@ -185,57 +116,4 @@ public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
|
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Optional - type declaration. This is a String which is used by the templates to instantiate your
|
|
||||||
* types. There is typically special handling for different property types
|
|
||||||
*
|
|
||||||
* @return a string value used as the `dataType` field for model templates, `returnType` for api templates
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getTypeDeclaration(Property p) {
|
|
||||||
if(p instanceof ArrayProperty) {
|
|
||||||
ArrayProperty ap = (ArrayProperty) p;
|
|
||||||
Property inner = ap.getItems();
|
|
||||||
return getSwaggerType(p) + "[" + getTypeDeclaration(inner) + "]";
|
|
||||||
}
|
|
||||||
else if (p instanceof MapProperty) {
|
|
||||||
MapProperty mp = (MapProperty) p;
|
|
||||||
Property inner = mp.getAdditionalProperties();
|
|
||||||
return getSwaggerType(p) + "[String, " + getTypeDeclaration(inner) + "]";
|
|
||||||
}
|
|
||||||
return super.getTypeDeclaration(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional - swagger type conversion. This is used to map swagger types in a `Property` into
|
|
||||||
* either language specific types via `typeMapping` or into complex models if there is not a mapping.
|
|
||||||
*
|
|
||||||
* @return a string value of the type or complex model for this property
|
|
||||||
* @see io.swagger.models.properties.Property
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getSwaggerType(Property p) {
|
|
||||||
String swaggerType = super.getSwaggerType(p);
|
|
||||||
String type = null;
|
|
||||||
if(typeMapping.containsKey(swaggerType)) {
|
|
||||||
type = typeMapping.get(swaggerType);
|
|
||||||
if(languageSpecificPrimitives.contains(type))
|
|
||||||
return toModelName(type);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
type = swaggerType;
|
|
||||||
return toModelName(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// remove ' to avoid code injection
|
|
||||||
return input.replace("'", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeUnsafeCharacters(String input) {
|
|
||||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
|
|
||||||
|
|
||||||
// test files should not be overwritten
|
// test files should not be overwritten
|
||||||
writeOptional(outputFolder, new SupportingFile("rspec.mustache", "", ".rspec"));
|
writeOptional(outputFolder, new SupportingFile("rspec.mustache", "", ".rspec"));
|
||||||
|
@ -0,0 +1,154 @@
|
|||||||
|
package io.swagger.codegen.languages;
|
||||||
|
|
||||||
|
import io.swagger.codegen.*;
|
||||||
|
import io.swagger.models.Model;
|
||||||
|
import io.swagger.models.Operation;
|
||||||
|
import io.swagger.models.Swagger;
|
||||||
|
import io.swagger.models.properties.ArrayProperty;
|
||||||
|
import io.swagger.models.properties.MapProperty;
|
||||||
|
import io.swagger.models.properties.Property;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfig {
|
||||||
|
private static final String ALL_OPERATIONS = "";
|
||||||
|
protected String invokerPackage = "io.swagger.client";
|
||||||
|
protected String groupId = "io.swagger";
|
||||||
|
protected String artifactId = "swagger-client";
|
||||||
|
protected String artifactVersion = "1.0.0";
|
||||||
|
protected String sourceFolder = "src/main/scala";
|
||||||
|
|
||||||
|
public StaticHtml2Generator() {
|
||||||
|
super();
|
||||||
|
outputFolder = "docs";
|
||||||
|
embeddedTemplateDir = templateDir = "htmlDocs2";
|
||||||
|
|
||||||
|
defaultIncludes = new HashSet<String>();
|
||||||
|
|
||||||
|
cliOptions.add(new CliOption("appName", "short name of the application"));
|
||||||
|
cliOptions.add(new CliOption("appDescription", "description of the application"));
|
||||||
|
cliOptions.add(new CliOption("infoUrl", "a URL where users can get more information about the application"));
|
||||||
|
cliOptions.add(new CliOption("infoEmail", "an email address to contact for inquiries about the application"));
|
||||||
|
cliOptions.add(new CliOption("licenseInfo", "a short description of the license"));
|
||||||
|
cliOptions.add(new CliOption("licenseUrl", "a URL pointing to the full license"));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
|
||||||
|
|
||||||
|
additionalProperties.put("appName", "Swagger Sample");
|
||||||
|
additionalProperties.put("appDescription", "A sample swagger server");
|
||||||
|
additionalProperties.put("infoUrl", "https://helloreverb.com");
|
||||||
|
additionalProperties.put("infoEmail", "hello@helloreverb.com");
|
||||||
|
additionalProperties.put("licenseInfo", "All rights reserved");
|
||||||
|
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
|
||||||
|
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||||
|
additionalProperties.put(CodegenConstants.GROUP_ID, groupId);
|
||||||
|
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
|
||||||
|
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
|
||||||
|
|
||||||
|
supportingFiles.add(new SupportingFile("index.mustache", "", "index.html"));
|
||||||
|
reservedWords = new HashSet<String>();
|
||||||
|
|
||||||
|
languageSpecificPrimitives = new HashSet<String>();
|
||||||
|
importMapping = new HashMap<String, String>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodegenType getTag() {
|
||||||
|
return CodegenType.DOCUMENTATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "html2";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getHelp() {
|
||||||
|
return "Generates a static HTML file.";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTypeDeclaration(Property p) {
|
||||||
|
if (p instanceof ArrayProperty) {
|
||||||
|
ArrayProperty ap = (ArrayProperty) p;
|
||||||
|
Property inner = ap.getItems();
|
||||||
|
return getSwaggerType(p) + "[" + getTypeDeclaration(inner) + "]";
|
||||||
|
} else if (p instanceof MapProperty) {
|
||||||
|
MapProperty mp = (MapProperty) p;
|
||||||
|
Property inner = mp.getAdditionalProperties();
|
||||||
|
|
||||||
|
return getSwaggerType(p) + "[String, " + getTypeDeclaration(inner) + "]";
|
||||||
|
}
|
||||||
|
return super.getTypeDeclaration(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
|
||||||
|
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
||||||
|
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
||||||
|
for (CodegenOperation op : operationList) {
|
||||||
|
op.httpMethod = op.httpMethod.toLowerCase();
|
||||||
|
}
|
||||||
|
return objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map<String, Model> definitions, Swagger swagger) {
|
||||||
|
CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, swagger);
|
||||||
|
if (op.returnType != null) {
|
||||||
|
op.returnType = normalizeType(op.returnType);
|
||||||
|
}
|
||||||
|
|
||||||
|
//path is an unescaped variable in the mustache template api.mustache line 82 '<&path>'
|
||||||
|
op.path = sanitizePath(op.path);
|
||||||
|
|
||||||
|
// Set vendor-extension to be used in template:
|
||||||
|
// x-codegen-hasMoreRequired
|
||||||
|
// x-codegen-hasMoreOptional
|
||||||
|
// x-codegen-hasRequiredParams
|
||||||
|
CodegenParameter lastRequired = null;
|
||||||
|
CodegenParameter lastOptional = null;
|
||||||
|
for (CodegenParameter p : op.allParams) {
|
||||||
|
if (p.required != null && p.required) {
|
||||||
|
lastRequired = p;
|
||||||
|
} else {
|
||||||
|
lastOptional = p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (CodegenParameter p : op.allParams) {
|
||||||
|
if (p == lastRequired) {
|
||||||
|
p.vendorExtensions.put("x-codegen-hasMoreRequired", false);
|
||||||
|
} else if (p == lastOptional) {
|
||||||
|
p.vendorExtensions.put("x-codegen-hasMoreOptional", false);
|
||||||
|
} else {
|
||||||
|
p.vendorExtensions.put("x-codegen-hasMoreRequired", true);
|
||||||
|
p.vendorExtensions.put("x-codegen-hasMoreOptional", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
op.vendorExtensions.put("x-codegen-hasRequiredParams", lastRequired != null);
|
||||||
|
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String sanitizePath(String p) {
|
||||||
|
//prefer replace a ', instead of a fuLL URL encode for readability
|
||||||
|
return p.replaceAll("'", "%27");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalize type by wrapping primitive types with single quotes.
|
||||||
|
*
|
||||||
|
* @param type Primitive type
|
||||||
|
* @return Normalized type
|
||||||
|
*/
|
||||||
|
public String normalizeType(String type) {
|
||||||
|
return type.replaceAll("\\b(Boolean|Integer|Number|String|Date)\\b", "'$1'");
|
||||||
|
}
|
||||||
|
}
|
@ -35,6 +35,7 @@ io.swagger.codegen.languages.SlimFrameworkServerCodegen
|
|||||||
io.swagger.codegen.languages.SpringCodegen
|
io.swagger.codegen.languages.SpringCodegen
|
||||||
io.swagger.codegen.languages.StaticDocCodegen
|
io.swagger.codegen.languages.StaticDocCodegen
|
||||||
io.swagger.codegen.languages.StaticHtmlGenerator
|
io.swagger.codegen.languages.StaticHtmlGenerator
|
||||||
|
io.swagger.codegen.languages.StaticHtml2Generator
|
||||||
io.swagger.codegen.languages.SwaggerGenerator
|
io.swagger.codegen.languages.SwaggerGenerator
|
||||||
io.swagger.codegen.languages.SwaggerYamlGenerator
|
io.swagger.codegen.languages.SwaggerYamlGenerator
|
||||||
io.swagger.codegen.languages.SwiftCodegen
|
io.swagger.codegen.languages.SwiftCodegen
|
||||||
|
@ -147,39 +147,39 @@ UpgradeLog*.htm
|
|||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
# svn
|
# svn
|
||||||
.svn
|
.svn
|
||||||
|
|
||||||
# SQL Server files
|
# SQL Server files
|
||||||
**/App_Data/*.mdf
|
**/App_Data/*.mdf
|
||||||
**/App_Data/*.ldf
|
**/App_Data/*.ldf
|
||||||
**/App_Data/*.sdf
|
**/App_Data/*.sdf
|
||||||
|
|
||||||
|
|
||||||
#LightSwitch generated files
|
#LightSwitch generated files
|
||||||
GeneratedArtifacts/
|
GeneratedArtifacts/
|
||||||
_Pvt_Extensions/
|
_Pvt_Extensions/
|
||||||
ModelManifest.xml
|
ModelManifest.xml
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# Windows detritus
|
# Windows detritus
|
||||||
# =========================
|
# =========================
|
||||||
|
|
||||||
# Windows image file caches
|
# Windows image file caches
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
|
|
||||||
# Folder config file
|
# Folder config file
|
||||||
Desktop.ini
|
Desktop.ini
|
||||||
|
|
||||||
# Recycle Bin used on file shares
|
# Recycle Bin used on file shares
|
||||||
$RECYCLE.BIN/
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
# Mac desktop service store files
|
# Mac desktop service store files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# SASS Compiler cache
|
# SASS Compiler cache
|
||||||
.sass-cache
|
.sass-cache
|
||||||
|
|
||||||
# Visual Studio 2014 CTP
|
# Visual Studio 2014 CTP
|
||||||
**/*.sln.ide
|
**/*.sln.ide
|
||||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,101 @@
|
|||||||
|
/* Pretty printing styles. Used with prettify.js. */
|
||||||
|
/* Vim sunburst theme by David Leibovic */
|
||||||
|
pre .str {
|
||||||
|
color: #65B042;
|
||||||
|
}
|
||||||
|
/* string - green */
|
||||||
|
pre .kwd {
|
||||||
|
color: #E28964;
|
||||||
|
}
|
||||||
|
/* keyword - dark pink */
|
||||||
|
pre .com {
|
||||||
|
color: #AEAEAE;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
/* comment - gray */
|
||||||
|
pre .typ {
|
||||||
|
color: #89bdff;
|
||||||
|
}
|
||||||
|
/* type - light blue */
|
||||||
|
pre .lit {
|
||||||
|
color: #3387CC;
|
||||||
|
}
|
||||||
|
/* literal - blue */
|
||||||
|
pre .pun {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
/* punctuation - white */
|
||||||
|
pre .pln {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
/* plaintext - white */
|
||||||
|
pre .tag {
|
||||||
|
color: #89bdff;
|
||||||
|
}
|
||||||
|
/* html/xml tag - light blue */
|
||||||
|
pre .atn {
|
||||||
|
color: #bdb76b;
|
||||||
|
}
|
||||||
|
/* html/xml attribute name - khaki */
|
||||||
|
pre .atv {
|
||||||
|
color: #65B042;
|
||||||
|
}
|
||||||
|
/* html/xml attribute value - green */
|
||||||
|
pre .dec {
|
||||||
|
color: #3387CC;
|
||||||
|
}
|
||||||
|
/* decimal - blue */
|
||||||
|
/* Specify class=linenums on a pre to get line numbering */
|
||||||
|
ol.linenums {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
color: #AEAEAE;
|
||||||
|
}
|
||||||
|
/* IE indents via margin-left */
|
||||||
|
li.L0,
|
||||||
|
li.L1,
|
||||||
|
li.L2,
|
||||||
|
li.L3,
|
||||||
|
li.L5,
|
||||||
|
li.L6,
|
||||||
|
li.L7,
|
||||||
|
li.L8 {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
/* Alternate shading for lines */
|
||||||
|
@media print {
|
||||||
|
pre .str {
|
||||||
|
color: #060;
|
||||||
|
}
|
||||||
|
pre .kwd {
|
||||||
|
color: #006;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
pre .com {
|
||||||
|
color: #600;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
pre .typ {
|
||||||
|
color: #404;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
pre .lit {
|
||||||
|
color: #044;
|
||||||
|
}
|
||||||
|
pre .pun {
|
||||||
|
color: #440;
|
||||||
|
}
|
||||||
|
pre .pln {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
pre .tag {
|
||||||
|
color: #006;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
pre .atn {
|
||||||
|
color: #404;
|
||||||
|
}
|
||||||
|
pre .atv {
|
||||||
|
color: #060;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,555 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<title>{{{appName}}}</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
|
||||||
|
|
||||||
|
{{>js_jquery}}
|
||||||
|
|
||||||
|
{{>js_prettify}}
|
||||||
|
{{>js_bootstrap}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
var textFile = null;
|
||||||
|
|
||||||
|
/// Function to be used to download a text json schema
|
||||||
|
function makeTextFile(text) {
|
||||||
|
|
||||||
|
var data = new Blob([text], {type: 'text/plain'});
|
||||||
|
|
||||||
|
// If we are replacing a previously generated file we need to
|
||||||
|
// manually revoke the object URL to avoid memory leaks.
|
||||||
|
if (textFile !== null) {
|
||||||
|
window.URL.revokeObjectURL(textFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
textFile = window.URL.createObjectURL(data);
|
||||||
|
|
||||||
|
var a = document.createElement("a");
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.style = "display: none";
|
||||||
|
|
||||||
|
a.href = textFile;
|
||||||
|
a.download = 'schema.txt';
|
||||||
|
a.click();
|
||||||
|
|
||||||
|
return textFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// TODO: Implement resizing for expanding within iframe
|
||||||
|
function callResize() {
|
||||||
|
window.parent.postMessage('resize', "*");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// load google web fonts
|
||||||
|
loadGoogleFontCss();
|
||||||
|
|
||||||
|
|
||||||
|
// Bootstrap Scrollspy
|
||||||
|
$(this).scrollspy({ target: '#scrollingNav', offset: 18 });
|
||||||
|
|
||||||
|
// Content-Scroll on Navigation click.
|
||||||
|
$('.sidenav').find('a').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var id = $(this).attr('href');
|
||||||
|
if ($(id).length > 0)
|
||||||
|
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400);
|
||||||
|
window.location.hash = $(this).attr('href');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Quickjump on Pageload to hash position.
|
||||||
|
if(window.location.hash) {
|
||||||
|
var id = window.location.hash;
|
||||||
|
if ($(id).length > 0)
|
||||||
|
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function initDynamic() {
|
||||||
|
|
||||||
|
// tabs
|
||||||
|
$('.nav-tabs-examples a').click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$(this).tab('show');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.nav-tabs-examples').find('a:first').tab('show');
|
||||||
|
|
||||||
|
// call scrollspy refresh method
|
||||||
|
$(window).scrollspy('refresh');
|
||||||
|
|
||||||
|
}
|
||||||
|
initDynamic();
|
||||||
|
|
||||||
|
// Pre- / Code-Format
|
||||||
|
prettyPrint();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load google fonts.
|
||||||
|
*/
|
||||||
|
function loadGoogleFontCss() {
|
||||||
|
WebFont.load({
|
||||||
|
active: function() {
|
||||||
|
// Update scrollspy
|
||||||
|
$(window).scrollspy('refresh')
|
||||||
|
},
|
||||||
|
google: {
|
||||||
|
families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
{{>css_bootstrap}}
|
||||||
|
{{>css_prettify}}
|
||||||
|
|
||||||
|
{{>styles}}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// Script section to load models into a JS Var
|
||||||
|
|
||||||
|
var defs = {}
|
||||||
|
|
||||||
|
{{#models}}
|
||||||
|
{{#model}}
|
||||||
|
defs.{{name}} = {{{modelJson}}};
|
||||||
|
{{/model}}
|
||||||
|
{{/models}}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div id="sidenav" class="span2">
|
||||||
|
<nav id="scrollingNav">
|
||||||
|
<ul class="sidenav nav nav-list">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Logo Area -->
|
||||||
|
<!--<div style="width: 80%; background-color: #4c8eca; color: white; padding: 20px; text-align: center; margin-bottom: 20px; ">
|
||||||
|
|
||||||
|
API Docs 2
|
||||||
|
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<li class="nav-fixed nav-header active" data-group="_"><a href="#api-_">API Summary</a></li>
|
||||||
|
|
||||||
|
{{#apiInfo}}
|
||||||
|
|
||||||
|
{{#apis}}
|
||||||
|
{{#operations}}
|
||||||
|
<li class="nav-header" data-group="{{baseName}}"><a href="#api-{{baseName}}">API Methods - {{baseName}}</a></li>
|
||||||
|
{{#operation}}
|
||||||
|
<li data-group="{{baseName}}" data-name="{{nickname}}" class="">
|
||||||
|
<a href="#api-{{baseName}}-{{nickname}}">{{nickname}}</a>
|
||||||
|
</li>
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
{{/apis}}
|
||||||
|
|
||||||
|
{{/apiInfo}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div id="content">
|
||||||
|
<div id="project">
|
||||||
|
<div class="pull-left">
|
||||||
|
<h1>{{{appName}}}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
<div id="header">
|
||||||
|
<div id="api-_">
|
||||||
|
<h2 id="welcome-to-apidoc">API and SDK Documentation</h2>
|
||||||
|
|
||||||
|
{{#version}}
|
||||||
|
<div class="app-desc">Version: {{{version}}}</div>
|
||||||
|
{{/version}}
|
||||||
|
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<p>{{{appDescription}}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="sections">
|
||||||
|
|
||||||
|
{{#apiInfo}}
|
||||||
|
|
||||||
|
{{#apis}}
|
||||||
|
{{#operations}}
|
||||||
|
<section id="api-{{baseName}}">
|
||||||
|
<h1>{{baseName}}</h1>
|
||||||
|
{{#operation}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="api-{{baseName}}-{{nickname}}">
|
||||||
|
|
||||||
|
<article id="api-{{baseName}}-{{nickname}}-0" data-group="User" data-name="{{nickname}}" data-version="0">
|
||||||
|
<div class="pull-left">
|
||||||
|
<h1>{{nickname}}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
<p></p>
|
||||||
|
<p>{{notes}}</p>
|
||||||
|
<p></p>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<pre class="prettyprint language-html prettyprinted" data-type="{{httpMethod}}"><code><span class="pln">{{path}}</span></code></pre>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<h3>Usage and SDK Samples</h3>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul class="nav nav-tabs nav-tabs-examples">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-curl">Curl</a>
|
||||||
|
</li>
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-java">Java</a>
|
||||||
|
</li>
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-android">Android</a>
|
||||||
|
</li>
|
||||||
|
<!--<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-groovy">Groovy</a>
|
||||||
|
</li>-->
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-objc">Obj-C</a>
|
||||||
|
</li>
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-javascript">JavaScript</a>
|
||||||
|
</li>
|
||||||
|
<!--<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-angular">Angular</a>
|
||||||
|
</li>-->
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-csharp">C#</a>
|
||||||
|
</li>
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-0-php">PHP</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="examples-{{baseName}}-{{nickname}}-0-curl">
|
||||||
|
<pre class="prettyprint"><code class="language-bsh">
|
||||||
|
curl -X <span style="text-transform: uppercase;">{{httpMethod}}</span> -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{paramName}}={{vendorExtensions.x-eg}}{{/queryParams}}{{/hasQueryParams}}"
|
||||||
|
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-java">
|
||||||
|
<pre class="prettyprint"><code class="language-java">
|
||||||
|
{{>sample_java}}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-android">
|
||||||
|
<pre class="prettyprint"><code class="language-java">
|
||||||
|
{{>sample_android}}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-groovy">
|
||||||
|
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-objc">
|
||||||
|
<pre class="prettyprint"><code class="language-cpp">
|
||||||
|
{{>sample_objc}}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-javascript">
|
||||||
|
<pre class="prettyprint"><code class="language-js">
|
||||||
|
{{>sample_js}}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-angular">
|
||||||
|
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
|
||||||
|
</div>-->
|
||||||
|
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-csharp">
|
||||||
|
<pre class="prettyprint"><code class="language-cs">
|
||||||
|
{{>sample_csharp}}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-php">
|
||||||
|
<pre class="prettyprint"><code class="language-php">
|
||||||
|
{{>sample_php}}
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{{#hasPathParams}}
|
||||||
|
<div class="methodsubtabletitle">Path parameters</div>
|
||||||
|
<table id="methodsubtable">
|
||||||
|
<tr>
|
||||||
|
<th width="150px">Name</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<!---->
|
||||||
|
{{#pathParams}}
|
||||||
|
{{>param}}
|
||||||
|
{{/pathParams}}
|
||||||
|
</table>
|
||||||
|
{{/hasPathParams}}
|
||||||
|
|
||||||
|
{{#hasHeaderParams}}
|
||||||
|
<div class="methodsubtabletitle">Header parameters</div>
|
||||||
|
<table id="methodsubtable">
|
||||||
|
<tr>
|
||||||
|
<th width="150px">Name</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<!---->
|
||||||
|
{{#headerParams}}
|
||||||
|
{{>param}}
|
||||||
|
{{/headerParams}}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
{{/hasHeaderParams}}
|
||||||
|
|
||||||
|
|
||||||
|
{{#hasBodyParam}}
|
||||||
|
<div class="methodsubtabletitle">Body parameters</div>
|
||||||
|
<table id="methodsubtable">
|
||||||
|
<tr>
|
||||||
|
<th width="150px">Name</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<!---->
|
||||||
|
{{#bodyParams}}
|
||||||
|
{{>paramB}}
|
||||||
|
{{/bodyParams}}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
{{/hasBodyParam}}
|
||||||
|
|
||||||
|
{{#hasQueryParams}}
|
||||||
|
<div class="methodsubtabletitle">Query parameters</div>
|
||||||
|
<table id="methodsubtable">
|
||||||
|
<tr>
|
||||||
|
<th width="150px">Name</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<!---->
|
||||||
|
{{#queryParams}}
|
||||||
|
{{>param}}
|
||||||
|
{{/queryParams}}
|
||||||
|
</table>
|
||||||
|
{{/hasQueryParams}}
|
||||||
|
|
||||||
|
<h2>Responses</h2>
|
||||||
|
{{#responses}}
|
||||||
|
|
||||||
|
<h3> Status: {{code}} - {{message}} </h3>
|
||||||
|
|
||||||
|
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||||
|
|
||||||
|
<li class="active">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-schema">Schema</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{{#examples}}
|
||||||
|
<li class="">
|
||||||
|
<a href="#examples-{{baseName}}-{{nickname}}-example">Response Example</a>
|
||||||
|
</li>
|
||||||
|
{{/examples}}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tab-pane active" id="examples-{{baseName}}-{{nickname}}-schema">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id='examples-{{baseName}}-{{nickname}}-schema-{{code}}' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
var schemaWrapper = {{{jsonSchema}}};
|
||||||
|
var schema = schemaWrapper.schema;
|
||||||
|
schemaWrapper.definitions = defs;
|
||||||
|
//console.log(JSON.stringify(schema))
|
||||||
|
JsonRefs.resolveRefs(schemaWrapper, {
|
||||||
|
"depth": 3,
|
||||||
|
"resolveRemoteRefs": false,
|
||||||
|
"resolveFileRefs": false
|
||||||
|
}, function(err, resolved, metadata) {
|
||||||
|
|
||||||
|
//console.log(JSON.stringify(resolved));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var view = new JSONSchemaView(resolved.schema, 3);
|
||||||
|
$('#examples-{{baseName}}-{{nickname}}-schema-data').val(JSON.stringify(resolved.schema));
|
||||||
|
var result = $('#examples-{{baseName}}-{{nickname}}-schema-{{code}}');
|
||||||
|
result.empty();
|
||||||
|
result.append(view.render());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<input id='examples-{{baseName}}-{{nickname}}-schema-data' type='hidden' value=''></input>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{#examples}}
|
||||||
|
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-example">
|
||||||
|
<pre class="prettyprint"><code class="json">{{example}}</code></pre>
|
||||||
|
</div>
|
||||||
|
{{/examples}}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{{/responses}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{{/operations}}
|
||||||
|
{{/apis}}
|
||||||
|
|
||||||
|
{{/apiInfo}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
<div id="api-_footer">
|
||||||
|
<p>Suggestions, contact, support and error reporting;
|
||||||
|
{{#infoUrl}}
|
||||||
|
<div class="app-desc">Information URL: <a href="{{{infoUrl}}}">{{{infoUrl}}}</a></div>
|
||||||
|
{{/infoUrl}}
|
||||||
|
{{#infoEmail}}
|
||||||
|
<div class="app-desc">Contact Info: <a href="{{{infoEmail}}}">{{{infoEmail}}}</a></div>
|
||||||
|
{{/infoEmail}}
|
||||||
|
</p>
|
||||||
|
{{#licenseInfo}}
|
||||||
|
<div class="license-info">{{{licenseInfo}}}</div>
|
||||||
|
{{/licenseInfo}}
|
||||||
|
{{#licenseUrl}}
|
||||||
|
<div class="license-url">{{{licenseUrl}}}</div>
|
||||||
|
{{/licenseUrl}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="generator">
|
||||||
|
<div class="content">
|
||||||
|
Generated {{generatedDate}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{{>js_jsonschemaview}}
|
||||||
|
{{>js_jsonref}}
|
||||||
|
{{>js_webfontloader}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('.nav-tabs-examples').find('a:first').tab('show');
|
||||||
|
$(this).scrollspy({ target: '#scrollingNav', offset: 18 });
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,32 @@
|
|||||||
|
<script>
|
||||||
|
!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
||||||
|
(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a=
|
||||||
|
b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a<f;++a){var h=b[a];if(/\\[bdsw]/i.test(h))c.push(h);else{var h=d(h),l;a+2<f&&"-"===b[a+1]?(l=d(b[a+2]),a+=2):l=h;e.push([h,l]);l<65||h>122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;a<e.length;++a)h=e[a],h[0]<=f[1]+1?f[1]=Math.max(f[1],h[1]):b.push(f=h);for(a=0;a<b.length;++a)h=b[a],c.push(g(h[0])),
|
||||||
|
h[1]>h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f<c;++f){var l=a[f];l==="("?++h:"\\"===l.charAt(0)&&(l=+l.substring(1))&&(l<=h?d[l]=-1:a[f]=g(l))}for(f=1;f<d.length;++f)-1===d[f]&&(d[f]=++x);for(h=f=0;f<c;++f)l=a[f],l==="("?(++h,d[h]||(a[f]="(?:")):"\\"===l.charAt(0)&&(l=+l.substring(1))&&l<=h&&
|
||||||
|
(a[f]="\\"+d[l]);for(f=0;f<c;++f)"^"===a[f]&&"^"!==a[f+1]&&(a[f]="");if(e.ignoreCase&&m)for(f=0;f<c;++f)l=a[f],e=l.charAt(0),l.length>=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k<c;++k){var i=a[k];if(i.ignoreCase)j=!0;else if(/[a-z]/i.test(i.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){m=!0;j=!1;break}}for(var r={b:8,t:9,n:10,v:11,
|
||||||
|
f:12,r:13},n=[],k=0,c=a.length;k<c;++k){i=a[k];if(i.global||i.multiline)throw Error(""+i);n.push("(?:"+s(i)+")")}return RegExp(n.join("|"),j?"gi":"g")}function T(a,d){function g(a){var c=a.nodeType;if(c==1){if(!b.test(a.className)){for(c=a.firstChild;c;c=c.nextSibling)g(c);c=a.nodeName.toLowerCase();if("br"===c||"li"===c)s[j]="\n",m[j<<1]=x++,m[j++<<1|1]=a}}else if(c==3||c==4)c=a.nodeValue,c.length&&(c=d?c.replace(/\r\n?/g,"\n"):c.replace(/[\t\n\r ]+/g," "),s[j]=c,m[j<<1]=x,x+=c.length,m[j++<<1|1]=
|
||||||
|
a)}var b=/(?:^|\s)nocode(?:\s|$)/,s=[],x=0,m=[],j=0;g(a);return{a:s.join("").replace(/\n$/,""),d:m}}function H(a,d,g,b){d&&(a={a:d,e:a},g(a),b.push.apply(b,a.g))}function U(a){for(var d=void 0,g=a.firstChild;g;g=g.nextSibling)var b=g.nodeType,d=b===1?d?a:g:b===3?V.test(g.nodeValue)?a:d:d;return d===a?void 0:d}function C(a,d){function g(a){for(var j=a.e,k=[j,"pln"],c=0,i=a.a.match(s)||[],r={},n=0,e=i.length;n<e;++n){var z=i[n],w=r[z],t=void 0,f;if(typeof w==="string")f=!1;else{var h=b[z.charAt(0)];
|
||||||
|
if(h)t=z.match(h[1]),w=h[0];else{for(f=0;f<x;++f)if(h=d[f],t=z.match(h[1])){w=h[0];break}t||(w="pln")}if((f=w.length>=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c<i;++c){var r=
|
||||||
|
g[c],n=r[3];if(n)for(var e=n.length;--e>=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
||||||
|
q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com",
|
||||||
|
/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+
|
||||||
|
s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,
|
||||||
|
q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d=
|
||||||
|
c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i<c.length;++i)b(c[i]);d===(d|0)&&c[0].setAttribute("value",d);var r=j.createElement("ol");
|
||||||
|
r.className="linenums";for(var d=Math.max(0,d-1|0)||0,i=0,n=c.length;i<n;++i)k=c[i],k.className="L"+(i+d)%10,k.firstChild||k.appendChild(j.createTextNode("\u00a0")),r.appendChild(k);a.appendChild(r)}function p(a,d){for(var g=d.length;--g>=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*</.test(d)?"default-markup":"default-code";return F[a]}function K(a){var d=a.h;try{var g=T(a.c,a.i),b=g.a;
|
||||||
|
a.a=b;a.d=g.d;a.e=0;I(d,b)(a);var s=/\bMSIE\s(\d+)/.exec(navigator.userAgent),s=s&&+s[1]<=8,d=/\n/g,x=a.a,m=x.length,g=0,j=a.d,k=j.length,b=0,c=a.g,i=c.length,r=0;c[i]=m;var n,e;for(e=n=0;e<i;)c[e]!==c[e+2]?(c[n++]=c[e++],c[n++]=c[e++]):e+=2;i=n;for(e=n=0;e<i;){for(var p=c[e],w=c[e+1],t=e+2;t+2<=i&&c[t+1]===w;)t+=2;c[n++]=p;c[n++]=w;e=t}c.length=n;var f=a.c,h;if(f)h=f.style.display,f.style.display="none";try{for(;b<k;){var l=j[b+2]||m,B=c[r+2]||m,t=Math.min(l,B),A=j[b+1],G;if(A.nodeType!==1&&(G=x.substring(g,
|
||||||
|
t))){s&&(G=G.replace(d,"\r"));A.nodeValue=G;var L=A.ownerDocument,o=L.createElement("span");o.className=c[r+1];var v=A.parentNode;v.replaceChild(o,A);o.appendChild(A);g<l&&(j[b+1]=A=L.createTextNode(x.substring(t,l)),v.insertBefore(A,o.nextSibling))}g=t;g>=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
||||||
|
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],
|
||||||
|
O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
||||||
|
Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
|
||||||
|
V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
|
||||||
|
/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],
|
||||||
|
["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}),
|
||||||
|
["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q,
|
||||||
|
hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);
|
||||||
|
p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="<pre>"+a+"</pre>";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1});
|
||||||
|
return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i<p.length&&c.now()<b;i++){for(var d=p[i],j=h,k=d;k=k.previousSibling;){var m=k.nodeType,o=(m===7||m===8)&&k.nodeValue;if(o?!/^\??prettify\b/.test(o):m!==3||/\S/.test(k.nodeValue))break;if(o){j={};o.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(a,b,c){j[b]=c});break}}k=d.className;if((j!==h||e.test(k))&&!v.test(k)){m=!1;for(o=d.parentNode;o;o=o.parentNode)if(f.test(o.tagName)&&
|
||||||
|
o.className&&e.test(o.className)){m=!0;break}if(!m){d.className+=" prettyprinted";m=j.lang;if(!m){var m=k.match(n),y;if(!m&&(y=U(d))&&t.test(y.tagName))m=y.className.match(n);m&&(m=m[1])}if(w.test(d.tagName))o=1;else var o=d.currentStyle,u=s.defaultView,o=(o=o?o.whiteSpace:u&&u.getComputedStyle?u.getComputedStyle(d,q).getPropertyValue("white-space"):0)&&"pre"===o.substring(0,3);u=j.linenums;if(!(u=u==="true"||+u))u=(u=k.match(/\blinenums\b(?::(\d+))?/))?u[1]&&u[1].length?+u[1]:!0:!1;u&&J(d,u,o);r=
|
||||||
|
{h:m,c:d,j:u,i:o};K(r)}}}i<p.length?setTimeout(g,250):"function"===typeof a&&a()}for(var b=d||document.body,s=b.ownerDocument||document,b=[b.getElementsByTagName("pre"),b.getElementsByTagName("code"),b.getElementsByTagName("xmp")],p=[],m=0;m<b.length;++m)for(var j=0,k=b[m].length;j<k;++j)p.push(b[m][j]);var b=q,c=Date;c.now||(c={now:function(){return+new Date}});var i=0,r,n=/\blang(?:uage)?-([\w.]+)(?!\S)/,e=/\bprettyprint\b/,v=/\bprettyprinted\b/,w=/pre|xmp/i,t=/^code$/i,f=/^(?:pre|code|xmp)$/i,
|
||||||
|
h={};g()}};typeof define==="function"&&define.amd&&define("google-code-prettify",[],function(){return Y})})();}()
|
||||||
|
</script>
|
@ -0,0 +1,19 @@
|
|||||||
|
<script>
|
||||||
|
/* Web Font Loader v1.6.24 - (c) Adobe Systems, Google. License: Apache 2.0 */
|
||||||
|
(function(){function aa(a,b,d){return a.call.apply(a.bind,arguments)}function ba(a,b,d){if(!a)throw Error();if(2<arguments.length){var c=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(d,c);return a.apply(b,d)}}return function(){return a.apply(b,arguments)}}function p(a,b,d){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return p.apply(null,arguments)}var q=Date.now||function(){return+new Date};function ca(a,b){this.a=a;this.m=b||a;this.c=this.m.document}var da=!!window.FontFace;function t(a,b,d,c){b=a.c.createElement(b);if(d)for(var e in d)d.hasOwnProperty(e)&&("style"==e?b.style.cssText=d[e]:b.setAttribute(e,d[e]));c&&b.appendChild(a.c.createTextNode(c));return b}function u(a,b,d){a=a.c.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(d,a.lastChild)}function v(a){a.parentNode&&a.parentNode.removeChild(a)}
|
||||||
|
function w(a,b,d){b=b||[];d=d||[];for(var c=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<c.length;g+=1)if(b[e]===c[g]){f=!0;break}f||c.push(b[e])}b=[];for(e=0;e<c.length;e+=1){f=!1;for(g=0;g<d.length;g+=1)if(c[e]===d[g]){f=!0;break}f||b.push(c[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function y(a,b){for(var d=a.className.split(/\s+/),c=0,e=d.length;c<e;c++)if(d[c]==b)return!0;return!1}
|
||||||
|
function z(a){if("string"===typeof a.f)return a.f;var b=a.m.location.protocol;"about:"==b&&(b=a.a.location.protocol);return"https:"==b?"https:":"http:"}function ea(a){return a.m.location.hostname||a.a.location.hostname}
|
||||||
|
function A(a,b,d){function c(){k&&e&&f&&(k(g),k=null)}b=t(a,"link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,k=d||null;da?(b.onload=function(){e=!0;c()},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");c()}):setTimeout(function(){e=!0;c()},0);u(a,"head",b)}
|
||||||
|
function B(a,b,d,c){var e=a.c.getElementsByTagName("head")[0];if(e){var f=t(a,"script",{src:b}),g=!1;f.onload=f.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,d&&d(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f))};e.appendChild(f);setTimeout(function(){g||(g=!0,d&&d(Error("Script load timeout")))},c||5E3);return f}return null};function C(){this.a=0;this.c=null}function D(a){a.a++;return function(){a.a--;E(a)}}function F(a,b){a.c=b;E(a)}function E(a){0==a.a&&a.c&&(a.c(),a.c=null)};function G(a){this.a=a||"-"}G.prototype.c=function(a){for(var b=[],d=0;d<arguments.length;d++)b.push(arguments[d].replace(/[\W_]+/g,"").toLowerCase());return b.join(this.a)};function H(a,b){this.c=a;this.f=4;this.a="n";var d=(b||"n4").match(/^([nio])([1-9])$/i);d&&(this.a=d[1],this.f=parseInt(d[2],10))}function fa(a){return I(a)+" "+(a.f+"00")+" 300px "+J(a.c)}function J(a){var b=[];a=a.split(/,\s*/);for(var d=0;d<a.length;d++){var c=a[d].replace(/['"]/g,"");-1!=c.indexOf(" ")||/^\d/.test(c)?b.push("'"+c+"'"):b.push(c)}return b.join(",")}function K(a){return a.a+a.f}function I(a){var b="normal";"o"===a.a?b="oblique":"i"===a.a&&(b="italic");return b}
|
||||||
|
function ga(a){var b=4,d="n",c=null;a&&((c=a.match(/(normal|oblique|italic)/i))&&c[1]&&(d=c[1].substr(0,1).toLowerCase()),(c=a.match(/([1-9]00|normal|bold)/i))&&c[1]&&(/bold/i.test(c[1])?b=7:/[1-9]00/.test(c[1])&&(b=parseInt(c[1].substr(0,1),10))));return d+b};function ha(a,b){this.c=a;this.f=a.m.document.documentElement;this.h=b;this.a=new G("-");this.j=!1!==b.events;this.g=!1!==b.classes}function ia(a){a.g&&w(a.f,[a.a.c("wf","loading")]);L(a,"loading")}function M(a){if(a.g){var b=y(a.f,a.a.c("wf","active")),d=[],c=[a.a.c("wf","loading")];b||d.push(a.a.c("wf","inactive"));w(a.f,d,c)}L(a,"inactive")}function L(a,b,d){if(a.j&&a.h[b])if(d)a.h[b](d.c,K(d));else a.h[b]()};function ja(){this.c={}}function ka(a,b,d){var c=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=a.c[e];f&&c.push(f(b[e],d))}return c};function N(a,b){this.c=a;this.f=b;this.a=t(this.c,"span",{"aria-hidden":"true"},this.f)}function O(a){u(a.c,"body",a.a)}function P(a){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+J(a.c)+";"+("font-style:"+I(a)+";font-weight:"+(a.f+"00")+";")};function Q(a,b,d,c,e,f){this.g=a;this.j=b;this.a=c;this.c=d;this.f=e||3E3;this.h=f||void 0}Q.prototype.start=function(){var a=this.c.m.document,b=this,d=q(),c=new Promise(function(c,e){function k(){q()-d>=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?c():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,c){setTimeout(c,b.f)});Promise.race([e,c]).then(function(){b.g(b.a)},function(){b.j(b.a)})};function R(a,b,d,c,e,f,g){this.v=a;this.B=b;this.c=d;this.a=c;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.o=this.j=this.h=this.g=null;this.g=new N(this.c,this.s);this.h=new N(this.c,this.s);this.j=new N(this.c,this.s);this.o=new N(this.c,this.s);a=new H(this.a.c+",serif",K(this.a));a=P(a);this.g.a.style.cssText=a;a=new H(this.a.c+",sans-serif",K(this.a));a=P(a);this.h.a.style.cssText=a;a=new H("serif",K(this.a));a=P(a);this.j.a.style.cssText=a;a=new H("sans-serif",K(this.a));a=
|
||||||
|
P(a);this.o.a.style.cssText=a;O(this.g);O(this.h);O(this.j);O(this.o)}var S={D:"serif",C:"sans-serif"},T=null;function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return T}R.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.o.a.offsetWidth;this.A=q();la(this)};
|
||||||
|
function ma(a,b,d){for(var c in S)if(S.hasOwnProperty(c)&&b===a.f[S[c]]&&d===a.f[S[c]])return!0;return!1}function la(a){var b=a.g.a.offsetWidth,d=a.h.a.offsetWidth,c;(c=b===a.f.serif&&d===a.f["sans-serif"])||(c=U()&&ma(a,b,d));c?q()-a.A>=a.w?U()&&ma(a,b,d)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):na(a):V(a,a.v)}function na(a){setTimeout(p(function(){la(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.o.a);b(this.a)},a),0)};function W(a,b,d){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=d}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,K(a).toString(),"active")],[b.a.c("wf",a.c,K(a).toString(),"loading"),b.a.c("wf",a.c,K(a).toString(),"inactive")]);L(b,"fontactive",a);this.o=!0;oa(this)};
|
||||||
|
W.prototype.h=function(a){var b=this.a;if(b.g){var d=y(b.f,b.a.c("wf",a.c,K(a).toString(),"active")),c=[],e=[b.a.c("wf",a.c,K(a).toString(),"loading")];d||c.push(b.a.c("wf",a.c,K(a).toString(),"inactive"));w(b.f,c,e)}L(b,"fontinactive",a);oa(this)};function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),L(a,"active")):M(a.a))};function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}pa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;qa(this,new ha(this.c,a),a)};
|
||||||
|
function ra(a,b,d,c,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=c||null||{};if(0===d.length&&f)M(b.a);else{b.f+=d.length;f&&(b.j=f);var h,m=[];for(h=0;h<d.length;h++){var l=d[h],n=k[l.c],r=b.a,x=l;r.g&&w(r.f,[r.a.c("wf",x.c,K(x).toString(),"loading")]);L(r,"fontloading",x);r=null;null===X&&(X=window.FontFace?(x=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent))?42<parseInt(x[1],10):!0:!1);X?r=new Q(p(b.g,b),p(b.h,b),b.c,l,b.s,n):r=new R(p(b.g,b),p(b.h,b),b.c,l,b.s,a,
|
||||||
|
n);m.push(r)}for(h=0;h<m.length;h++)m[h].start()}},0)}function qa(a,b,d){var c=[],e=d.timeout;ia(b);var c=ka(a.a,d,a.c),f=new W(a.c,b,e);a.h=c.length;b=0;for(d=c.length;b<d;b++)c[b].load(function(b,c,d){ra(a,f,b,c,d)})};function sa(a,b){this.c=a;this.a=b}function ta(a,b,d){var c=z(a.c);a=(a.a.api||"fast.fonts.net/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return c+"//"+a+"/"+b+".js"+(d?"?v="+d:"")}
|
||||||
|
sa.prototype.load=function(a){function b(){if(e["__mti_fntLst"+d]){var c=e["__mti_fntLst"+d](),g=[],k;if(c)for(var h=0;h<c.length;h++){var m=c[h].fontfamily;void 0!=c[h].fontStyle&&void 0!=c[h].fontWeight?(k=c[h].fontStyle+c[h].fontWeight,g.push(new H(m,k))):g.push(new H(m))}a(g)}else setTimeout(function(){b()},50)}var d=this.a.projectId,c=this.a.version;if(d){var e=this.c.m;B(this.c,ta(this,d,c),function(c){c?a([]):b()}).id="__MonotypeAPIScript__"+d}else a([])};function ua(a,b){this.c=a;this.a=b}ua.prototype.load=function(a){var b,d,c=this.a.urls||[],e=this.a.families||[],f=this.a.testStrings||{},g=new C;b=0;for(d=c.length;b<d;b++)A(this.c,c[b],D(g));var k=[];b=0;for(d=e.length;b<d;b++)if(c=e[b].split(":"),c[1])for(var h=c[1].split(","),m=0;m<h.length;m+=1)k.push(new H(c[0],h[m]));else k.push(new H(c[0]));F(g,function(){a(k,f)})};function va(a,b,d){a?this.c=a:this.c=b+wa;this.a=[];this.f=[];this.g=d||""}var wa="//fonts.googleapis.com/css";function xa(a,b){for(var d=b.length,c=0;c<d;c++){var e=b[c].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}}
|
||||||
|
function ya(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var b=a.a.length,d=[],c=0;c<b;c++)d.push(a.a[c].replace(/ /g,"+"));b=a.c+"?family="+d.join("%7C");0<a.f.length&&(b+="&subset="+a.f.join(","));0<a.g.length&&(b+="&text="+encodeURIComponent(a.g));return b};function za(a){this.f=a;this.a=[];this.c={}}
|
||||||
|
var Aa={latin:"BESbswy",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},Ba={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ca={i:"i",italic:"i",n:"n",normal:"n"},Da=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
|
||||||
|
function Ea(a){for(var b=a.f.length,d=0;d<b;d++){var c=a.f[d].split(":"),e=c[0].replace(/\+/g," "),f=["n4"];if(2<=c.length){var g;var k=c[1];g=[];if(k)for(var k=k.split(","),h=k.length,m=0;m<h;m++){var l;l=k[m];if(l.match(/^[\w-]+$/)){var n=Da.exec(l.toLowerCase());if(null==n)l="";else{l=n[2];l=null==l||""==l?"n":Ca[l];n=n[1];if(null==n||""==n)n="4";else var r=Ba[n],n=r?r:isNaN(n)?"4":n.substr(0,1);l=[l,n].join("")}}else l="";l&&g.push(l)}0<g.length&&(f=g);3==c.length&&(c=c[2],g=[],c=c?c.split(","):
|
||||||
|
g,0<c.length&&(c=Aa[c[0]])&&(a.c[e]=c))}a.c[e]||(c=Aa[e])&&(a.c[e]=c);for(c=0;c<f.length;c+=1)a.a.push(new H(e,f[c]))}};function Fa(a,b){this.c=a;this.a=b}var Ga={Arimo:!0,Cousine:!0,Tinos:!0};Fa.prototype.load=function(a){var b=new C,d=this.c,c=new va(this.a.api,z(d),this.a.text),e=this.a.families;xa(c,e);var f=new za(e);Ea(f);A(d,ya(c),D(b));F(b,function(){a(f.a,f.c,Ga)})};function Ha(a,b){this.c=a;this.a=b}Ha.prototype.load=function(a){var b=this.a.id,d=this.c.m;b?B(this.c,(this.a.api||"https://use.typekit.net")+"/"+b+".js",function(b){if(b)a([]);else if(d.Typekit&&d.Typekit.config&&d.Typekit.config.fn){b=d.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2)for(var g=b[f],k=b[f+1],h=0;h<k.length;h++)e.push(new H(g,k[h]));try{d.Typekit.load({events:!1,classes:!1,async:!0})}catch(m){}a(e)}},2E3):a([])};function Ia(a,b){this.c=a;this.f=b;this.a=[]}Ia.prototype.load=function(a){var b=this.f.id,d=this.c.m,c=this;b?(d.__webfontfontdeckmodule__||(d.__webfontfontdeckmodule__={}),d.__webfontfontdeckmodule__[b]=function(b,d){for(var g=0,k=d.fonts.length;g<k;++g){var h=d.fonts[g];c.a.push(new H(h.name,ga("font-weight:"+h.weight+";font-style:"+h.style)))}a(c.a)},B(this.c,z(this.c)+(this.f.api||"//f.fontdeck.com/s/css/js/")+ea(this.c)+"/"+b+".js",function(b){b&&a([])})):a([])};var Y=new pa(window);Y.a.c.custom=function(a,b){return new ua(b,a)};Y.a.c.fontdeck=function(a,b){return new Ia(b,a)};Y.a.c.monotype=function(a,b){return new sa(b,a)};Y.a.c.typekit=function(a,b){return new Ha(b,a)};Y.a.c.google=function(a,b){return new Fa(b,a)};var Z={load:p(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return Z}):"undefined"!==typeof module&&module.exports?module.exports=Z:(window.WebFont=Z,window.WebFontConfig&&Y.load(window.WebFontConfig));}());
|
||||||
|
</script>
|
@ -0,0 +1,26 @@
|
|||||||
|
<tr><td style="width:150px;">{{paramName}}{{^required}}{{/required}}{{#required}}*{{/required}}</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
var schemaWrapper = {{{jsonSchema}}};
|
||||||
|
var schema = schemaWrapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var view = new JSONSchemaView(schema,0);
|
||||||
|
var result = $('#d2e199_{{nickname}}_{{paramName}}');
|
||||||
|
result.empty();
|
||||||
|
result.append(view.render());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div id="d2e199_{{nickname}}_{{paramName}}"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
@ -0,0 +1,35 @@
|
|||||||
|
<tr><td style="width:150px;">{{paramName}} {{^required}}{{/required}}{{#required}}<span style="color:red;">*</span>{{/required}}</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
var schemaWrapper = {{{jsonSchema}}};
|
||||||
|
|
||||||
|
var schema = schemaWrapper.schema;
|
||||||
|
schemaWrapper.definitions = defs;
|
||||||
|
JsonRefs.resolveRefs(schemaWrapper, {"depth":3, "resolveRemoteRefs":false,"resolveFileRefs":false },function (err, resolved, metadata) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var view = new JSONSchemaView(resolved.schema,2,{isBodyParam: true});
|
||||||
|
|
||||||
|
var result = $('#d2e199_{{nickname}}_{{paramName}}');
|
||||||
|
result.empty();
|
||||||
|
result.append(view.render());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div id="d2e199_{{nickname}}_{{paramName}}"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
@ -0,0 +1,18 @@
|
|||||||
|
import {{{package}}}.{{{classname}}};
|
||||||
|
|
||||||
|
public class {{{classname}}}Example {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
{{{classname}}} apiInstance = new {{{classname}}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||||
|
{{/allParams}}
|
||||||
|
try {
|
||||||
|
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
System.out.println(result);{{/returnType}}
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using {{packageName}}.Api;
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
{{#modelPackage}}
|
||||||
|
using {{{.}}};
|
||||||
|
{{/modelPackage}}
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class {{operationId}}Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
Configuration.Default.Username = "YOUR_USERNAME";
|
||||||
|
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
var apiInstance = new {{classname}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{#isPrimitiveType}}
|
||||||
|
var {{paramName}} = {{example}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
{{#summary}}
|
||||||
|
// {{{.}}}
|
||||||
|
{{/summary}}
|
||||||
|
{{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
Debug.WriteLine(result);{{/returnType}}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
import {{{invokerPackage}}}.*;
|
||||||
|
import {{{invokerPackage}}}.auth.*;
|
||||||
|
import {{{invokerPackage}}}.model.*;
|
||||||
|
import {{{package}}}.{{{classname}}};
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class {{{classname}}}Example {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
{{#hasAuthMethods}}ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||||
|
{{{name}}}.setUsername("YOUR USERNAME");
|
||||||
|
{{{name}}}.setPassword("YOUR PASSWORD");{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||||
|
{{{name}}}.setApiKey("YOUR API KEY");
|
||||||
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
|
//{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||||
|
{{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}
|
||||||
|
{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
{{{classname}}} apiInstance = new {{{classname}}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||||
|
{{/allParams}}
|
||||||
|
try {
|
||||||
|
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
System.out.println(result);{{/returnType}}
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
var {{{moduleName}}} = require('{{{projectName}}}');
|
||||||
|
{{#hasAuthMethods}}
|
||||||
|
var defaultClient = {{{moduleName}}}.ApiClient.instance;
|
||||||
|
{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
|
||||||
|
{{{name}}}.username = 'YOUR USERNAME'
|
||||||
|
{{{name}}}.password = 'YOUR PASSWORD'{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
|
||||||
|
{{{name}}}.apiKey = "YOUR API KEY"
|
||||||
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
|
//{{{name}}}.apiKeyPrefix['{{{keyParamName}}}'] = "Token"{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
|
||||||
|
{{{name}}}.accessToken = "YOUR ACCESS TOKEN"{{/isOAuth}}
|
||||||
|
{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
var api = new {{{moduleName}}}.{{{classname}}}(){{#hasParams}}
|
||||||
|
{{#vendorExtensions.x-codegen-hasRequiredParams}}{{#allParams}}{{#required}}
|
||||||
|
var {{{paramName}}} = {{{example}}}; // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}
|
||||||
|
{{/required}}{{/allParams}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}}
|
||||||
|
var opts = { {{#allParams}}{{^required}}
|
||||||
|
'{{{paramName}}}': {{{example}}}{{#vendorExtensions.x-codegen-hasMoreOptional}},{{/vendorExtensions.x-codegen-hasMoreOptional}} // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}{{/required}}{{/allParams}}
|
||||||
|
};{{/hasOptionalParams}}{{/hasParams}}
|
||||||
|
{{#usePromises}}
|
||||||
|
api.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}).then(function({{#returnType}}data{{/returnType}}) {
|
||||||
|
{{#returnType}}console.log('API called successfully. Returned data: ' + data);{{/returnType}}{{^returnType}}console.log('API called successfully.');{{/returnType}}
|
||||||
|
}, function(error) {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
{{/usePromises}}{{^usePromises}}
|
||||||
|
var callback = function(error, data, response) {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
{{#returnType}}console.log('API called successfully. Returned data: ' + data);{{/returnType}}{{^returnType}}console.log('API called successfully.');{{/returnType}}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
api.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}{{#hasParams}}, {{/hasParams}}callback);
|
||||||
|
{{/usePromises}}
|
@ -0,0 +1,34 @@
|
|||||||
|
{{#hasAuthMethods}}
|
||||||
|
{{classPrefix}}Configuration *apiConfig = [{{classPrefix}}Configuration sharedConfig];
|
||||||
|
{{#authMethods}}{{#isBasic}}// Configure HTTP basic authorization (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setUsername:@"YOUR_USERNAME"];
|
||||||
|
[apiConfig setPassword:@"YOUR_PASSWORD"];
|
||||||
|
{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"{{{keyParamName}}}"];
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"{{{keyParamName}}}"];
|
||||||
|
{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: (authentication scheme: {{{name}}})
|
||||||
|
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
|
||||||
|
{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
{{#allParams}}{{{dataType}}} *{{paramName}} = {{{example}}}; // {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
{{classname}} *apiInstance = [[{{classname}} alloc] init];
|
||||||
|
|
||||||
|
{{#summary}}// {{{.}}}
|
||||||
|
{{/summary}}[apiInstance {{#vendorExtensions.x-objc-operationId}}{{vendorExtensions.x-objc-operationId}}{{/vendorExtensions.x-objc-operationId}}{{^vendorExtensions.x-objc-operationId}}{{nickname}}{{#hasParams}}With{{vendorExtensions.firstParamAltName}}{{/hasParams}}{{^hasParams}}WithCompletionHandler: {{/hasParams}}{{/vendorExtensions.x-objc-operationId}}{{#allParams}}{{#secondaryParam}}
|
||||||
|
{{paramName}}{{/secondaryParam}}:{{paramName}}{{/allParams}}
|
||||||
|
{{#hasParams}}completionHandler: {{/hasParams}}^({{#returnBaseType}}{{{returnType}}} output, {{/returnBaseType}}NSError* error) {
|
||||||
|
{{#returnType}}
|
||||||
|
if (output) {
|
||||||
|
NSLog(@"%@", output);
|
||||||
|
}
|
||||||
|
{{/returnType}}
|
||||||
|
if (error) {
|
||||||
|
NSLog(@"Error: %@", error);
|
||||||
|
}
|
||||||
|
}];
|
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
|
||||||
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer');{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
$api_instance = new {{invokerPackage}}\Api\{{classname}}();
|
||||||
|
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try {
|
||||||
|
{{#returnType}}$result = {{/returnType}}$api_instance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
print_r($result);{{/returnType}}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
@ -0,0 +1,415 @@
|
|||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
* Content
|
||||||
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
body {
|
||||||
|
min-width: 980px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body, p, a, div, th, td {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
text-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.code {
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: "Source Code Pro", monospace;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
padding-top: 16px;
|
||||||
|
z-Index: -1;
|
||||||
|
margin-left: 270px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-family: "Source Sans Pro Semibold", sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 44px;
|
||||||
|
line-height: 50px;
|
||||||
|
margin: 0 0 10px 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
border-top: 1px solid #ebebeb;
|
||||||
|
padding: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
section h1 {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-bottom: 14px;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
article {
|
||||||
|
padding: 14px 0 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
article h1 {
|
||||||
|
font-family: "Source Sans Pro Bold", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
article h2 {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 18px;
|
||||||
|
line-height: 24px;
|
||||||
|
margin: 0 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
article h3 {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 18px;
|
||||||
|
margin: 0 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
article h4 {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 16px;
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
text-align: left;
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border: #e0e0e0 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
vertical-align: top;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border: #e0e0e0 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#generator .content {
|
||||||
|
color: #b0b0b0;
|
||||||
|
border-top: 1px solid #ebebeb;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-optional {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.open-left {
|
||||||
|
right: 0;
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
* apidoc - intro
|
||||||
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#apidoc .apidoc {
|
||||||
|
border-top: 1px solid #ebebeb;
|
||||||
|
padding: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apidoc h1 {
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-bottom: 14px;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apidoc h2 {
|
||||||
|
font-family: "Source Sans Pro Bold", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 22px;
|
||||||
|
line-height: 26px;
|
||||||
|
padding-top: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
* pre / code
|
||||||
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
pre {
|
||||||
|
background-color: #292b36;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
position: relative;
|
||||||
|
margin: 10px 0 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
code.language-text {
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-json {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-html {
|
||||||
|
margin: 40px 0 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-html:before {
|
||||||
|
content: attr(data-type);
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
left: 0;
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 15px;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 5px;
|
||||||
|
border-radius: 6px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background-color: #3387CC;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-html[data-type="get"]:before {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-html[data-type="put"]:before {
|
||||||
|
background-color: #e5c500;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-html[data-type="post"]:before {
|
||||||
|
background-color: #4070ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-html[data-type="delete"]:before {
|
||||||
|
background-color: #ed0039;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-api .str {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.language-api .pln,
|
||||||
|
pre.language-api .pun {
|
||||||
|
color: #65B042;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre code {
|
||||||
|
display: block;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: "Source Code Pro", monospace;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre code.sample-request-response-json {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
max-height: 500px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
* Sidenav
|
||||||
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
.sidenav {
|
||||||
|
width: 228px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidenav > li > a {
|
||||||
|
display: block;
|
||||||
|
width: 192px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px 11px;
|
||||||
|
border: 0;
|
||||||
|
border-left: transparent 4px solid;
|
||||||
|
border-right: transparent 4px solid;
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidenav > li.nav-header > a {
|
||||||
|
padding: 5px 15px;
|
||||||
|
border: 1px solid #e5e5e5;
|
||||||
|
width: 190px;
|
||||||
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
background-color: #4c8eca;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidenav > li.nav-header.active > a {
|
||||||
|
background-color: #4c8eca;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
00427D
|
||||||
|
|
||||||
|
.sidenav > .active > a {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidenav > li > a:hover {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidenav > li.has-modifications a {
|
||||||
|
border-right: #60d060 4px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidenav > li.is-new a {
|
||||||
|
border-left: #e5e5e5 4px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
* Tabs
|
||||||
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
ul.nav-tabs {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
* Print
|
||||||
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
|
||||||
|
#sidenav,
|
||||||
|
#version,
|
||||||
|
#versions,
|
||||||
|
section .version,
|
||||||
|
section .versions {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:after {
|
||||||
|
content: " [" attr(href) "] ";
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #000000
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
padding: 10px;
|
||||||
|
border: #808080 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
position: relative;
|
||||||
|
margin: 10px 0 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* /@media print */
|
||||||
|
|
||||||
|
|
||||||
|
.doc-chapter
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
background-color: #eee;
|
||||||
|
border-radius: 1px;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* json-schema-view-js
|
||||||
|
* https://github.com/mohsen1/json-schema-view-js#readme
|
||||||
|
* Version: 0.4.1 - 2015-11-12T17:19:27.615Z
|
||||||
|
* License: MIT
|
||||||
|
*/.json-schema-view .toggle-handle:after,.json-schema-view.json-schema-view-dark .toggle-handle:after,json-schema-view .toggle-handle:after,json-schema-view[json-schema-view-dark] .toggle-handle:after{content:"\25BC"}.json-schema-view .title,.json-schema-view.json-schema-view-dark .title,json-schema-view .title,json-schema-view[json-schema-view-dark] .title{font-weight:700;cursor:pointer}.json-schema-view,json-schema-view{font-family:monospace;font-size:0;display:table-cell}.json-schema-view>*,json-schema-view>*{font-size:14px}.json-schema-view .toggle-handle,json-schema-view .toggle-handle{cursor:pointer;margin:auto .3em;font-size:10px;display:inline-block;transform-origin:50% 40%;transition:transform 150ms ease-in}.json-schema-view .toggle-handle,.json-schema-view .toggle-handle:hover,json-schema-view .toggle-handle,json-schema-view .toggle-handle:hover{text-decoration:none;color:#333}.json-schema-view .description,json-schema-view .description{color:gray;font-style:italic}
|
||||||
|
.pattern {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
.default {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.required {
|
||||||
|
color:black;
|
||||||
|
}
|
||||||
|
.json-schema-view .title,.json-schema-view .title:hover,json-schema-view .title,json-schema-view .title:hover{text-decoration:none;color:#333}.json-schema-view .brace,.json-schema-view .bracket,.json-schema-view .title,json-schema-view .brace,json-schema-view .bracket,json-schema-view .title{color:#333}.json-schema-view .property,json-schema-view .property{font-size:0;display:table-row}.json-schema-view .property>*,json-schema-view .property>*{font-size:14px;padding:.2em}.json-schema-view .name,json-schema-view .name{color:#00f;display:table-cell;vertical-align:top}.json-schema-view .type,json-schema-view .type{color:green}.json-schema-view .type-any,json-schema-view .type-any{color:#33f}.json-schema-view .required,json-schema-view .required{color:red}.json-schema-view .inner,json-schema-view .inner{padding-left:18px}.json-schema-view.collapsed .description,.json-schema-view.collapsed .property,json-schema-view.collapsed .description,json-schema-view.collapsed .property{display:none}.json-schema-view.collapsed .closeing.brace,json-schema-view.collapsed .closeing.brace{display:inline-block}.json-schema-view.collapsed .toggle-handle,json-schema-view.collapsed .toggle-handle{transform:rotate(-90deg)}.json-schema-view.json-schema-view-dark,json-schema-view[json-schema-view-dark]{font-family:monospace;font-size:0;display:table-cell}.json-schema-view.json-schema-view-dark>*,json-schema-view[json-schema-view-dark]>*{font-size:14px}.json-schema-view.json-schema-view-dark .toggle-handle,json-schema-view[json-schema-view-dark] .toggle-handle{cursor:pointer;margin:auto .3em;font-size:10px;display:inline-block;transform-origin:50% 40%;transition:transform 150ms ease-in}.json-schema-view.json-schema-view-dark .toggle-handle,.json-schema-view.json-schema-view-dark .toggle-handle:hover,json-schema-view[json-schema-view-dark] .toggle-handle,json-schema-view[json-schema-view-dark] .toggle-handle:hover{text-decoration:none;color:#eee}.json-schema-view.json-schema-view-dark .description,json-schema-view[json-schema-view-dark] .description{color:gray;font-style:italic}.json-schema-view.json-schema-view-dark .title,.json-schema-view.json-schema-view-dark .title:hover,json-schema-view[json-schema-view-dark] .title,json-schema-view[json-schema-view-dark] .title:hover{text-decoration:none;color:#eee}.json-schema-view.json-schema-view-dark .brace,.json-schema-view.json-schema-view-dark .bracket,.json-schema-view.json-schema-view-dark .title,json-schema-view[json-schema-view-dark] .brace,json-schema-view[json-schema-view-dark] .bracket,json-schema-view[json-schema-view-dark] .title{color:#eee}.json-schema-view.json-schema-view-dark .property,json-schema-view[json-schema-view-dark] .property{font-size:0;display:table-row}.json-schema-view.json-schema-view-dark .property>*,json-schema-view[json-schema-view-dark] .property>*{font-size:14px;padding:.2em}.json-schema-view.json-schema-view-dark .name,json-schema-view[json-schema-view-dark] .name{color:#add8e6;display:table-cell;vertical-align:top}.json-schema-view.json-schema-view-dark .type,json-schema-view[json-schema-view-dark] .type{color:#90ee90}.json-schema-view.json-schema-view-dark .type-any,json-schema-view[json-schema-view-dark] .type-any{color:#d4ebf2}.json-schema-view.json-schema-view-dark .required,json-schema-view[json-schema-view-dark] .required{color:#fe0000}.json-schema-view.json-schema-view-dark .inner,json-schema-view[json-schema-view-dark] .inner{padding-left:18px}.json-schema-view.json-schema-view-dark.collapsed .description,.json-schema-view.json-schema-view-dark.collapsed .property,json-schema-view[json-schema-view-dark].collapsed .description,json-schema-view[json-schema-view-dark].collapsed .property{display:none}.json-schema-view.json-schema-view-dark.collapsed .closeing.brace,json-schema-view[json-schema-view-dark].collapsed .closeing.brace{display:inline-block}.json-schema-view.json-schema-view-dark.collapsed .toggle-handle,json-schema-view[json-schema-view-dark].collapsed .toggle-handle{transform:rotate(-90deg)}
|
@ -129,27 +129,27 @@ use \{{invokerPackage}}\ObjectSerializer;
|
|||||||
{{/required}}
|
{{/required}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
if (strlen(${{paramName}}) > {{maxLength}}) {
|
if ({{^required}}!is_null(${{paramName}}) && {{/required}}(strlen(${{paramName}}) > {{maxLength}})) {
|
||||||
throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.');
|
throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.');
|
||||||
}
|
}
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
if (strlen(${{paramName}}) < {{minLength}}) {
|
if ({{^required}}!is_null(${{paramName}}) && {{/required}}(strlen(${{paramName}}) < {{minLength}})) {
|
||||||
throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.');
|
throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.');
|
||||||
}
|
}
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
if (${{paramName}} > {{maximum}}) {
|
if ({{^required}}!is_null(${{paramName}}) && {{/required}}(${{paramName}} > {{maximum}})) {
|
||||||
throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maximum}}.');
|
throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maximum}}.');
|
||||||
}
|
}
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
if (${{paramName}} < {{minimum}}) {
|
if ({{^required}}!is_null(${{paramName}}) && {{/required}}(${{paramName}} < {{minimum}})) {
|
||||||
throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minimum}}.');
|
throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minimum}}.');
|
||||||
}
|
}
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
if (!preg_match("{{pattern}}", ${{paramName}})) {
|
if ({{^required}}!is_null(${{paramName}}) && {{/required}}!preg_match("{{pattern}}", ${{paramName}})) {
|
||||||
throw new \InvalidArgumentException('invalid value for "{{paramName}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{pattern}}.');
|
throw new \InvalidArgumentException('invalid value for "{{paramName}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{pattern}}.');
|
||||||
}
|
}
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
|
@ -128,27 +128,27 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
|||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
if (strlen($this->container['{{name}}']) > {{maxLength}}) {
|
if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}(strlen($this->container['{{name}}']) > {{maxLength}})) {
|
||||||
$invalid_properties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}.";
|
$invalid_properties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}.";
|
||||||
}
|
}
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
if (strlen($this->container['{{name}}']) < {{minLength}}) {
|
if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}(strlen($this->container['{{name}}']) < {{minLength}})) {
|
||||||
$invalid_properties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}.";
|
$invalid_properties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}.";
|
||||||
}
|
}
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
if ($this->container['{{name}}'] > {{maximum}}) {
|
if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}($this->container['{{name}}'] > {{maximum}})) {
|
||||||
$invalid_properties[] = "invalid value for '{{name}}', must be smaller than or equal to {{maximum}}.";
|
$invalid_properties[] = "invalid value for '{{name}}', must be smaller than or equal to {{maximum}}.";
|
||||||
}
|
}
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
if ($this->container['{{name}}'] < {{minimum}}) {
|
if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}($this->container['{{name}}'] < {{minimum}})) {
|
||||||
$invalid_properties[] = "invalid value for '{{name}}', must be bigger than or equal to {{minimum}}.";
|
$invalid_properties[] = "invalid value for '{{name}}', must be bigger than or equal to {{minimum}}.";
|
||||||
}
|
}
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
if (!preg_match("{{pattern}}", $this->container['{{name}}'])) {
|
if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}!preg_match("{{pattern}}", $this->container['{{name}}'])) {
|
||||||
$invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{pattern}}.";
|
$invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{pattern}}.";
|
||||||
}
|
}
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
|
@ -57,31 +57,31 @@ module {{moduleName}}
|
|||||||
{{/required}}
|
{{/required}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
if {{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length > {{{maxLength}}}
|
if {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length > {{{maxLength}}}
|
||||||
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be smaller than or equal to {{{maxLength}}}.'
|
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be smaller than or equal to {{{maxLength}}}.'
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
if {{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length < {{{minLength}}}
|
if {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length < {{{minLength}}}
|
||||||
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be great than or equal to {{{minLength}}}.'
|
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be great than or equal to {{{minLength}}}.'
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
if {{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} > {{{maximum}}}
|
if {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} > {{{maximum}}}
|
||||||
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{{maximum}}}.'
|
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{{maximum}}}.'
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
if {{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} < {{{minimum}}}
|
if {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} < {{{minimum}}}
|
||||||
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be greater than or equal to {{{minimum}}}.'
|
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be greater than or equal to {{{minimum}}}.'
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
if {{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} !~ Regexp.new({{{pattern}}})
|
if {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} !~ Regexp.new({{{pattern}}})
|
||||||
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.'
|
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,42 +77,46 @@
|
|||||||
# @return Array for valid properies with the reasons
|
# @return Array for valid properies with the reasons
|
||||||
def list_invalid_properties
|
def list_invalid_properties
|
||||||
invalid_properties = Array.new
|
invalid_properties = Array.new
|
||||||
|
{{#vars}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
|
{{#required}}
|
||||||
if @{{{name}}}.nil?
|
if @{{{name}}}.nil?
|
||||||
fail ArgumentError, "{{{name}}} cannot be nil"
|
invalid_properties.push("invalid value for '{{{name}}}', {{{name}}} cannot be nil.")
|
||||||
end
|
end
|
||||||
|
{{/required}}
|
||||||
|
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
if @{{{name}}}.to_s.length > {{{maxLength}}}
|
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}}
|
||||||
invalid_properties.push("invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}.")
|
invalid_properties.push("invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
if @{{{name}}}.to_s.length < {{{minLength}}}
|
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}}
|
||||||
invalid_properties.push("invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}.")
|
invalid_properties.push("invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
if @{{{name}}} > {{{maximum}}}
|
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} > {{{maximum}}}
|
||||||
invalid_properties.push("invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}.")
|
invalid_properties.push("invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
if @{{{name}}} < {{{minimum}}}
|
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} < {{{minimum}}}
|
||||||
invalid_properties.push("invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}.")
|
invalid_properties.push("invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
if @{{{name}}} !~ Regexp.new({{{pattern}}})
|
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ Regexp.new({{{pattern}}})
|
||||||
invalid_properties.push("invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}.")
|
invalid_properties.push("invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
{{/hasValidation}}
|
{{/hasValidation}}
|
||||||
|
{{/vars}}
|
||||||
return invalid_properties
|
return invalid_properties
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -131,19 +135,19 @@
|
|||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
return false if @{{{name}}}.to_s.length > {{{maxLength}}}
|
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}}
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
return false if @{{{name}}}.to_s.length < {{{minLength}}}
|
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}}
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
return false if @{{{name}}} > {{{maximum}}}
|
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} > {{{maximum}}}
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
return false if @{{{name}}} < {{{minimum}}}
|
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} < {{{minimum}}}
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
return false if @{{{name}}} !~ Regexp.new({{{pattern}}})
|
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ Regexp.new({{{pattern}}})
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
{{/hasValidation}}
|
{{/hasValidation}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
@ -170,36 +174,38 @@
|
|||||||
# Custom attribute writer method with validation
|
# Custom attribute writer method with validation
|
||||||
# @param [Object] {{{name}}} Value to be assigned
|
# @param [Object] {{{name}}} Value to be assigned
|
||||||
def {{{name}}}=({{{name}}})
|
def {{{name}}}=({{{name}}})
|
||||||
|
{{#required}}
|
||||||
if {{{name}}}.nil?
|
if {{{name}}}.nil?
|
||||||
fail ArgumentError, "{{{name}}} cannot be nil"
|
fail ArgumentError, "{{{name}}} cannot be nil"
|
||||||
end
|
end
|
||||||
|
{{/required}}
|
||||||
|
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
if {{{name}}}.to_s.length > {{{maxLength}}}
|
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.length > {{{maxLength}}}
|
||||||
fail ArgumentError, "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}."
|
fail ArgumentError, "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}."
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
if {{{name}}}.to_s.length < {{{minLength}}}
|
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.length < {{{minLength}}}
|
||||||
fail ArgumentError, "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}."
|
fail ArgumentError, "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}."
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
if {{{name}}} > {{{maximum}}}
|
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} > {{{maximum}}}
|
||||||
fail ArgumentError, "invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}."
|
fail ArgumentError, "invalid value for '{{{name}}}', must be smaller than or equal to {{{maximum}}}."
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
if {{{name}}} < {{{minimum}}}
|
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} < {{{minimum}}}
|
||||||
fail ArgumentError, "invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}."
|
fail ArgumentError, "invalid value for '{{{name}}}', must be greater than or equal to {{{minimum}}}."
|
||||||
end
|
end
|
||||||
|
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
if @{{{name}}} !~ Regexp.new({{{pattern}}})
|
if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}} !~ Regexp.new({{{pattern}}})
|
||||||
fail ArgumentError, "invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}."
|
fail ArgumentError, "invalid value for '{{{name}}}', must conform to the pattern {{{pattern}}}."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,6 +28,24 @@ public class LumenServerOptionsTest extends AbstractOptionsTest {
|
|||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(LumenServerOptionsProvider.SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(LumenServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
|
clientCodegen.setParameterNamingConvention(LumenServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE);
|
||||||
|
clientCodegen.setModelPackage(LumenServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setApiPackage(LumenServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
|
times = 1;
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setInvokerPackage(LumenServerOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setPackagePath(LumenServerOptionsProvider.PACKAGE_PATH_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setSrcBasePath(LumenServerOptionsProvider.SRC_BASE_PATH_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setGitUserId(LumenServerOptionsProvider.GIT_USER_ID_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setGitRepoId(LumenServerOptionsProvider.GIT_REPO_ID_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setArtifactVersion(LumenServerOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,24 @@
|
|||||||
package io.swagger.codegen.options;
|
package io.swagger.codegen.options;
|
||||||
|
|
||||||
import io.swagger.codegen.CodegenConstants;
|
import io.swagger.codegen.CodegenConstants;
|
||||||
|
import io.swagger.codegen.languages.AbstractPhpCodegen;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class LumenServerOptionsProvider implements OptionsProvider {
|
public class LumenServerOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
public static final String SORT_PARAMS_VALUE = "false";
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||||
|
public static final String VARIABLE_NAMING_CONVENTION_VALUE = "snake_case";
|
||||||
|
public static final String INVOKER_PACKAGE_VALUE = "lumen";
|
||||||
|
public static final String PACKAGE_PATH_VALUE = "php";
|
||||||
|
public static final String SRC_BASE_PATH_VALUE = "libPhp";
|
||||||
|
public static final String GIT_USER_ID_VALUE = "gitSwaggerPhp";
|
||||||
|
public static final String GIT_REPO_ID_VALUE = "git-swagger-php";
|
||||||
|
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLanguage() {
|
public String getLanguage() {
|
||||||
@ -18,8 +28,17 @@ public class LumenServerOptionsProvider implements OptionsProvider {
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, String> createOptions() {
|
public Map<String, String> createOptions() {
|
||||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
|
.put(AbstractPhpCodegen.VARIABLE_NAMING_CONVENTION, VARIABLE_NAMING_CONVENTION_VALUE)
|
||||||
|
.put(AbstractPhpCodegen.PACKAGE_PATH, PACKAGE_PATH_VALUE)
|
||||||
|
.put(AbstractPhpCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
|
||||||
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||||
|
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||||
|
.put(CodegenConstants.GIT_USER_ID, GIT_USER_ID_VALUE)
|
||||||
|
.put(CodegenConstants.GIT_REPO_ID, GIT_REPO_ID_VALUE)
|
||||||
|
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# SwaggerClient-php
|
# SwaggerClient-php
|
||||||
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
|
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 --
|
||||||
|
|
||||||
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
- API version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
|
- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
- Build date: 2016-07-12T18:29:31.200+08:00
|
- Build date: 2016-07-29T14:59:34.783+02:00
|
||||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -58,10 +58,10 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\FakeApi();
|
$api_instance = new Swagger\Client\Api\FakeApi();
|
||||||
$test_code_inject____end_rn_n_r = "test_code_inject____end_rn_n_r_example"; // string | To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
$test_code_inject____end____rn_n_r = "test_code_inject____end____rn_n_r_example"; // string | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$api_instance->testCodeInjectEndRnNR($test_code_inject____end_rn_n_r);
|
$api_instance->testCodeInjectEndRnNR($test_code_inject____end____rn_n_r);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
|
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
|
||||||
}
|
}
|
||||||
@ -71,11 +71,11 @@ try {
|
|||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r*
|
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
*FakeApi* | [**testCodeInjectEndRnNR**](docs/Api/FakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
*FakeApi* | [**testCodeInjectEndRnNR**](docs/Api/FakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
|
|
||||||
## Documentation For Models
|
## Documentation For Models
|
||||||
@ -86,24 +86,24 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation For Authorization
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
## api_key
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: api_key */ ' " =end \r\n \n \r
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
## petstore_auth
|
## petstore_auth
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- **write:pets**: modify pets in your account */ ' " =end \r\n \n \r
|
- **write:pets**: modify pets in your account */ ' " =end -- \r\n \n \r
|
||||||
- **read:pets**: read your pets */ ' " =end \r\n \n \r
|
- **read:pets**: read your pets */ ' " =end -- \r\n \n \r
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
# Swagger\Client\FakeApi
|
# Swagger\Client\FakeApi
|
||||||
|
|
||||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r*
|
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**testCodeInjectEndRnNR**](FakeApi.md#testCodeInjectEndRnNR) | **PUT** /fake | To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
[**testCodeInjectEndRnNR**](FakeApi.md#testCodeInjectEndRnNR) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
|
|
||||||
# **testCodeInjectEndRnNR**
|
# **testCodeInjectEndRnNR**
|
||||||
> testCodeInjectEndRnNR($test_code_inject____end_rn_n_r)
|
> testCodeInjectEndRnNR($test_code_inject____end____rn_n_r)
|
||||||
|
|
||||||
To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```php
|
```php
|
||||||
@ -18,10 +18,10 @@ To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\FakeApi();
|
$api_instance = new Swagger\Client\Api\FakeApi();
|
||||||
$test_code_inject____end_rn_n_r = "test_code_inject____end_rn_n_r_example"; // string | To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
$test_code_inject____end____rn_n_r = "test_code_inject____end____rn_n_r_example"; // string | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$api_instance->testCodeInjectEndRnNR($test_code_inject____end_rn_n_r);
|
$api_instance->testCodeInjectEndRnNR($test_code_inject____end____rn_n_r);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
|
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**test_code_inject____end_rn_n_r** | **string**| To test code injection *_/ ' \" =end \\r\\n \\n \\r | [optional]
|
**test_code_inject____end____rn_n_r** | **string**| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -44,8 +44,8 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, *_/ \" =end
|
- **Content-Type**: application/json, *_/ \" =end --
|
||||||
- **Accept**: application/json, *_/ \" =end
|
- **Accept**: application/json, *_/ \" =end --
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**return** | **int** | property description *_/ ' \" =end \\r\\n \\n \\r | [optional]
|
**return** | **int** | property description *_/ ' \" =end -- \\r\\n \\n \\r | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -73,7 +73,7 @@ class FakeApi
|
|||||||
{
|
{
|
||||||
if ($apiClient == null) {
|
if ($apiClient == null) {
|
||||||
$apiClient = new ApiClient();
|
$apiClient = new ApiClient();
|
||||||
$apiClient->getConfig()->setHost('https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r');
|
$apiClient->getConfig()->setHost('https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->apiClient = $apiClient;
|
$this->apiClient = $apiClient;
|
||||||
@ -105,28 +105,28 @@ class FakeApi
|
|||||||
/**
|
/**
|
||||||
* Operation testCodeInjectEndRnNR
|
* Operation testCodeInjectEndRnNR
|
||||||
*
|
*
|
||||||
* To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
*
|
*
|
||||||
* @param string $test_code_inject____end_rn_n_r To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional)
|
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||||
*/
|
*/
|
||||||
public function testCodeInjectEndRnNR($test_code_inject____end_rn_n_r = null)
|
public function testCodeInjectEndRnNR($test_code_inject____end____rn_n_r = null)
|
||||||
{
|
{
|
||||||
list($response) = $this->testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end_rn_n_r);
|
list($response) = $this->testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn_n_r);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation testCodeInjectEndRnNRWithHttpInfo
|
* Operation testCodeInjectEndRnNRWithHttpInfo
|
||||||
*
|
*
|
||||||
* To test code injection *_/ ' \" =end \\r\\n \\n \\r
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
*
|
*
|
||||||
* @param string $test_code_inject____end_rn_n_r To test code injection *_/ ' \" =end \\r\\n \\n \\r (optional)
|
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||||
*/
|
*/
|
||||||
public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end_rn_n_r = null)
|
public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn_n_r = null)
|
||||||
{
|
{
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/fake";
|
$resourcePath = "/fake";
|
||||||
@ -134,18 +134,18 @@ class FakeApi
|
|||||||
$queryParams = array();
|
$queryParams = array();
|
||||||
$headerParams = array();
|
$headerParams = array();
|
||||||
$formParams = array();
|
$formParams = array();
|
||||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', '*_/ \" =end'));
|
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', '*_/ \" =end --'));
|
||||||
if (!is_null($_header_accept)) {
|
if (!is_null($_header_accept)) {
|
||||||
$headerParams['Accept'] = $_header_accept;
|
$headerParams['Accept'] = $_header_accept;
|
||||||
}
|
}
|
||||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','*_/ \" =end'));
|
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','*_/ \" =end --'));
|
||||||
|
|
||||||
// default format to json
|
// default format to json
|
||||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||||
|
|
||||||
// form params
|
// form params
|
||||||
if ($test_code_inject____end_rn_n_r !== null) {
|
if ($test_code_inject____end____rn_n_r !== null) {
|
||||||
$formParams['test code inject */ ' " =end \r\n \n \r'] = $this->apiClient->getSerializer()->toFormValue($test_code_inject____end_rn_n_r);
|
$formParams['test code inject */ ' " =end -- \r\n \n \r'] = $this->apiClient->getSerializer()->toFormValue($test_code_inject____end____rn_n_r);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for model (json/xml)
|
// for model (json/xml)
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -102,7 +102,7 @@ class Configuration
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $host = 'https://petstore.swagger.io *_/ ' \" =end \\r\\n \\n \\r/v2 *_/ ' \" =end \\r\\n \\n \\r';
|
protected $host = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timeout (second) of the HTTP request, by default set to 0, no timeout
|
* Timeout (second) of the HTTP request, by default set to 0, no timeout
|
||||||
@ -522,7 +522,7 @@ class Configuration
|
|||||||
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
|
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
|
||||||
$report .= ' OS: ' . php_uname() . PHP_EOL;
|
$report .= ' OS: ' . php_uname() . PHP_EOL;
|
||||||
$report .= ' PHP Version: ' . phpversion() . PHP_EOL;
|
$report .= ' PHP Version: ' . phpversion() . PHP_EOL;
|
||||||
$report .= ' OpenAPI Spec Version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r' . PHP_EOL;
|
$report .= ' OpenAPI Spec Version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r' . PHP_EOL;
|
||||||
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
|
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
|
||||||
|
|
||||||
return $report;
|
return $report;
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -47,7 +47,7 @@ use \ArrayAccess;
|
|||||||
* ModelReturn Class Doc Comment
|
* ModelReturn Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class */
|
* @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 Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author http://github.com/swagger-api/swagger-codegen
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
@ -167,7 +167,7 @@ class ModelReturn implements ArrayAccess
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets return
|
* Sets return
|
||||||
* @param int $return property description *_/ ' \" =end \\r\\n \\n \\r
|
* @param int $return property description *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setReturn($return)
|
public function setReturn($return)
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
|
* Swagger 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
|
* 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
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
|
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -264,7 +264,7 @@ class ObjectSerializer
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
|
||||||
settype($data, $class);
|
settype($data, $class);
|
||||||
return $data;
|
return $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
|
@ -147,39 +147,39 @@ UpgradeLog*.htm
|
|||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
# svn
|
# svn
|
||||||
.svn
|
.svn
|
||||||
|
|
||||||
# SQL Server files
|
# SQL Server files
|
||||||
**/App_Data/*.mdf
|
**/App_Data/*.mdf
|
||||||
**/App_Data/*.ldf
|
**/App_Data/*.ldf
|
||||||
**/App_Data/*.sdf
|
**/App_Data/*.sdf
|
||||||
|
|
||||||
|
|
||||||
#LightSwitch generated files
|
#LightSwitch generated files
|
||||||
GeneratedArtifacts/
|
GeneratedArtifacts/
|
||||||
_Pvt_Extensions/
|
_Pvt_Extensions/
|
||||||
ModelManifest.xml
|
ModelManifest.xml
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# Windows detritus
|
# Windows detritus
|
||||||
# =========================
|
# =========================
|
||||||
|
|
||||||
# Windows image file caches
|
# Windows image file caches
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
|
|
||||||
# Folder config file
|
# Folder config file
|
||||||
Desktop.ini
|
Desktop.ini
|
||||||
|
|
||||||
# Recycle Bin used on file shares
|
# Recycle Bin used on file shares
|
||||||
$RECYCLE.BIN/
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
# Mac desktop service store files
|
# Mac desktop service store files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# SASS Compiler cache
|
# SASS Compiler cache
|
||||||
.sass-cache
|
.sass-cache
|
||||||
|
|
||||||
# Visual Studio 2014 CTP
|
# Visual Studio 2014 CTP
|
||||||
**/*.sln.ide
|
**/*.sln.ide
|
||||||
|
@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio 2012
|
# Visual Studio 2012
|
||||||
VisualStudioVersion = 12.0.0.0
|
VisualStudioVersion = 12.0.0.0
|
||||||
MinimumVisualStudioVersion = 10.0.0.1
|
MinimumVisualStudioVersion = 10.0.0.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C95ADC68-F3D8-41D1-BA8A-6C0754E6BB54}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{F616AC0A-13D9-4D7E-ACE1-93E41B628F88}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{C95ADC68-F3D8-41D1-BA8A-6C0754E6BB54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{F616AC0A-13D9-4D7E-ACE1-93E41B628F88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C95ADC68-F3D8-41D1-BA8A-6C0754E6BB54}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{F616AC0A-13D9-4D7E-ACE1-93E41B628F88}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C95ADC68-F3D8-41D1-BA8A-6C0754E6BB54}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{F616AC0A-13D9-4D7E-ACE1-93E41B628F88}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C95ADC68-F3D8-41D1-BA8A-6C0754E6BB54}.Release|Any CPU.Build.0 = Release|Any CPU
|
{F616AC0A-13D9-4D7E-ACE1-93E41B628F88}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- SDK version: 1.0.0
|
- SDK version: 1.0.0
|
||||||
- Build date: 2016-07-26T14:25:16.509+08:00
|
- Build date: 2016-07-31T22:04:18.446+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||||
|
|
||||||
## Frameworks supported
|
## Frameworks supported
|
||||||
|
@ -71,10 +71,10 @@ limitations under the License.
|
|||||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework">
|
<Reference Include="nunit.framework">
|
||||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -86,7 +86,7 @@ limitations under the License.
|
|||||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
|
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
|
||||||
<Project>{85AE8212-9819-4224-A9E5-B93419EC927B}</Project>
|
<Project>{1230F4B8-71F8-4A8C-966F-2E10106EA239}</Project>
|
||||||
<Name>IO.Swagger</Name>
|
<Name>IO.Swagger</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -24,7 +24,7 @@ limitations under the License.
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{C95ADC68-F3D8-41D1-BA8A-6C0754E6BB54}</ProjectGuid>
|
<ProjectGuid>{F616AC0A-13D9-4D7E-ACE1-93E41B628F88}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>IO.Swagger</RootNamespace>
|
<RootNamespace>IO.Swagger</RootNamespace>
|
||||||
|
@ -4,7 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
|
|||||||
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Build date: 2016-07-26T14:38:19.243+08:00
|
- Build date: 2016-07-29T14:59:28.041+02:00
|
||||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -136,12 +136,6 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation For Authorization
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
## api_key
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: api_key
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
## petstore_auth
|
## petstore_auth
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
@ -151,6 +145,12 @@ Class | Method | HTTP request | Description
|
|||||||
- **write:pets**: modify pets in your account
|
- **write:pets**: modify pets in your account
|
||||||
- **read:pets**: read your pets
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
|
@ -236,10 +236,10 @@ class FakeApi
|
|||||||
if ($number === null) {
|
if ($number === null) {
|
||||||
throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters');
|
throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters');
|
||||||
}
|
}
|
||||||
if ($number > 543.2) {
|
if (($number > 543.2)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.');
|
throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.');
|
||||||
}
|
}
|
||||||
if ($number < 32.1) {
|
if (($number < 32.1)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.');
|
throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,10 +247,10 @@ class FakeApi
|
|||||||
if ($double === null) {
|
if ($double === null) {
|
||||||
throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters');
|
throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters');
|
||||||
}
|
}
|
||||||
if ($double > 123.4) {
|
if (($double > 123.4)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.');
|
throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.');
|
||||||
}
|
}
|
||||||
if ($double < 67.8) {
|
if (($double < 67.8)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.');
|
throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,28 +266,28 @@ class FakeApi
|
|||||||
if ($byte === null) {
|
if ($byte === null) {
|
||||||
throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters');
|
throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters');
|
||||||
}
|
}
|
||||||
if ($integer > 100.0) {
|
if (!is_null($integer) && ($integer > 100.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.0.');
|
throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.0.');
|
||||||
}
|
}
|
||||||
if ($integer < 10.0) {
|
if (!is_null($integer) && ($integer < 10.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.0.');
|
throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.0.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($int32 > 200.0) {
|
if (!is_null($int32) && ($int32 > 200.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.0.');
|
throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.0.');
|
||||||
}
|
}
|
||||||
if ($int32 < 20.0) {
|
if (!is_null($int32) && ($int32 < 20.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.0.');
|
throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.0.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($float > 987.6) {
|
if (!is_null($float) && ($float > 987.6)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.');
|
throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($password) > 64) {
|
if (!is_null($password) && (strlen($password) > 64)) {
|
||||||
throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
|
throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
|
||||||
}
|
}
|
||||||
if (strlen($password) < 10) {
|
if (!is_null($password) && (strlen($password) < 10)) {
|
||||||
throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
|
throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ class StoreApi
|
|||||||
if ($order_id === null) {
|
if ($order_id === null) {
|
||||||
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
||||||
}
|
}
|
||||||
if ($order_id < 1.0) {
|
if (($order_id < 1.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
|
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,10 +293,10 @@ class StoreApi
|
|||||||
if ($order_id === null) {
|
if ($order_id === null) {
|
||||||
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling getOrderById');
|
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling getOrderById');
|
||||||
}
|
}
|
||||||
if ($order_id > 5.0) {
|
if (($order_id > 5.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.');
|
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.');
|
||||||
}
|
}
|
||||||
if ($order_id < 1.0) {
|
if (($order_id < 1.0)) {
|
||||||
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.');
|
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,40 +200,40 @@ class FormatTest implements ArrayAccess
|
|||||||
public function listInvalidProperties()
|
public function listInvalidProperties()
|
||||||
{
|
{
|
||||||
$invalid_properties = array();
|
$invalid_properties = array();
|
||||||
if ($this->container['integer'] > 100.0) {
|
if (!is_null(${{$this->container['integer']}}) && ($this->container['integer'] > 100.0)) {
|
||||||
$invalid_properties[] = "invalid value for 'integer', must be smaller than or equal to 100.0.";
|
$invalid_properties[] = "invalid value for 'integer', must be smaller than or equal to 100.0.";
|
||||||
}
|
}
|
||||||
if ($this->container['integer'] < 10.0) {
|
if (!is_null(${{$this->container['integer']}}) && ($this->container['integer'] < 10.0)) {
|
||||||
$invalid_properties[] = "invalid value for 'integer', must be bigger than or equal to 10.0.";
|
$invalid_properties[] = "invalid value for 'integer', must be bigger than or equal to 10.0.";
|
||||||
}
|
}
|
||||||
if ($this->container['int32'] > 200.0) {
|
if (!is_null(${{$this->container['int32']}}) && ($this->container['int32'] > 200.0)) {
|
||||||
$invalid_properties[] = "invalid value for 'int32', must be smaller than or equal to 200.0.";
|
$invalid_properties[] = "invalid value for 'int32', must be smaller than or equal to 200.0.";
|
||||||
}
|
}
|
||||||
if ($this->container['int32'] < 20.0) {
|
if (!is_null(${{$this->container['int32']}}) && ($this->container['int32'] < 20.0)) {
|
||||||
$invalid_properties[] = "invalid value for 'int32', must be bigger than or equal to 20.0.";
|
$invalid_properties[] = "invalid value for 'int32', must be bigger than or equal to 20.0.";
|
||||||
}
|
}
|
||||||
if ($this->container['number'] === null) {
|
if ($this->container['number'] === null) {
|
||||||
$invalid_properties[] = "'number' can't be null";
|
$invalid_properties[] = "'number' can't be null";
|
||||||
}
|
}
|
||||||
if ($this->container['number'] > 543.2) {
|
if (($this->container['number'] > 543.2)) {
|
||||||
$invalid_properties[] = "invalid value for 'number', must be smaller than or equal to 543.2.";
|
$invalid_properties[] = "invalid value for 'number', must be smaller than or equal to 543.2.";
|
||||||
}
|
}
|
||||||
if ($this->container['number'] < 32.1) {
|
if (($this->container['number'] < 32.1)) {
|
||||||
$invalid_properties[] = "invalid value for 'number', must be bigger than or equal to 32.1.";
|
$invalid_properties[] = "invalid value for 'number', must be bigger than or equal to 32.1.";
|
||||||
}
|
}
|
||||||
if ($this->container['float'] > 987.6) {
|
if (!is_null(${{$this->container['float']}}) && ($this->container['float'] > 987.6)) {
|
||||||
$invalid_properties[] = "invalid value for 'float', must be smaller than or equal to 987.6.";
|
$invalid_properties[] = "invalid value for 'float', must be smaller than or equal to 987.6.";
|
||||||
}
|
}
|
||||||
if ($this->container['float'] < 54.3) {
|
if (!is_null(${{$this->container['float']}}) && ($this->container['float'] < 54.3)) {
|
||||||
$invalid_properties[] = "invalid value for 'float', must be bigger than or equal to 54.3.";
|
$invalid_properties[] = "invalid value for 'float', must be bigger than or equal to 54.3.";
|
||||||
}
|
}
|
||||||
if ($this->container['double'] > 123.4) {
|
if (!is_null(${{$this->container['double']}}) && ($this->container['double'] > 123.4)) {
|
||||||
$invalid_properties[] = "invalid value for 'double', must be smaller than or equal to 123.4.";
|
$invalid_properties[] = "invalid value for 'double', must be smaller than or equal to 123.4.";
|
||||||
}
|
}
|
||||||
if ($this->container['double'] < 67.8) {
|
if (!is_null(${{$this->container['double']}}) && ($this->container['double'] < 67.8)) {
|
||||||
$invalid_properties[] = "invalid value for 'double', must be bigger than or equal to 67.8.";
|
$invalid_properties[] = "invalid value for 'double', must be bigger than or equal to 67.8.";
|
||||||
}
|
}
|
||||||
if (!preg_match("/[a-z]/i", $this->container['string'])) {
|
if (!is_null(${{$this->container['string']}}) && !preg_match("/[a-z]/i", $this->container['string'])) {
|
||||||
$invalid_properties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i.";
|
$invalid_properties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i.";
|
||||||
}
|
}
|
||||||
if ($this->container['byte'] === null) {
|
if ($this->container['byte'] === null) {
|
||||||
@ -245,10 +245,10 @@ class FormatTest implements ArrayAccess
|
|||||||
if ($this->container['password'] === null) {
|
if ($this->container['password'] === null) {
|
||||||
$invalid_properties[] = "'password' can't be null";
|
$invalid_properties[] = "'password' can't be null";
|
||||||
}
|
}
|
||||||
if (strlen($this->container['password']) > 64) {
|
if ((strlen($this->container['password']) > 64)) {
|
||||||
$invalid_properties[] = "invalid value for 'password', the character length must be smaller than or equal to 64.";
|
$invalid_properties[] = "invalid value for 'password', the character length must be smaller than or equal to 64.";
|
||||||
}
|
}
|
||||||
if (strlen($this->container['password']) < 10) {
|
if ((strlen($this->container['password']) < 10)) {
|
||||||
$invalid_properties[] = "invalid value for 'password', the character length must be bigger than or equal to 10.";
|
$invalid_properties[] = "invalid value for 'password', the character length must be bigger than or equal to 10.";
|
||||||
}
|
}
|
||||||
return $invalid_properties;
|
return $invalid_properties;
|
||||||
|
@ -264,7 +264,7 @@ class ObjectSerializer
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
|
||||||
settype($data, $class);
|
settype($data, $class);
|
||||||
return $data;
|
return $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
|
@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-07-26T14:38:12.507+08:00
|
- Build date: 2016-08-01T16:37:23.828+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -157,31 +157,31 @@ module Petstore
|
|||||||
|
|
||||||
# verify the required parameter 'byte' is set
|
# verify the required parameter 'byte' is set
|
||||||
fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" if byte.nil?
|
fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" if byte.nil?
|
||||||
if opts[:'integer'] > 100.0
|
if !opts[:'integer'].nil? && opts[:'integer'] > 100.0
|
||||||
fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.0.'
|
fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.0.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts[:'integer'] < 10.0
|
if !opts[:'integer'].nil? && opts[:'integer'] < 10.0
|
||||||
fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.0.'
|
fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.0.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts[:'int32'] > 200.0
|
if !opts[:'int32'].nil? && opts[:'int32'] > 200.0
|
||||||
fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.0.'
|
fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.0.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts[:'int32'] < 20.0
|
if !opts[:'int32'].nil? && opts[:'int32'] < 20.0
|
||||||
fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.0.'
|
fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.0.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts[:'float'] > 987.6
|
if !opts[:'float'].nil? && opts[:'float'] > 987.6
|
||||||
fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.'
|
fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts[:'password'].to_s.length > 64
|
if !opts[:'password'].nil? && opts[:'password'].to_s.length > 64
|
||||||
fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.'
|
fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts[:'password'].to_s.length < 10
|
if !opts[:'password'].nil? && opts[:'password'].to_s.length < 10
|
||||||
fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.'
|
fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -157,24 +157,89 @@ module Petstore
|
|||||||
# @return Array for valid properies with the reasons
|
# @return Array for valid properies with the reasons
|
||||||
def list_invalid_properties
|
def list_invalid_properties
|
||||||
invalid_properties = Array.new
|
invalid_properties = Array.new
|
||||||
|
|
||||||
|
if !@integer.nil? && @integer > 100.0
|
||||||
|
invalid_properties.push("invalid value for 'integer', must be smaller than or equal to 100.0.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@integer.nil? && @integer < 10.0
|
||||||
|
invalid_properties.push("invalid value for 'integer', must be greater than or equal to 10.0.")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if !@int32.nil? && @int32 > 200.0
|
||||||
|
invalid_properties.push("invalid value for 'int32', must be smaller than or equal to 200.0.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@int32.nil? && @int32 < 20.0
|
||||||
|
invalid_properties.push("invalid value for 'int32', must be greater than or equal to 20.0.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @number.nil?
|
||||||
|
invalid_properties.push("invalid value for 'number', number cannot be nil.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @number > 543.2
|
||||||
|
invalid_properties.push("invalid value for 'number', must be smaller than or equal to 543.2.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @number < 32.1
|
||||||
|
invalid_properties.push("invalid value for 'number', must be greater than or equal to 32.1.")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if !@float.nil? && @float > 987.6
|
||||||
|
invalid_properties.push("invalid value for 'float', must be smaller than or equal to 987.6.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@float.nil? && @float < 54.3
|
||||||
|
invalid_properties.push("invalid value for 'float', must be greater than or equal to 54.3.")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if !@double.nil? && @double > 123.4
|
||||||
|
invalid_properties.push("invalid value for 'double', must be smaller than or equal to 123.4.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@double.nil? && @double < 67.8
|
||||||
|
invalid_properties.push("invalid value for 'double', must be greater than or equal to 67.8.")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if !@string.nil? && @string !~ Regexp.new(/[a-z]/i)
|
||||||
|
invalid_properties.push("invalid value for 'string', must conform to the pattern /[a-z]/i.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @password.nil?
|
||||||
|
invalid_properties.push("invalid value for 'password', password cannot be nil.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @password.to_s.length > 64
|
||||||
|
invalid_properties.push("invalid value for 'password', the character length must be smaller than or equal to 64.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if @password.to_s.length < 10
|
||||||
|
invalid_properties.push("invalid value for 'password', the character length must be great than or equal to 10.")
|
||||||
|
end
|
||||||
|
|
||||||
return invalid_properties
|
return invalid_properties
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check to see if the all the properties in the model are valid
|
# Check to see if the all the properties in the model are valid
|
||||||
# @return true if the model is valid
|
# @return true if the model is valid
|
||||||
def valid?
|
def valid?
|
||||||
return false if @integer > 100.0
|
return false if !@integer.nil? && @integer > 100.0
|
||||||
return false if @integer < 10.0
|
return false if !@integer.nil? && @integer < 10.0
|
||||||
return false if @int32 > 200.0
|
return false if !@int32.nil? && @int32 > 200.0
|
||||||
return false if @int32 < 20.0
|
return false if !@int32.nil? && @int32 < 20.0
|
||||||
return false if @number.nil?
|
return false if @number.nil?
|
||||||
return false if @number > 543.2
|
return false if @number > 543.2
|
||||||
return false if @number < 32.1
|
return false if @number < 32.1
|
||||||
return false if @float > 987.6
|
return false if !@float.nil? && @float > 987.6
|
||||||
return false if @float < 54.3
|
return false if !@float.nil? && @float < 54.3
|
||||||
return false if @double > 123.4
|
return false if !@double.nil? && @double > 123.4
|
||||||
return false if @double < 67.8
|
return false if !@double.nil? && @double < 67.8
|
||||||
return false if @string !~ Regexp.new(/[a-z]/i)
|
return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i)
|
||||||
return false if @byte.nil?
|
return false if @byte.nil?
|
||||||
return false if @date.nil?
|
return false if @date.nil?
|
||||||
return false if @password.nil?
|
return false if @password.nil?
|
||||||
@ -186,15 +251,12 @@ module Petstore
|
|||||||
# Custom attribute writer method with validation
|
# Custom attribute writer method with validation
|
||||||
# @param [Object] integer Value to be assigned
|
# @param [Object] integer Value to be assigned
|
||||||
def integer=(integer)
|
def integer=(integer)
|
||||||
if integer.nil?
|
|
||||||
fail ArgumentError, "integer cannot be nil"
|
|
||||||
end
|
|
||||||
|
|
||||||
if integer > 100.0
|
if !integer.nil? && integer > 100.0
|
||||||
fail ArgumentError, "invalid value for 'integer', must be smaller than or equal to 100.0."
|
fail ArgumentError, "invalid value for 'integer', must be smaller than or equal to 100.0."
|
||||||
end
|
end
|
||||||
|
|
||||||
if integer < 10.0
|
if !integer.nil? && integer < 10.0
|
||||||
fail ArgumentError, "invalid value for 'integer', must be greater than or equal to 10.0."
|
fail ArgumentError, "invalid value for 'integer', must be greater than or equal to 10.0."
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -204,15 +266,12 @@ module Petstore
|
|||||||
# Custom attribute writer method with validation
|
# Custom attribute writer method with validation
|
||||||
# @param [Object] int32 Value to be assigned
|
# @param [Object] int32 Value to be assigned
|
||||||
def int32=(int32)
|
def int32=(int32)
|
||||||
if int32.nil?
|
|
||||||
fail ArgumentError, "int32 cannot be nil"
|
|
||||||
end
|
|
||||||
|
|
||||||
if int32 > 200.0
|
if !int32.nil? && int32 > 200.0
|
||||||
fail ArgumentError, "invalid value for 'int32', must be smaller than or equal to 200.0."
|
fail ArgumentError, "invalid value for 'int32', must be smaller than or equal to 200.0."
|
||||||
end
|
end
|
||||||
|
|
||||||
if int32 < 20.0
|
if !int32.nil? && int32 < 20.0
|
||||||
fail ArgumentError, "invalid value for 'int32', must be greater than or equal to 20.0."
|
fail ArgumentError, "invalid value for 'int32', must be greater than or equal to 20.0."
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -240,15 +299,12 @@ module Petstore
|
|||||||
# Custom attribute writer method with validation
|
# Custom attribute writer method with validation
|
||||||
# @param [Object] float Value to be assigned
|
# @param [Object] float Value to be assigned
|
||||||
def float=(float)
|
def float=(float)
|
||||||
if float.nil?
|
|
||||||
fail ArgumentError, "float cannot be nil"
|
|
||||||
end
|
|
||||||
|
|
||||||
if float > 987.6
|
if !float.nil? && float > 987.6
|
||||||
fail ArgumentError, "invalid value for 'float', must be smaller than or equal to 987.6."
|
fail ArgumentError, "invalid value for 'float', must be smaller than or equal to 987.6."
|
||||||
end
|
end
|
||||||
|
|
||||||
if float < 54.3
|
if !float.nil? && float < 54.3
|
||||||
fail ArgumentError, "invalid value for 'float', must be greater than or equal to 54.3."
|
fail ArgumentError, "invalid value for 'float', must be greater than or equal to 54.3."
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -258,15 +314,12 @@ module Petstore
|
|||||||
# Custom attribute writer method with validation
|
# Custom attribute writer method with validation
|
||||||
# @param [Object] double Value to be assigned
|
# @param [Object] double Value to be assigned
|
||||||
def double=(double)
|
def double=(double)
|
||||||
if double.nil?
|
|
||||||
fail ArgumentError, "double cannot be nil"
|
|
||||||
end
|
|
||||||
|
|
||||||
if double > 123.4
|
if !double.nil? && double > 123.4
|
||||||
fail ArgumentError, "invalid value for 'double', must be smaller than or equal to 123.4."
|
fail ArgumentError, "invalid value for 'double', must be smaller than or equal to 123.4."
|
||||||
end
|
end
|
||||||
|
|
||||||
if double < 67.8
|
if !double.nil? && double < 67.8
|
||||||
fail ArgumentError, "invalid value for 'double', must be greater than or equal to 67.8."
|
fail ArgumentError, "invalid value for 'double', must be greater than or equal to 67.8."
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -276,11 +329,8 @@ module Petstore
|
|||||||
# Custom attribute writer method with validation
|
# Custom attribute writer method with validation
|
||||||
# @param [Object] string Value to be assigned
|
# @param [Object] string Value to be assigned
|
||||||
def string=(string)
|
def string=(string)
|
||||||
if string.nil?
|
|
||||||
fail ArgumentError, "string cannot be nil"
|
|
||||||
end
|
|
||||||
|
|
||||||
if @string !~ Regexp.new(/[a-z]/i)
|
if !string.nil? && string !~ Regexp.new(/[a-z]/i)
|
||||||
fail ArgumentError, "invalid value for 'string', must conform to the pattern /[a-z]/i."
|
fail ArgumentError, "invalid value for 'string', must conform to the pattern /[a-z]/i."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
#foo/**/qux
|
#foo/**/qux
|
||||||
# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
# You can also negate patterns with an exclamation (!).
|
# You can also negate patterns with an exclamation (!).
|
||||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
@ -140,7 +140,7 @@ class FakeApi extends Controller
|
|||||||
|
|
||||||
$date = $input['date'];
|
$date = $input['date'];
|
||||||
|
|
||||||
$dateTime = $input['dateTime'];
|
$date_time = $input['date_time'];
|
||||||
|
|
||||||
if (strlen($input['password']) > 64) {
|
if (strlen($input['password']) > 64) {
|
||||||
throw new \InvalidArgumentException('invalid length for $password when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
|
throw new \InvalidArgumentException('invalid length for $password when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
|
||||||
@ -169,11 +169,11 @@ class FakeApi extends Controller
|
|||||||
|
|
||||||
|
|
||||||
//not path params validation
|
//not path params validation
|
||||||
$enumQueryString = $input['enumQueryString'];
|
$enum_query_string = $input['enum_query_string'];
|
||||||
|
|
||||||
$enumQueryInteger = $input['enumQueryInteger'];
|
$enum_query_integer = $input['enum_query_integer'];
|
||||||
|
|
||||||
$enumQueryDouble = $input['enumQueryDouble'];
|
$enum_query_double = $input['enum_query_double'];
|
||||||
|
|
||||||
|
|
||||||
return response('How about implementing testEnumQueryParameters as a GET method ?');
|
return response('How about implementing testEnumQueryParameters as a GET method ?');
|
@ -139,11 +139,11 @@ class PetApi extends Controller
|
|||||||
*
|
*
|
||||||
* Deletes a pet.
|
* Deletes a pet.
|
||||||
*
|
*
|
||||||
* @param Long $petId Pet id to delete (required)
|
* @param int $pet_id Pet id to delete (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function deletePet($petId)
|
public function deletePet($pet_id)
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
||||||
@ -159,11 +159,11 @@ class PetApi extends Controller
|
|||||||
*
|
*
|
||||||
* Find pet by ID.
|
* Find pet by ID.
|
||||||
*
|
*
|
||||||
* @param Long $petId ID of pet to return (required)
|
* @param int $pet_id ID of pet to return (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function getPetById($petId)
|
public function getPetById($pet_id)
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
||||||
@ -179,11 +179,11 @@ class PetApi extends Controller
|
|||||||
*
|
*
|
||||||
* Updates a pet in the store with form data.
|
* Updates a pet in the store with form data.
|
||||||
*
|
*
|
||||||
* @param Long $petId ID of pet that needs to be updated (required)
|
* @param int $pet_id ID of pet that needs to be updated (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function updatePetWithForm($petId)
|
public function updatePetWithForm($pet_id)
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
||||||
@ -199,11 +199,11 @@ class PetApi extends Controller
|
|||||||
*
|
*
|
||||||
* uploads an image.
|
* uploads an image.
|
||||||
*
|
*
|
||||||
* @param Long $petId ID of pet to update (required)
|
* @param int $pet_id ID of pet to update (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function uploadFile($petId)
|
public function uploadFile($pet_id)
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
@ -86,17 +86,17 @@ class StoreApi extends Controller
|
|||||||
*
|
*
|
||||||
* Delete purchase order by ID.
|
* Delete purchase order by ID.
|
||||||
*
|
*
|
||||||
* @param String $orderId ID of the order that needs to be deleted (required)
|
* @param string $order_id ID of the order that needs to be deleted (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function deleteOrder($orderId)
|
public function deleteOrder($order_id)
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
||||||
//path params validation
|
//path params validation
|
||||||
if ($orderId] < 1.0) {
|
if ($order_id] < 1.0) {
|
||||||
throw new \InvalidArgumentException('invalid value for $orderId when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
|
throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -109,20 +109,20 @@ class StoreApi extends Controller
|
|||||||
*
|
*
|
||||||
* Find purchase order by ID.
|
* Find purchase order by ID.
|
||||||
*
|
*
|
||||||
* @param Long $orderId ID of pet that needs to be fetched (required)
|
* @param int $order_id ID of pet that needs to be fetched (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function getOrderById($orderId)
|
public function getOrderById($order_id)
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
||||||
//path params validation
|
//path params validation
|
||||||
if ($orderId] > 5.0) {
|
if ($order_id] > 5.0) {
|
||||||
throw new \InvalidArgumentException('invalid value for $orderId when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.');
|
throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.');
|
||||||
}
|
}
|
||||||
if ($orderId] < 1.0) {
|
if ($order_id] < 1.0) {
|
||||||
throw new \InvalidArgumentException('invalid value for $orderId when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.');
|
throw new \InvalidArgumentException('invalid value for $order_id when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -163,7 +163,7 @@ class UserApi extends Controller
|
|||||||
*
|
*
|
||||||
* Delete user.
|
* Delete user.
|
||||||
*
|
*
|
||||||
* @param String $username The name that needs to be deleted (required)
|
* @param string $username The name that needs to be deleted (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
@ -183,7 +183,7 @@ class UserApi extends Controller
|
|||||||
*
|
*
|
||||||
* Get user by user name.
|
* Get user by user name.
|
||||||
*
|
*
|
||||||
* @param String $username The name that needs to be fetched. Use user1 for testing. (required)
|
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
@ -203,7 +203,7 @@ class UserApi extends Controller
|
|||||||
*
|
*
|
||||||
* Updated user.
|
* Updated user.
|
||||||
*
|
*
|
||||||
* @param String $username name that need to be deleted (required)
|
* @param string $username name that need to be deleted (required)
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
@ -3,11 +3,13 @@ language: java
|
|||||||
jdk:
|
jdk:
|
||||||
- openjdk7
|
- openjdk7
|
||||||
- openjdk8
|
- openjdk8
|
||||||
- oraclejdk7
|
|
||||||
- oraclejdk8
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
cache: true
|
||||||
|
cache_dir_list:
|
||||||
|
- $HOME/.m2
|
||||||
ci:
|
ci:
|
||||||
- ./bin/run-all-petstore > run-all-petstore.log 2>&1
|
# generate all petstore sampless (client, servers, doc)
|
||||||
|
- ./bin/run-all-petstore 2>&1 > run-all-petstore.log
|
||||||
post_ci:
|
post_ci:
|
||||||
- tail run-all-petstore.log
|
- tail run-all-petstore.log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user