This commit is contained in:
wing328 2017-05-26 22:50:06 +08:00
commit 39d79de6f7
22 changed files with 32 additions and 142 deletions

View File

@ -2561,7 +2561,9 @@ public class DefaultCodegen {
name = getAlias(name);
if (typeMapping.containsKey(name)) {
name = typeMapping.get(name);
p.baseType = name;
} else {
p.baseType = name;
name = toModelName(name);
if (defaultIncludes.contains(name)) {
imports.add(name);
@ -2570,7 +2572,6 @@ public class DefaultCodegen {
name = getTypeDeclaration(name);
}
p.dataType = name;
p.baseType = name;
}
}
p.paramName = toParamName(bp.getName());

View File

@ -560,7 +560,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
example = "new \\DateTime(\"" + escapeText(example) + "\")";
} else if (!languageSpecificPrimitives.contains(type)) {
// type is a model class, e.g. User
example = "new " + type + "()";
example = "new " + getTypeDeclaration(type) + "()";
} else {
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
}

View File

@ -616,19 +616,19 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
example = "/path/to/file";
}
example = "\"" + escapeText(example) + "\"";
} else if ("Date".equalsIgnoreCase(type)) {
} else if ("\\Date".equalsIgnoreCase(type)) {
if (example == null) {
example = "2013-10-20";
}
example = "new \\DateTime(\"" + escapeText(example) + "\")";
} else if ("DateTime".equalsIgnoreCase(type)) {
} 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 + "()";
example = "new " + getTypeDeclaration(type) + "()";
} else {
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
}

View File

@ -75,7 +75,7 @@ namespace Example
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{/allParams}}
### Return type

View File

@ -1,75 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>Goswagger</artifactId>
<packaging>pom</packaging>
<version>1.0.0</version>
<name>Goswagger</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>go-get-testify</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>go</executable>
<arguments>
<argument>get</argument>
<argument>github.com/stretchr/testify/assert</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>go-get-sling</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>go</executable>
<arguments>
<argument>get</argument>
<argument>github.com/dghubble/sling</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>go-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>go</executable>
<arguments>
<argument>test</argument>
<argument>-v</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -61,11 +61,6 @@ utility::string_t ApiClient::parameterToString(float value)
return utility::conversions::to_string_t(std::to_string(value));
}
utility::string_t ApiClient::parameterToString(float value)
{
return utility::conversions::to_string_t(std::to_string(value));
}
utility::string_t ApiClient::parameterToString(const utility::datetime &value)
{
return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601));

View File

@ -0,0 +1 @@
2.2.3-SNAPSHOT

View File

@ -132,10 +132,8 @@ Class | Method | HTTP request | Description
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.Category](docs/Category.md)
- [Model.ClassModel](docs/ClassModel.md)
- [Model.Dog](docs/Dog.md)
- [Model.EnumArrays](docs/EnumArrays.md)
- [Model.EnumClass](docs/EnumClass.md)
- [Model.EnumTest](docs/EnumTest.md)
@ -160,6 +158,8 @@ Class | Method | HTTP request | Description
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
- [Model.User](docs/User.md)
- [Model.Cat](docs/Cat.md)
- [Model.Dog](docs/Dog.md)
<a name="documentation-for-authorization"></a>

View File

@ -579,7 +579,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterBoolean>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean)));
}
/// <summary>
@ -650,7 +649,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterBoolean>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean)));
}
/// <summary>
@ -720,7 +718,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterComposite>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite)));
}
/// <summary>
@ -791,7 +788,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterComposite>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite)));
}
/// <summary>
@ -861,7 +857,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterNumber>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber)));
}
/// <summary>
@ -932,7 +927,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterNumber>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber)));
}
/// <summary>
@ -1002,7 +996,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterString>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString)));
}
/// <summary>
@ -1073,7 +1066,6 @@ namespace IO.Swagger.Api
return new ApiResponse<OuterString>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString)));
}
/// <summary>

View File

@ -62,10 +62,8 @@ Contact: apiteam@swagger.io
</ItemGroup>
<ItemGroup>
<Compile Include="Api\**\*.cs"/>
<Compile Include="Client\**\*.cs"/>
<Compile Include="Model\**\*.cs"/>
<Compile Include="Properties\**\*.cs"/>
<Compile Include="**\*.cs"
Exclude="obj\**" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@ -104,7 +104,7 @@ namespace IO.Swagger.Model
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
{
yield break;
}
}

View File

@ -148,7 +148,7 @@ namespace IO.Swagger.Model
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
{
yield break;
}
}

View File

