Skip to content

Commit

Permalink
Fix go readme, remove resty install (#280)
Browse files Browse the repository at this point in the history
* fix go readme, remove resty install

* fix default to null in go petstore doc
  • Loading branch information
wing328 committed May 1, 2018
1 parent 4bc99b9 commit acb63fd
Show file tree
Hide file tree
Showing 36 changed files with 107 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,4 +546,13 @@ public String toEnumName(CodegenProperty property) {
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void simpleModelTest() {
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);
Expand All @@ -49,7 +49,7 @@ public void simpleModelTest() {
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);
Expand All @@ -61,7 +61,7 @@ public void simpleModelTest() {
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);
Expand All @@ -88,7 +88,7 @@ public void listPropertyTest() {
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);
Expand Down
1 change: 0 additions & 1 deletion samples/client/petstore/go/go-petstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/go/go-petstore/docs/Animal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/go/go-petstore/docs/ApiResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/go/go-petstore/docs/ArrayTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/go/go-petstore/docs/Capitalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/go/go-petstore/docs/Cat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/go/go-petstore/docs/Category.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/ClassModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/go/go-petstore/docs/Dog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/go/go-petstore/docs/EnumArrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions samples/client/petstore/go/go-petstore/docs/EnumTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 13 additions & 13 deletions samples/client/petstore/go/go-petstore/docs/FormatTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/go/go-petstore/docs/MapTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/go/go-petstore/docs/Name.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/NumberOnly.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/go/go-petstore/docs/Order.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/go/go-petstore/docs/OuterComposite.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit acb63fd

Please sign in to comment.