28 Commits

Author SHA1 Message Date
Andrei Matei
c62ebc377e
[Go] Add authentication methods only if referenced in input spec (#14138)
* Add conditions for auth methods

* Add extra auth method validations

* Regenerate example SDK

* Clean-up tests

* Fix indentation and go.sum
2022-12-01 15:29:59 +08:00
Maëlick
41255c1f18
Fix staticcheck ST1005 errors in generated Go client (#13633)
* Fix staticcheck ST1005 errors in go client

* Samples updated

* sample test fix for openapiv3 petstore go client
2022-10-18 22:46:49 +08:00
Nathan Baulch
c1c5775271
[go] More idiomatic godoc comments (#10044)
* [go] More idiomatic godoc comments

* [go] Mark deprecated fields and functions

* [go] Minor mustache readability/consistency fixes

* [go] Mark deprecated operation parameters

* [go] Deprecate a petstore component property for testing

* [go] Apply deprecated godoc in Go servers also
2021-08-03 17:11:16 +08:00
William Cheng
8fad36c898
[Go] minor format change, deprecate "withGoCodegenComment" option (#7375)
* use tab in comment, remove withGoCodegenComment

* deprecated option
2020-09-12 22:05:10 +08:00
William Cheng
14d41310b9
[Go] replace go generator with go-experimental generator (#7337)
* replace go with go-experimental

* update samples

* extends with abstract go class

* rearrange

* remove deprecated

* minor fix

* remove go deprecated samples

* update pom, clean up samples

* mark generator as deprecated
2020-09-04 09:56:42 +08:00
Tomasz Jakub Rup
d643b2706a [go][client] fix when schema have multiple servers (#4901) 2020-01-02 13:44:52 +08:00
Jérôme
af783a8c54 [REQ][GO] add awsv4 signature support (#4784)
* [REQ][GO] add awsv4 signature support for client

OpenAPI format does not support AWS Signature method.
This commit add support for AWSv4 signature in GO client generation by adding "withAWSV4Signature" option.
"withAWSV4Signature" option is false by default.

Signed-off-by: Jérome Jutteau <jerome.jutteau@outscale.com>

* [REQ][GO] update samples for awsv4 signature support

Signed-off-by: Jérome Jutteau <jerome.jutteau@outscale.com>
2019-12-22 13:09:10 +08:00
Jiri Kuncar
dce392336d [Go] Add multiple servers support to Go(-experimental) client (#4635)
* [Go] Add multiple servers support to Go-experimental client

* [Go] Use same configuration in go and go-experimental

* [Go] Use Replace -1 instead of ReplaceAll

* [Go] Fix typo and add bound check

* [Go] Regenerate missing templates
2019-12-04 16:27:30 +08:00
Marin Atanasov Nikolov
df682aba99 Add support for dumping request and response in Go generated clients (#4566)
* Add support for dumping request and response in Go generated clients

The following change adds a new configuration setting, which
controls whether clients want to dump the HTTP request and response.

Useful when debugging API calls and clients.

* samples: Update Go samples with XML

* Use log.Logger when dumping HTTP request and response in Go client
2019-11-28 20:52:16 +08:00
William Cheng
91daca36ef
Better Go code format (#3819)
* better varible naming

* better comments

* better code format for go experimental client

* better comment, update samples
2019-09-04 14:22:06 +08:00
William Cheng
a897feef50
Fix alias to map in the model's properties (#360)
* add test case for ref to map (boolean) in fake petstore spec

* fix alias to map in model properties

* remove logging from new method

* update samples for the new map test case

* fix javadoc string

* skip testSanitizeNestedInvalidValue in php test

* skip test in php oas3 client

* add logic to handle outer enum

* update samples

* fix alias in model's allOf

* generate models for map def

* update petstore samples

* update petstore samples
2018-06-21 22:59:02 +08:00
William Cheng
0dbb6dcaa6
Update Go generators' default value (#362)
* udpate go client default value

* update go generators' default value
2018-05-08 10:16:38 +08:00
Oleksandr Slynko
919f867eba [go] Fix go client formatting (#7283)
* Fix some go client formatting issues

* Fix go client go imports

* Run `goimports -w .` on examples directory

* Sort imports in api

* Add new line between each property

Before secret feature was used to add new line using two property
declaration in the same line. There should be no new line before
first property. The easiest way is to use `-first` special
property
https://github.com/samskivert/jmustache#-first-and--last

New line are required so `goimports` won't reformat  whitespaces between
property name and type.

* Change whitespaces to tabs

* Fix whitespaces in api_client

There is a new line between each service to prevent `goimports` from
adding whitespaces between types and names

* Fix more whitespaces

There was a need to set special delimeter for formatting in the commit.
Go slices use curly braces and `jmustache` got confused when found
triple curly braces.

* Fix whitespaces in configuration.mustache

* Fix whitespaces for api response

* Support for optional description

Do not add whitespace if description is missing

* Add new lines between enum values to prevent formatting

* Generate go code from current code

- imports are not sorted :(
- there are extra whitespaces for different languages. I don't know why

* Run generate for security tests
2018-01-07 11:53:55 +08:00
antihax
831e8d7c87 [Go] Add context to all requests for tracing, logging, cancellations, etc. (#6997)
* Add context to all requests for tracing, logging, cancellations, etc.

* Fix compile error with when call has no parameters.
2017-11-30 00:30:35 +08:00
wing328
5143fb58a4 revise go header, minor formatting fix (#6695) 2017-10-17 22:31:06 +08:00
wing328
96444d374f update go petstore samples 2017-10-13 18:27:13 +08:00
antihax
3ed1aa8e79 Rewrite of Go Client #2 (#5037)
* Rewrite of Go Client

* Revert to older version of context.Context

* Clean and bulk up concurrency test.

* Correct {{path}} to {{{path}}}

* change custom date type to string.

* Add APIKey authentication

* Correct missing line from resolving conflicts.

Correct missing line from resolving conflicts.
2017-04-22 01:17:18 +08:00
Paŭlo Ebermann
db71d97370 Updating samples after #5232. (#5243)
* Updating samples after #5232.

* Fix tests after #5232.

* Fix Javascript client tests.

* JaxRS server: set serverPort only when not given from outside.

* Update JaxRS sample creator scripts to fix serverPort.

* Preliminary test fix for JaxRS server generators.

* Updating samples for JaxRS with Jersey1/2.

* Updating JaxRS samples again.
2017-03-30 01:28:53 +08:00
Valentin Valchev
96ed41a29c Fixed issue #4665 [go] required object parameters are marked omitempty. (#4682)
* Fixed issue #4665 [go] required object parameters are marked omitempty.

* Run ./bin/go-petstore.sh as suggested by @wing328.
Please note, that there are quite few changes, that doesn’t come from the diff I’ve applied. Seems the script wasn’t run on the previous commit.
2017-02-01 23:56:22 +08:00
wing328
90512e6326 Remove Apache license from API client generators (#4197)
* remove php apache license

* remove apache license from C#

* remove apache license in objc code

* remove license from swift 3 code

* remove apache license from perl code

* remove license from scala code

* remove license from ts, go, android, cpp, scala

* remove license from java api client

* restore clojure petstore files

* remove license from travis file

* clean up apache-related terms in php, ruby, python mustache tempaltes

* remove license from JS API cilent
2016-11-16 21:44:49 +08:00
wing328
535de68701 update go petstore sample 2016-08-17 23:05:03 +08:00
wing328
752ba61e67 [Go] Add more test cases and fix numeric form/header parameters (#3574)
* add more tests for go, fix numeric form/header parameters

* update go sample
2016-08-11 14:28:31 +08:00
Guo Huang
7b57a26a97 added apache LICENSE 2016-05-25 10:11:52 -07:00
Neil O'Toole
5fdf615de7 Issue #2478 - generated code now conforms more closely to conventions 2016-05-01 14:41:40 +01:00
Guo Huang
8caa8abfc1 added packageName in the codegen option 2016-04-27 22:47:57 -07:00
Guo Huang
7599dcb112 changed Api to API based on golang's convention 2016-04-24 21:10:32 -07:00
Guo Huang
e555b3ad34 added debug setter and getter in Go configuration 2016-04-20 22:36:32 -07:00
wing328
70e42cb0db add new go files 2016-04-17 17:10:10 +08:00