update go readme, update pom go dependencies (#274)

This commit is contained in:
William Cheng 2018-04-30 13:04:00 +08:00 committed by GitHub
parent 8730f910b2
commit 799b033c22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 15 deletions

View File

@ -5,7 +5,7 @@
{{/appDescription}}
## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
This API client was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
- API version: {{appVersion}}
- Package version: {{packageVersion}}
@ -18,6 +18,16 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}
## Installation
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
```
Put the package under your project folder and add the following in import:
```golang
import "./{{packageName}}"

View File

@ -3,13 +3,23 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
This API client was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation
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
```
Put the package under your project folder and add the following in import:
```golang
import "./petstore"

View File

@ -100,11 +100,11 @@ paths:
type: array
items:
type: string
default: available
enum:
- available
- pending
- sold
default: available
responses:
200:
description: successful operation
@ -613,20 +613,20 @@ paths:
type: array
items:
type: string
default: $
enum:
- '>'
- $
default: $
- name: enum_header_string
in: header
description: Header parameter enum test (string)
schema:
type: string
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
- name: enum_query_string_array
in: query
description: Query parameter enum test (string array)
@ -635,20 +635,20 @@ paths:
type: array
items:
type: string
default: $
enum:
- '>'
- $
default: $
- name: enum_query_string
in: query
description: Query parameter enum test (string)
schema:
type: string
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
- name: enum_query_integer
in: query
description: Query parameter enum test (double)
@ -677,18 +677,18 @@ paths:
description: Form parameter enum test (string array)
items:
type: string
default: $
enum:
- '>'
- $
default: $
enum_form_string:
type: string
description: Form parameter enum test (string)
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
responses:
400:
description: Invalid request
@ -1100,11 +1100,11 @@ components:
name: Name
EnumClass:
type: string
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
List:
type: object
properties:

View File

@ -32,12 +32,12 @@ FakeApiService
Test serialization of outer boolean types
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
* @param "BooleanPostBody" (optional.Bool) - Input boolean as post body
* @param "Body" (optional.Bool) - Input boolean as post body
@return bool
*/
type FakeOuterBooleanSerializeOpts struct {
BooleanPostBody optional.Bool
Body optional.Bool
}
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) {
@ -74,8 +74,8 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
if localVarOptionals != nil && localVarOptionals.BooleanPostBody.IsSet() {
localVarPostBody = localVarOptionals.BooleanPostBody.Value()
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
localVarPostBody = localVarOptionals.Body.Value()
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)

View File

@ -34,7 +34,7 @@ Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeO
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**booleanPostBody** | **optional.Bool**| Input boolean as post body |
**body** | **optional.Bool**| Input boolean as post body |
### Return type

View File

@ -82,6 +82,20 @@
</arguments>
</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>github.com/antihax/optional</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>go-test</id>
<phase>integration-test</phase>