@ -104,7 +104,7 @@ namespace IO.Swagger.Model
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
{
yield break;
}
}

View File

@ -104,7 +104,7 @@ namespace IO.Swagger.Model
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
{
yield break;
}
}

View File

@ -1,8 +0,0 @@
/*___Generated_by_IDEA___*/
package io.swagger.client;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}

View File

@ -1,7 +0,0 @@
/*___Generated_by_IDEA___*/
package io.swagger.client;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}

View File

@ -1,7 +0,0 @@
/*___Generated_by_IDEA___*/
package io.swagger.client;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}

View File

@ -114,11 +114,9 @@ Class | Method | HTTP request | Description
- [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md)
- [ArrayTest](docs/Model/ArrayTest.md)
- [Capitalization](docs/Model/Capitalization.md)
- [Cat](docs/Model/Cat.md)
- [Category](docs/Model/Category.md)
- [ClassModel](docs/Model/ClassModel.md)
- [Client](docs/Model/Client.md)
- [Dog](docs/Model/Dog.md)
- [EnumArrays](docs/Model/EnumArrays.md)
- [EnumClass](docs/Model/EnumClass.md)
- [EnumTest](docs/Model/EnumTest.md)
@ -142,6 +140,8 @@ Class | Method | HTTP request | Description
- [SpecialModelName](docs/Model/SpecialModelName.md)
- [Tag](docs/Model/Tag.md)
- [User](docs/Model/User.md)
- [Cat](docs/Model/Cat.md)
- [Dog](docs/Model/Dog.md)
## Documentation For Authorization

View File

@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\OuterBoolean**](../Model/\Swagger\Client\Model\OuterBoolean.md)| Input boolean as post body | [optional]
**body** | [**\Swagger\Client\Model\OuterBoolean**](../Model/OuterBoolean.md)| Input boolean as post body | [optional]
### Return type
@ -86,7 +86,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\OuterComposite**](../Model/\Swagger\Client\Model\OuterComposite.md)| Input composite as post body | [optional]
**body** | [**\Swagger\Client\Model\OuterComposite**](../Model/OuterComposite.md)| Input composite as post body | [optional]
### Return type
@ -131,7 +131,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\OuterNumber**](../Model/\Swagger\Client\Model\OuterNumber.md)| Input number as post body | [optional]
**body** | [**\Swagger\Client\Model\OuterNumber**](../Model/OuterNumber.md)| Input number as post body | [optional]
### Return type
@ -176,7 +176,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\OuterString**](../Model/\Swagger\Client\Model\OuterString.md)| Input string as post body | [optional]
**body** | [**\Swagger\Client\Model\OuterString**](../Model/OuterString.md)| Input string as post body | [optional]
### Return type
@ -221,7 +221,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\Client**](../Model/\Swagger\Client\Model\Client.md)| client model |
**body** | [**\Swagger\Client\Model\Client**](../Model/Client.md)| client model |
### Return type
@ -265,8 +265,8 @@ $int64 = 789; // int | None
$float = 3.4; // float | None
$string = "string_example"; // string | None
$binary = "B"; // string | None
$date = new \DateTime(); // \DateTime | None
$date_time = new \DateTime(); // \DateTime | None
$date = new \DateTime("2013-10-20"); // \DateTime | None
$date_time = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | None
$password = "password_example"; // string | None
$callback = "callback_example"; // string | None

View File

@ -44,7 +44,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store |
**body** | [**\Swagger\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
### Return type
@ -286,7 +286,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store |
**body** | [**\Swagger\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
### Return type

View File

@ -173,7 +173,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\Order**](../Model/\Swagger\Client\Model\Order.md)| order placed for purchasing the pet |
**body** | [**\Swagger\Client\Model\Order**](../Model/Order.md)| order placed for purchasing the pet |
### Return type

View File

@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Created user object |
**body** | [**\Swagger\Client\Model\User**](../Model/User.md)| Created user object |
### Return type
@ -71,7 +71,7 @@ Creates list of users with given input array
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi();
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
$body = array(new \Swagger\Client\Model\User()); // \Swagger\Client\Model\User[] | List of user object
try {
$api_instance->createUsersWithArrayInput($body);
@ -115,7 +115,7 @@ Creates list of users with given input array
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi();
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
$body = array(new \Swagger\Client\Model\User()); // \Swagger\Client\Model\User[] | List of user object
try {
$api_instance->createUsersWithListInput($body);
@ -351,7 +351,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted |
**body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Updated user object |
**body** | [**\Swagger\Client\Model\User**](../Model/User.md)| Updated user object |
### Return type