forked from loafle/openapi-generator-original
[Slim] Refactoring (#402)
* [Slim] Cleanup samples. composer.lock excluded from .gitignore composer.lcok should be commited to SVN. Official recommendation https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control * [Slim] Refactor. Extend AbstractPhpCodegen class * [Slim] Adjust the names (script, sample folder, generator) to lang option
This commit is contained in:
parent
e172379f04
commit
412923ab5f
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-slim -o samples/server/petstore/slim $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-slim -o samples/server/petstore/php-slim $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples/server/petstore/php-slim $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples/server/petstore/php-slim $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-slim -o samples/server/petstore-security-test/slim $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-slim -o samples/server/petstore-security-test/php-slim $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
0
bin/windows/php-slim-petstore-server.bat → bin/windows/php-slim-server-petstore.bat
Normal file → Executable file
0
bin/windows/php-slim-petstore-server.bat → bin/windows/php-slim-server-petstore.bat
Normal file → Executable file
@ -452,7 +452,13 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
|||||||
|
|
||||||
// add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime)
|
// add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime)
|
||||||
if (!name.matches("^\\\\.*")) {
|
if (!name.matches("^\\\\.*")) {
|
||||||
name = modelNamePrefix + name + modelNameSuffix;
|
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||||
|
name = modelNamePrefix + "_" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
||||||
|
name = name + "_" + modelNameSuffix;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// camelize the model name
|
// camelize the model name
|
||||||
|
@ -17,41 +17,28 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.openapitools.codegen.CodegenOperation;
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CliOption;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
import org.openapitools.codegen.DefaultCodegen;
|
|
||||||
import org.openapitools.codegen.SupportingFile;
|
import org.openapitools.codegen.SupportingFile;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.*;
|
import io.swagger.v3.oas.models.media.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfig {
|
public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(PhpSlimServerCodegen.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(PhpSlimServerCodegen.class);
|
||||||
|
|
||||||
protected String invokerPackage;
|
|
||||||
protected String srcBasePath = "lib";
|
|
||||||
protected String groupId = "org.openapitools";
|
protected String groupId = "org.openapitools";
|
||||||
protected String artifactId = "openapi-server";
|
protected String artifactId = "openapi-server";
|
||||||
protected String artifactVersion = "1.0.0";
|
|
||||||
protected String packagePath = ""; // empty packagePath (top folder)
|
|
||||||
|
|
||||||
|
|
||||||
private String variableNamingConvention = "camelCase";
|
|
||||||
|
|
||||||
public PhpSlimServerCodegen() {
|
public PhpSlimServerCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -60,62 +47,37 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
// at the moment
|
// at the moment
|
||||||
importMapping.clear();
|
importMapping.clear();
|
||||||
|
|
||||||
|
variableNamingConvention = "camelCase";
|
||||||
|
artifactVersion = "1.0.0";
|
||||||
|
packagePath = ""; // empty packagePath (top folder)
|
||||||
invokerPackage = camelize("OpenAPIServer");
|
invokerPackage = camelize("OpenAPIServer");
|
||||||
modelPackage = packagePath + "\\Models";
|
modelPackage = packagePath + "\\Models";
|
||||||
apiPackage = packagePath;
|
apiPackage = packagePath;
|
||||||
outputFolder = "generated-code" + File.separator + "slim";
|
outputFolder = "generated-code" + File.separator + "slim";
|
||||||
modelTemplateFiles.put("model.mustache", ".php");
|
|
||||||
|
|
||||||
// no api files
|
// no api files
|
||||||
apiTemplateFiles.clear();
|
apiTemplateFiles.clear();
|
||||||
|
// no test files
|
||||||
|
apiTestTemplateFiles.clear();
|
||||||
|
// no doc files
|
||||||
|
modelDocTemplateFiles.clear();
|
||||||
|
apiDocTemplateFiles.clear();
|
||||||
|
|
||||||
embeddedTemplateDir = templateDir = "slim";
|
embeddedTemplateDir = templateDir = "php-slim-server";
|
||||||
|
|
||||||
setReservedWordsLowerCase(
|
// additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||||
Arrays.asList(
|
|
||||||
"__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")
|
|
||||||
);
|
|
||||||
|
|
||||||
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
|
||||||
additionalProperties.put(CodegenConstants.GROUP_ID, groupId);
|
additionalProperties.put(CodegenConstants.GROUP_ID, groupId);
|
||||||
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
|
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
|
||||||
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
|
// additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
|
||||||
|
|
||||||
// ref: http://php.net/manual/en/language.types.intro.php
|
// override cliOptions from AbstractPhpCodegen
|
||||||
languageSpecificPrimitives = new HashSet<String>(
|
for (CliOption co : cliOptions) {
|
||||||
Arrays.asList(
|
if (co.getOpt().equals(AbstractPhpCodegen.VARIABLE_NAMING_CONVENTION)) {
|
||||||
"boolean",
|
co.setDescription("naming convention of variable name, e.g. camelCase.");
|
||||||
"int",
|
co.setDefault("camelCase");
|
||||||
"integer",
|
break;
|
||||||
"double",
|
}
|
||||||
"float",
|
}
|
||||||
"string",
|
|
||||||
"object",
|
|
||||||
"DateTime",
|
|
||||||
"mixed",
|
|
||||||
"number")
|
|
||||||
);
|
|
||||||
|
|
||||||
instantiationTypes.put("array", "array");
|
|
||||||
instantiationTypes.put("map", "map");
|
|
||||||
|
|
||||||
// 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("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", "\\SplFileObject");
|
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", packagePath.replace('/', File.separatorChar), "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", packagePath.replace('/', File.separatorChar), "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("composer.json", packagePath.replace('/', File.separatorChar), "composer.json"));
|
supportingFiles.add(new SupportingFile("composer.json", packagePath.replace('/', File.separatorChar), "composer.json"));
|
||||||
@ -139,212 +101,6 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
return "Generates a PHP Slim Framework server library.";
|
return "Generates a PHP Slim Framework server library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeReservedWord(String name) {
|
|
||||||
if (this.reservedWordsMappings().containsKey(name)) {
|
|
||||||
return this.reservedWordsMappings().get(name);
|
|
||||||
}
|
|
||||||
return "_" + name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String apiFileFolder() {
|
|
||||||
return (outputFolder + File.separator + toPackagePath(apiPackage, srcBasePath));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String modelFileFolder() {
|
|
||||||
return (outputFolder + File.separator + toPackagePath(modelPackage, srcBasePath));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTypeDeclaration(Schema p) {
|
|
||||||
if (ModelUtils.isArraySchema(p)) {
|
|
||||||
ArraySchema ap = (ArraySchema) p;
|
|
||||||
Schema inner = ap.getItems();
|
|
||||||
return getTypeDeclaration(inner) + "[]";
|
|
||||||
} else if (ModelUtils.isMapSchema(p)) {
|
|
||||||
Schema inner = (Schema) p.getAdditionalProperties();
|
|
||||||
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
|
|
||||||
} else if (!StringUtils.isEmpty(p.get$ref())) {
|
|
||||||
String type = super.getTypeDeclaration(p);
|
|
||||||
return (!languageSpecificPrimitives.contains(type))
|
|
||||||
? "\\" + modelPackage + "\\" + type : type;
|
|
||||||
}
|
|
||||||
return super.getTypeDeclaration(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSchemaType(Schema p) {
|
|
||||||
String openAPIType = super.getSchemaType(p);
|
|
||||||
String type = null;
|
|
||||||
if (typeMapping.containsKey(openAPIType)) {
|
|
||||||
type = typeMapping.get(openAPIType);
|
|
||||||
if (languageSpecificPrimitives.contains(type)) {
|
|
||||||
return type;
|
|
||||||
} else if (instantiationTypes.containsKey(type)) {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
type = openAPIType;
|
|
||||||
}
|
|
||||||
if (type == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return toModelName(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTypeDeclaration(String name) {
|
|
||||||
if (!languageSpecificPrimitives.contains(name)) {
|
|
||||||
return "\\" + modelPackage + "\\" + name;
|
|
||||||
}
|
|
||||||
return super.getTypeDeclaration(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toDefaultValue(Schema p) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParameterNamingConvention(String variableNamingConvention) {
|
|
||||||
this.variableNamingConvention = variableNamingConvention;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toVarName(String 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("^\\\\.*")) {
|
|
||||||
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
|
||||||
name = modelNamePrefix + "_" + name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
|
||||||
name = 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 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
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 + "$", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPackagePath() {
|
|
||||||
return packagePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// remove ' to avoid code injection
|
|
||||||
return input.replace("'", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeUnsafeCharacters(String input) {
|
|
||||||
return input.replace("*/", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
|
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
|
||||||
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
||||||
|
@ -3,4 +3,4 @@ composer.phar
|
|||||||
|
|
||||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||||
composer.lock
|
# composer.lock
|
@ -18,12 +18,22 @@
|
|||||||
package org.openapitools.codegen.options;
|
package org.openapitools.codegen.options;
|
||||||
|
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
|
import org.openapitools.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 PhpSlimServerOptionsProvider implements OptionsProvider {
|
public class PhpSlimServerOptionsProvider implements OptionsProvider {
|
||||||
|
public static final String MODEL_PACKAGE_VALUE = "package";
|
||||||
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
|
public static final String VARIABLE_NAMING_CONVENTION_VALUE = "camelCase";
|
||||||
|
public static final String INVOKER_PACKAGE_VALUE = "OpenAPIServer";
|
||||||
|
public static final String PACKAGE_PATH_VALUE = "";
|
||||||
|
public static final String SRC_BASE_PATH_VALUE = "src";
|
||||||
|
public static final String GIT_USER_ID_VALUE = "gitOpenAPIToolsPhp";
|
||||||
|
public static final String GIT_REPO_ID_VALUE = "git-openapi-tools-php";
|
||||||
|
public static final String ARTIFACT_VERSION_VALUE = "1.0.0";
|
||||||
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 ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||||
@ -37,7 +47,16 @@ public class PhpSlimServerOptionsProvider 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.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)
|
||||||
|
.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.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||||
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
|
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
|
||||||
|
@ -43,6 +43,24 @@ public class PhpSlimServerOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
|
clientCodegen.setModelPackage(PhpSlimServerOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setApiPackage(PhpSlimServerOptionsProvider.API_PACKAGE_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setParameterNamingConvention(PhpSlimServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setInvokerPackage(PhpSlimServerOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setPackagePath(PhpSlimServerOptionsProvider.PACKAGE_PATH_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setSrcBasePath(PhpSlimServerOptionsProvider.SRC_BASE_PATH_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setGitUserId(PhpSlimServerOptionsProvider.GIT_USER_ID_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setGitRepoId(PhpSlimServerOptionsProvider.GIT_REPO_ID_VALUE);
|
||||||
|
times = 1;
|
||||||
|
clientCodegen.setArtifactVersion(PhpSlimServerOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
|
@ -3,4 +3,4 @@ composer.phar
|
|||||||
|
|
||||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||||
composer.lock
|
# composer.lock
|
@ -0,0 +1 @@
|
|||||||
|
3.1.0-SNAPSHOT
|
@ -1 +0,0 @@
|
|||||||
3.0.3-SNAPSHOT
|
|
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
315
samples/server/petstore-security-test/slim/composer.lock
generated
315
samples/server/petstore-security-test/slim/composer.lock
generated
@ -1,315 +0,0 @@
|
|||||||
{
|
|
||||||
"_readme": [
|
|
||||||
"This file locks the dependencies of your project to a known state",
|
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
|
||||||
"This file is @generated automatically"
|
|
||||||
],
|
|
||||||
"content-hash": "913417690829da41975a473b88f30f64",
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "container-interop/container-interop",
|
|
||||||
"version": "1.2.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/container-interop/container-interop.git",
|
|
||||||
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
|
||||||
"reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"psr/container": "^1.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Interop\\Container\\": "src/Interop/Container/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
|
||||||
"homepage": "https://github.com/container-interop/container-interop",
|
|
||||||
"time": "2017-02-14T19:40:03+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nikic/fast-route",
|
|
||||||
"version": "v1.3.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/nikic/FastRoute.git",
|
|
||||||
"reference": "181d480e08d9476e61381e04a71b34dc0432e812"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812",
|
|
||||||
"reference": "181d480e08d9476e61381e04a71b34dc0432e812",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.4.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^4.8.35|~5.7"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"FastRoute\\": "src/"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/functions.php"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Nikita Popov",
|
|
||||||
"email": "nikic@php.net"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Fast request router for PHP",
|
|
||||||
"keywords": [
|
|
||||||
"router",
|
|
||||||
"routing"
|
|
||||||
],
|
|
||||||
"time": "2018-02-13T20:26:39+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pimple/pimple",
|
|
||||||
"version": "v3.2.3",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/silexphp/Pimple.git",
|
|
||||||
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
|
|
||||||
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0",
|
|
||||||
"psr/container": "^1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"symfony/phpunit-bridge": "^3.2"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "3.2.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"Pimple": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "fabien@symfony.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Pimple, a simple Dependency Injection Container",
|
|
||||||
"homepage": "http://pimple.sensiolabs.org",
|
|
||||||
"keywords": [
|
|
||||||
"container",
|
|
||||||
"dependency injection"
|
|
||||||
],
|
|
||||||
"time": "2018-01-21T07:42:36+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "psr/container",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/container.git",
|
|
||||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
|
||||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Container\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common Container Interface (PHP FIG PSR-11)",
|
|
||||||
"homepage": "https://github.com/php-fig/container",
|
|
||||||
"keywords": [
|
|
||||||
"PSR-11",
|
|
||||||
"container",
|
|
||||||
"container-interface",
|
|
||||||
"container-interop",
|
|
||||||
"psr"
|
|
||||||
],
|
|
||||||
"time": "2017-02-14T16:28:37+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "psr/http-message",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Http\\Message\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common interface for HTTP messages",
|
|
||||||
"homepage": "https://github.com/php-fig/http-message",
|
|
||||||
"keywords": [
|
|
||||||
"http",
|
|
||||||
"http-message",
|
|
||||||
"psr",
|
|
||||||
"psr-7",
|
|
||||||
"request",
|
|
||||||
"response"
|
|
||||||
],
|
|
||||||
"time": "2016-08-06T14:39:51+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "slim/slim",
|
|
||||||
"version": "3.10.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/slimphp/Slim.git",
|
|
||||||
"reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/d8aabeacc3688b25e2f2dd2db91df91ec6fdd748",
|
|
||||||
"reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"container-interop/container-interop": "^1.2",
|
|
||||||
"nikic/fast-route": "^1.0",
|
|
||||||
"php": ">=5.5.0",
|
|
||||||
"pimple/pimple": "^3.0",
|
|
||||||
"psr/container": "^1.0",
|
|
||||||
"psr/http-message": "^1.0"
|
|
||||||
},
|
|
||||||
"provide": {
|
|
||||||
"psr/http-message-implementation": "1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^4.0",
|
|
||||||
"squizlabs/php_codesniffer": "^2.5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Slim\\": "Slim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Rob Allen",
|
|
||||||
"email": "rob@akrabat.com",
|
|
||||||
"homepage": "http://akrabat.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Josh Lockhart",
|
|
||||||
"email": "hello@joshlockhart.com",
|
|
||||||
"homepage": "https://joshlockhart.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gabriel Manricks",
|
|
||||||
"email": "gmanricks@me.com",
|
|
||||||
"homepage": "http://gabrielmanricks.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Andrew Smith",
|
|
||||||
"email": "a.smith@silentworks.co.uk",
|
|
||||||
"homepage": "http://silentworks.co.uk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs",
|
|
||||||
"homepage": "https://slimframework.com",
|
|
||||||
"keywords": [
|
|
||||||
"api",
|
|
||||||
"framework",
|
|
||||||
"micro",
|
|
||||||
"router"
|
|
||||||
],
|
|
||||||
"time": "2018-04-19T19:29:08+00:00"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"packages-dev": [],
|
|
||||||
"aliases": [],
|
|
||||||
"minimum-stability": "RC",
|
|
||||||
"stability-flags": [],
|
|
||||||
"prefer-stable": false,
|
|
||||||
"prefer-lowest": false,
|
|
||||||
"platform": [],
|
|
||||||
"platform-dev": []
|
|
||||||
}
|
|
2
samples/server/petstore/php-slim/.gitignore
vendored
2
samples/server/petstore/php-slim/.gitignore
vendored
@ -3,4 +3,4 @@ composer.phar
|
|||||||
|
|
||||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||||
composer.lock
|
# composer.lock
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* $Special[modelName]
|
|
||||||
*/
|
|
||||||
namespace \Models;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* $Special[modelName]
|
|
||||||
*/
|
|
||||||
class $Special[modelName] {
|
|
||||||
/* @var int $specialPropertyName */
|
|
||||||
private $specialPropertyName;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* 200Response
|
|
||||||
*/
|
|
||||||
namespace \Models;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 200Response
|
|
||||||
*/
|
|
||||||
class 200Response {
|
|
||||||
/* @var int $name */
|
|
||||||
private $name;
|
|
||||||
/* @var string $class */
|
|
||||||
private $class;
|
|
||||||
}
|
|
@ -8,6 +8,6 @@ namespace \Models;
|
|||||||
* ArrayOfArrayOfNumberOnly
|
* ArrayOfArrayOfNumberOnly
|
||||||
*/
|
*/
|
||||||
class ArrayOfArrayOfNumberOnly {
|
class ArrayOfArrayOfNumberOnly {
|
||||||
/* @var Number[][] $arrayArrayNumber */
|
/* @var float[][] $arrayArrayNumber */
|
||||||
private $arrayArrayNumber;
|
private $arrayArrayNumber;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,6 @@ namespace \Models;
|
|||||||
* ArrayOfNumberOnly
|
* ArrayOfNumberOnly
|
||||||
*/
|
*/
|
||||||
class ArrayOfNumberOnly {
|
class ArrayOfNumberOnly {
|
||||||
/* @var Number[] $arrayNumber */
|
/* @var float[] $arrayNumber */
|
||||||
private $arrayNumber;
|
private $arrayNumber;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,6 @@ class Cat {
|
|||||||
private $className;
|
private $className;
|
||||||
/* @var string $color */
|
/* @var string $color */
|
||||||
private $color;
|
private $color;
|
||||||
/* @var Bool $declawed */
|
/* @var bool $declawed */
|
||||||
private $declawed;
|
private $declawed;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ class FormatTest {
|
|||||||
private $int32;
|
private $int32;
|
||||||
/* @var int $int64 */
|
/* @var int $int64 */
|
||||||
private $int64;
|
private $int64;
|
||||||
/* @var Number $number */
|
/* @var float $number */
|
||||||
private $number;
|
private $number;
|
||||||
/* @var float $float */
|
/* @var float $float */
|
||||||
private $float;
|
private $float;
|
||||||
@ -22,15 +22,15 @@ class FormatTest {
|
|||||||
private $double;
|
private $double;
|
||||||
/* @var string $string */
|
/* @var string $string */
|
||||||
private $string;
|
private $string;
|
||||||
/* @var ByteArray $byte */
|
/* @var string $byte */
|
||||||
private $byte;
|
private $byte;
|
||||||
/* @var \SplFileObject $binary */
|
/* @var \SplFileObject $binary */
|
||||||
private $binary;
|
private $binary;
|
||||||
/* @var \DateTime $date */
|
/* @var \DateTime $date */
|
||||||
private $date;
|
private $date;
|
||||||
/* @var DateTime $dateTime */
|
/* @var \DateTime $dateTime */
|
||||||
private $dateTime;
|
private $dateTime;
|
||||||
/* @var UUID $uuid */
|
/* @var string $uuid */
|
||||||
private $uuid;
|
private $uuid;
|
||||||
/* @var string $password */
|
/* @var string $password */
|
||||||
private $password;
|
private $password;
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* List
|
|
||||||
*/
|
|
||||||
namespace \Models;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List
|
|
||||||
*/
|
|
||||||
class List {
|
|
||||||
/* @var string $_123list */
|
|
||||||
private $_123list;
|
|
||||||
}
|
|
@ -12,7 +12,7 @@ class MapTest {
|
|||||||
private $mapMapOfString;
|
private $mapMapOfString;
|
||||||
/* @var map[string,string] $mapOfEnumString */
|
/* @var map[string,string] $mapOfEnumString */
|
||||||
private $mapOfEnumString;
|
private $mapOfEnumString;
|
||||||
/* @var map[string,Bool] $directMap */
|
/* @var map[string,bool] $directMap */
|
||||||
private $directMap;
|
private $directMap;
|
||||||
/* @var \\Models\StringBooleanMap $indirectMap */
|
/* @var \\Models\StringBooleanMap $indirectMap */
|
||||||
private $indirectMap;
|
private $indirectMap;
|
||||||
|
@ -8,9 +8,9 @@ namespace \Models;
|
|||||||
* MixedPropertiesAndAdditionalPropertiesClass
|
* MixedPropertiesAndAdditionalPropertiesClass
|
||||||
*/
|
*/
|
||||||
class MixedPropertiesAndAdditionalPropertiesClass {
|
class MixedPropertiesAndAdditionalPropertiesClass {
|
||||||
/* @var UUID $uuid */
|
/* @var string $uuid */
|
||||||
private $uuid;
|
private $uuid;
|
||||||
/* @var DateTime $dateTime */
|
/* @var \DateTime $dateTime */
|
||||||
private $dateTime;
|
private $dateTime;
|
||||||
/* @var map[string,\\Models\Animal] $map */
|
/* @var map[string,\\Models\Animal] $map */
|
||||||
private $map;
|
private $map;
|
||||||
|
@ -8,6 +8,6 @@ namespace \Models;
|
|||||||
* NumberOnly
|
* NumberOnly
|
||||||
*/
|
*/
|
||||||
class NumberOnly {
|
class NumberOnly {
|
||||||
/* @var Number $justNumber */
|
/* @var float $justNumber */
|
||||||
private $justNumber;
|
private $justNumber;
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,10 @@ class Order {
|
|||||||
private $petId;
|
private $petId;
|
||||||
/* @var int $quantity */
|
/* @var int $quantity */
|
||||||
private $quantity;
|
private $quantity;
|
||||||
/* @var DateTime $shipDate */
|
/* @var \DateTime $shipDate */
|
||||||
private $shipDate;
|
private $shipDate;
|
||||||
/* @var string $status Order Status */
|
/* @var string $status Order Status */
|
||||||
private $status;
|
private $status;
|
||||||
/* @var Bool $complete */
|
/* @var bool $complete */
|
||||||
private $complete;
|
private $complete;
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ namespace \Models;
|
|||||||
* OuterComposite
|
* OuterComposite
|
||||||
*/
|
*/
|
||||||
class OuterComposite {
|
class OuterComposite {
|
||||||
/* @var Number $myNumber */
|
/* @var float $myNumber */
|
||||||
private $myNumber;
|
private $myNumber;
|
||||||
/* @var string $myString */
|
/* @var string $myString */
|
||||||
private $myString;
|
private $myString;
|
||||||
/* @var Bool $myBoolean */
|
/* @var bool $myBoolean */
|
||||||
private $myBoolean;
|
private $myBoolean;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* Return
|
|
||||||
*/
|
|
||||||
namespace \Models;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return
|
|
||||||
*/
|
|
||||||
class Return {
|
|
||||||
/* @var int $return */
|
|
||||||
private $return;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user