Fix go readme, remove resty install (#280)

* fix go readme, remove resty install

* fix default to null in go petstore doc
This commit is contained in:
William Cheng 2018-05-01 12:02:55 +08:00 committed by GitHub
parent 4bc99b9da8
commit acb63fd5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 107 additions and 114 deletions

View File

@ -546,4 +546,13 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
public void setWithXml(boolean withXml) {
this.withXml = withXml;
}
@Override
public String toDefaultValue(Schema schema) {
if (schema.getDefault() != null) {
return schema.getDefault().toString();
} else {
return null;
}
}
}

View File

@ -24,7 +24,6 @@ Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get gopkg.in/go-resty/resty.v0
go get github.com/antihax/optional
```

View File

@ -38,7 +38,7 @@ public class GoModelTest {
Assert.assertEquals(property1.baseName, "id");
Assert.assertEquals(property1.datatype, "int64");
Assert.assertEquals(property1.name, "Id");
Assert.assertEquals(property1.defaultValue, "null");
Assert.assertNull(property1.defaultValue);
Assert.assertEquals(property1.baseType, "int64");
Assert.assertTrue(property1.hasMore);
Assert.assertTrue(property1.required);
@ -49,7 +49,7 @@ public class GoModelTest {
Assert.assertEquals(property2.baseName, "name");
Assert.assertEquals(property2.datatype, "string");
Assert.assertEquals(property2.name, "Name");
Assert.assertEquals(property2.defaultValue, "null");
Assert.assertNull(property2.defaultValue);
Assert.assertEquals(property2.baseType, "string");
Assert.assertTrue(property2.hasMore);
Assert.assertTrue(property2.required);
@ -61,7 +61,7 @@ public class GoModelTest {
Assert.assertEquals(property3.complexType, "time.Time");
Assert.assertEquals(property3.datatype, "time.Time");
Assert.assertEquals(property3.name, "CreatedAt");
Assert.assertEquals(property3.defaultValue, "null");
Assert.assertNull(property3.defaultValue);
Assert.assertEquals(property3.baseType, "time.Time");
Assert.assertFalse(property3.hasMore);
Assert.assertFalse(property3.required);
@ -88,7 +88,7 @@ public class GoModelTest {
Assert.assertEquals(property1.baseName, "id");
Assert.assertEquals(property1.datatype, "int64");
Assert.assertEquals(property1.name, "Id");
Assert.assertEquals(property1.defaultValue, "null");
Assert.assertNull(property1.defaultValue);
Assert.assertEquals(property1.baseType, "int64");
Assert.assertTrue(property1.hasMore);
Assert.assertTrue(property1.required);

View File

@ -16,7 +16,6 @@ Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get gopkg.in/go-resty/resty.v0
go get github.com/antihax/optional
```

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapProperty** | **map[string]string** | | [optional] [default to null]
**MapOfMapProperty** | [**map[string]map[string]string**](map.md) | | [optional] [default to null]
**MapProperty** | **map[string]string** | | [optional]
**MapOfMapProperty** | [**map[string]map[string]string**](map.md) | | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | [default to null]
**Color** | **string** | | [optional] [default to null]
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to red]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Code** | **int32** | | [optional] [default to null]
**Type** | **string** | | [optional] [default to null]
**Message** | **string** | | [optional] [default to null]
**Code** | **int32** | | [optional]
**Type** | **string** | | [optional]
**Message** | **string** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayArrayNumber** | [**[][]float32**](array.md) | | [optional] [default to null]
**ArrayArrayNumber** | [**[][]float32**](array.md) | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayNumber** | **[]float32** | | [optional] [default to null]
**ArrayNumber** | **[]float32** | | [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)

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayOfString** | **[]string** | | [optional] [default to null]
**ArrayArrayOfInteger** | [**[][]int64**](array.md) | | [optional] [default to null]
**ArrayArrayOfModel** | [**[][]ReadOnlyFirst**](array.md) | | [optional] [default to null]
**ArrayOfString** | **[]string** | | [optional]
**ArrayArrayOfInteger** | [**[][]int64**](array.md) | | [optional]
**ArrayArrayOfModel** | [**[][]ReadOnlyFirst**](array.md) | | [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)

View File

@ -3,12 +3,12 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SmallCamel** | **string** | | [optional] [default to null]
**CapitalCamel** | **string** | | [optional] [default to null]
**SmallSnake** | **string** | | [optional] [default to null]
**CapitalSnake** | **string** | | [optional] [default to null]
**SCAETHFlowPoints** | **string** | | [optional] [default to null]
**ATT_NAME** | **string** | Name of the pet | [optional] [default to null]
**SmallCamel** | **string** | | [optional]
**CapitalCamel** | **string** | | [optional]
**SmallSnake** | **string** | | [optional]
**CapitalSnake** | **string** | | [optional]
**SCAETHFlowPoints** | **string** | | [optional]
**ATT_NAME** | **string** | Name of the pet | [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)

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | [default to null]
**Color** | **string** | | [optional] [default to null]
**Declawed** | **bool** | | [optional] [default to null]
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to red]
**Declawed** | **bool** | | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int64** | | [optional] [default to null]
**Name** | **string** | | [optional] [default to null]
**Id** | **int64** | | [optional]
**Name** | **string** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Class** | **string** | | [optional] [default to null]
**Class** | **string** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Client** | **string** | | [optional] [default to null]
**Client** | **string** | | [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)

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | [default to null]
**Color** | **string** | | [optional] [default to null]
**Breed** | **string** | | [optional] [default to null]
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to red]
**Breed** | **string** | | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustSymbol** | **string** | | [optional] [default to null]
**ArrayEnum** | **[]string** | | [optional] [default to null]
**JustSymbol** | **string** | | [optional]
**ArrayEnum** | **[]string** | | [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)

View File

@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EnumString** | **string** | | [optional] [default to null]
**EnumStringRequired** | **string** | | [default to null]
**EnumInteger** | **int32** | | [optional] [default to null]
**EnumNumber** | **float64** | | [optional] [default to null]
**OuterEnum** | [***OuterEnum**](OuterEnum.md) | | [optional] [default to null]
**EnumString** | **string** | | [optional]
**EnumStringRequired** | **string** | |
**EnumInteger** | **int32** | | [optional]
**EnumNumber** | **float64** | | [optional]
**OuterEnum** | [***OuterEnum**](OuterEnum.md) | | [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)

View File

@ -288,7 +288,7 @@ Name | Type | Description | Notes
**enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) |
**enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) |
**enumFormStringArray** | [**optional.Interface of []string**](array.md)| Form parameter enum test (string array) |
**enumFormString** | **optional.String**| Form parameter enum test (string) |
**enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg]
### Return type

View File

@ -3,19 +3,19 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Integer** | **int32** | | [optional] [default to null]
**Int32** | **int32** | | [optional] [default to null]
**Int64** | **int64** | | [optional] [default to null]
**Number** | **float32** | | [default to null]
**Float** | **float32** | | [optional] [default to null]
**Double** | **float64** | | [optional] [default to null]
**String** | **string** | | [optional] [default to null]
**Byte** | **string** | | [default to null]
**Binary** | [****os.File**](*os.File.md) | | [optional] [default to null]
**Date** | **string** | | [default to null]
**DateTime** | [**time.Time**](time.Time.md) | | [optional] [default to null]
**Uuid** | **string** | | [optional] [default to null]
**Password** | **string** | | [default to null]
**Integer** | **int32** | | [optional]
**Int32** | **int32** | | [optional]
**Int64** | **int64** | | [optional]
**Number** | **float32** | |
**Float** | **float32** | | [optional]
**Double** | **float64** | | [optional]
**String** | **string** | | [optional]
**Byte** | **string** | |
**Binary** | [****os.File**](*os.File.md) | | [optional]
**Date** | **string** | |
**DateTime** | [**time.Time**](time.Time.md) | | [optional]
**Uuid** | **string** | | [optional]
**Password** | **string** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [default to null]
**Foo** | **string** | | [optional] [default to null]
**Bar** | **string** | | [optional]
**Foo** | **string** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Var123List** | **string** | | [optional] [default to null]
**Var123List** | **string** | | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] [default to null]
**MapOfEnumString** | **map[string]string** | | [optional] [default to null]
**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional]
**MapOfEnumString** | **map[string]string** | | [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)

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | **string** | | [optional] [default to null]
**DateTime** | [**time.Time**](time.Time.md) | | [optional] [default to null]
**Map** | [**map[string]Animal**](Animal.md) | | [optional] [default to null]
**Uuid** | **string** | | [optional]
**DateTime** | [**time.Time**](time.Time.md) | | [optional]
**Map** | [**map[string]Animal**](Animal.md) | | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **int32** | | [optional] [default to null]
**Class** | **string** | | [optional] [default to null]
**Name** | **int32** | | [optional]
**Class** | **string** | | [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)

View File

@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **int32** | | [default to null]
**SnakeCase** | **int32** | | [optional] [default to null]
**Property** | **string** | | [optional] [default to null]
**Var123Number** | **int32** | | [optional] [default to null]
**Name** | **int32** | |
**SnakeCase** | **int32** | | [optional]
**Property** | **string** | | [optional]
**Var123Number** | **int32** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustNumber** | **float32** | | [optional] [default to null]
**JustNumber** | **float32** | | [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)

View File

@ -3,12 +3,12 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int64** | | [optional] [default to null]
**PetId** | **int64** | | [optional] [default to null]
**Quantity** | **int32** | | [optional] [default to null]
**ShipDate** | [**time.Time**](time.Time.md) | | [optional] [default to null]
**Status** | **string** | Order Status | [optional] [default to null]
**Complete** | **bool** | | [optional] [default to null]
**Id** | **int64** | | [optional]
**PetId** | **int64** | | [optional]
**Quantity** | **int32** | | [optional]
**ShipDate** | [**time.Time**](time.Time.md) | | [optional]
**Status** | **string** | Order Status | [optional]
**Complete** | **bool** | | [optional] [default to false]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MyNumber** | **float32** | | [optional] [default to null]
**MyString** | **string** | | [optional] [default to null]
**MyBoolean** | **bool** | | [optional] [default to null]
**MyNumber** | **float32** | | [optional]
**MyString** | **string** | | [optional]
**MyBoolean** | **bool** | | [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)

View File

@ -3,12 +3,12 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int64** | | [optional] [default to null]
**Category** | [***Category**](Category.md) | | [optional] [default to null]
**Name** | **string** | | [default to null]
**PhotoUrls** | **[]string** | | [default to null]
**Tags** | [**[]Tag**](Tag.md) | | [optional] [default to null]
**Status** | **string** | pet status in the store | [optional] [default to null]
**Id** | **int64** | | [optional]
**Category** | [***Category**](Category.md) | | [optional]
**Name** | **string** | |
**PhotoUrls** | **[]string** | |
**Tags** | [**[]Tag**](Tag.md) | | [optional]
**Status** | **string** | pet status in the store | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [default to null]
**Baz** | **string** | | [optional] [default to null]
**Bar** | **string** | | [optional]
**Baz** | **string** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Return** | **int32** | | [optional] [default to null]
**Return** | **int32** | | [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)

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SpecialPropertyName** | **int64** | | [optional] [default to null]
**SpecialPropertyName** | **int64** | | [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)

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int64** | | [optional] [default to null]
**Name** | **string** | | [optional] [default to null]
**Id** | **int64** | | [optional]
**Name** | **string** | | [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)

View File

@ -3,14 +3,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int64** | | [optional] [default to null]
**Username** | **string** | | [optional] [default to null]
**FirstName** | **string** | | [optional] [default to null]
**LastName** | **string** | | [optional] [default to null]
**Email** | **string** | | [optional] [default to null]
**Password** | **string** | | [optional] [default to null]
**Phone** | **string** | | [optional] [default to null]
**UserStatus** | **int32** | User Status | [optional] [default to null]
**Id** | **int64** | | [optional]
**Username** | **string** | | [optional]
**FirstName** | **string** | | [optional]
**LastName** | **string** | | [optional]
**Email** | **string** | | [optional]
**Password** | **string** | | [optional]
**Phone** | **string** | | [optional]
**UserStatus** | **int32** | User Status | [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)

View File

@ -69,21 +69,7 @@
</configuration>
</execution>
<execution>
<id>go-get-resty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>go</executable>
<arguments>
<argument>get</argument>
<argument>gopkg.in/go-resty/resty.v0</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>go-get-resty</id>
<id>go-get-optional</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>