249 Commits

Author SHA1 Message Date
William Cheng
6518932ccf add tests for oneOf object (go) 2024-01-15 12:06:56 +08:00
martin-mfg
64f2cad9e8
fix #17258 - use model class only if it is generated (#17490)
* fix  #16797 and #15796 spring child constructor missing parent params

* root cause and update the DefaultCodegen.java to add missing property when with multi inheritance

* rollback SpringCodegen.java

* update samples

* rollback with master cause #16992 fixed this issue too

* still using orignal design

* catchup master

* catchup master

* catchup master

* fix

* add tests

---------

Co-authored-by: dabdirb <dabdirb@gmail.com>
2024-01-05 10:30:28 +08:00
Ghufran Zahidi
c252216700
[go]: Accept APIKey as string, byte array or stream using io.Reader interface (#17432)
* Added support for APIKey as string or bytes stream for golang sdk.

* updated the sample code

* Update modules/openapi-generator/src/main/resources/go/signing.mustache

Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>

* updated the sample code

---------

Co-authored-by: Aanisha Mishra <aanisha.mishra05@gmail.com>
Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>
Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2023-12-26 17:39:53 +08:00
William Cheng
5eab3cef19
Prepare 7.3.0-SNAPSHOT (#17456)
* Revert "v7.2.0 release (#17455)"

This reverts commit fe638d009363c142c246ff089032f243e0b4ee01.

* set version to 7.3.0-SNAPSHOT

* update doc
2023-12-22 16:55:58 +08:00
Charles Treatman
da13013a27
[Go] fix validation of property names when a model has required fields and doesn't allow additional properties (#17267)
* update template for required field validation when additional properties are not allowed

* regenerate samples

* move bytes import from template to GoClientCodegen

* regenerate samples

* add test for model with required fields and additionalProperties: false
2023-12-22 12:35:52 +08:00
TAKAHiRO TOMiNAGA
004c7e8c8d
[Style][Go] standardize the format of mustache (tiny change) (#17363)
* fix: change indent style to tab in the mustache to generate Go code

* docs: standardize the language names for code blocks

* docs: change indent style to tab in the code blocks

* update: regenerate samples

* `./bin/generate-samples.sh ./bin/configs/*.yaml`
2023-12-10 10:13:49 +08:00
William Cheng
b19bc59c6a
add enum name mapping feature to go generators (#17289) 2023-12-04 10:52:58 +08:00
William Cheng
53289263d9
Prepare v7.2.0 (#17050)
* update version to 7.2.0-SNAPSHOT

* update samples

* update doc
2023-11-13 18:53:20 +08:00
Charles Treatman
db9fd9a094
[Go] validate required fields when unmarshalling JSON (#16863)
* validate required properties when unmarshalling JSON

* build project & update samples

* Add test for required field validation
2023-11-04 22:58:25 +08:00
Ian Cubbon
83822d269a
[Bug][Go][Client] Downloaded File Does Not Exist When Returned to Caller (#16954)
* Keep the file that gets written out to by the client->decode function

* Update the echo-api test case to check the file returned exists
2023-11-02 11:46:15 +08:00
William Cheng
8d76ab9511
[Go] Add multiple file upload support (#16956)
* add go echo api client github workflow

* add support for multi file upload in go client

* update go samples
2023-11-01 11:35:25 +08:00
Josh Raker
d1fa38e286
[BUG][GO] Add support for all +json and +xml suffixed media types (#16816)
* Add support for all +json and +xml suffixed media types to generated Go client

* Export JsonCheck and XmlCheck and add external tests

* Remove client_test.mustache
2023-10-17 00:47:09 +08:00
Josh Raker
c5d6884c63
[BUG][GO] Replace references to sw package with {{packageName}} in README template (#16812)
* Replace references to sw package with {{packageName}}

* Update samples
2023-10-15 10:37:27 +08:00
martin-mfg
2ca99bdf8e
use model class for request body with additionalProperties (#16613)
* try out simple fix

* add test case

* generate samples
2023-09-23 13:07:53 +08:00
William Cheng
5e8e2d7f6d
Prepare v7.1.0 in master (#16608)
* prepare v7.1.0 in master

* update
2023-09-18 17:37:36 +08:00
Charles Treatman
5b4d97016a
[Go] return errors that happen while unmarshalling objects (#16525)
* [Go] return errors that happen while unmarshalling objects

* Update model samples

* More updates to samples

* Update failing Go store API test to match the one that passes
2023-09-12 23:42:54 +08:00
Wojciech Trocki
6310ecdb0f
issue15126: restore default support for golang generator (#15127) 2023-08-28 11:38:09 +08:00
William Cheng
80121aa88f
Prepare v7.0.1 (#16409)
* prepare 7.0.1 in master

* update doc
2023-08-25 16:11:29 +08:00
William Cheng
2635b52b42
[go] fix issue that tempfile is not deleted (#16303)
* #15131 Issue: Tempfile is not deleted

* delete tempfile in go client

---------

Co-authored-by: Aniruddh <aniruddhjoshi94@gmail.com>
2023-08-11 14:40:56 +08:00
William Cheng
f6fb83878b
[Default] update isAdditionalPropertiesTrue tag to cover more types (#16227)
* enhance additional properties support

* update samples

* update tests

* add more tests

* update samples

* fix samples
2023-08-05 13:32:43 +08:00
William Cheng
7ca84e5c88
Add name, parameter name mapping to abstract go codegen (#16171)
* add name, parameter name mapping to abstract go codegen

* better code format
2023-07-28 09:57:23 +08:00
Adam Shannon
90eacb685c
fix(golang): make sure xml.Encoder is closed (#16141) 2023-07-26 15:48:46 +08:00
William Cheng
7b3681af47
fix isMap (#16043) 2023-07-11 17:14:44 +08:00
Richard Lavoie
117e5118b1
[GO] Fix value formatting in url with slices (#15581)
* fix reflect value for Slice

* Add test
2023-07-03 15:45:14 +08:00
William Cheng
6788f43af0
Better handling of Inline schema (#15682)
* skip allOf inline subschema created as $ref

* add option for fallback

* add back atleastonemodel

* add log

* update java, kotlin, js samples

* update tests

* fix native client test

* fix java client errors by regenerating test files

* clean up python

* clean up powershell

* clean up php

* clean up ruby

* update erlang, elixir

* update dart samples

* update ts samples

* update r, go samples

* update perl

* update swift

* add back files

* add back files

* remove outdated test files

* fix test
2023-06-11 15:35:58 +08:00
Beppe Catanese
f240ed4e4e
[Go] Serialize readonly fields (#15765)
* Do not skip readOnly fields in ToMap()

* Regenerate sample

* Add test

* Correct test
2023-06-10 19:23:52 +08:00
William Cheng
63a311a2e6 update go samples 2023-06-01 09:09:00 +08:00
Ween Jiann
78bffff8f3
[Go] Update API naming to follow Golang standard pkg (1 line change) (#15331)
* Add apiNameSuffix to AbstractGoCodegen

* Regenerate files

* Update tests

* Regenerate files

* Update test files

* Regenerate for CI test

* Regenerate for CI test

* Remove some docs

* Add files back
2023-05-13 09:40:26 +08:00
William Cheng
0c3460f95b Merge remote-tracking branch 'origin/master' into 7.0.x 2023-05-10 15:00:56 +08:00
Tiffany Marrel
4deaad557e
[Go] fix documentation of API authorization in README files (#15345)
align wording across generators
2023-05-09 14:24:16 +08:00
William Cheng
935146d187 Merge remote-tracking branch 'origin/master' into 7.0.x 2023-04-12 17:51:47 +08:00
Beppe Catanese
2b796d5c61
[Go] Format error message only when Kind is Struct (#15154)
* Check if Kind is Struct

* Commit regenerated files

* Tabs indentation instead of 4-space

* Commit regenerated files
2023-04-11 14:39:08 +08:00
William Cheng
5d1e18306a
Prepare 6.6.0-SNAPSHOT (#15100)
* set 6.6.0 snapshot version

* update samples

* update readme
2023-04-01 18:48:01 +08:00
William Cheng
7417432a54
Prepare 6.5.0 release (#15099)
* 6.5.0 release

* update samples
2023-04-01 15:03:35 +08:00
William Cheng
1beec7ef87 Merge remote-tracking branch 'origin' into 7.0.x 2023-03-03 21:52:50 +08:00
William Cheng
c50a775e0c
prepare 6.5.0 release (#14749) 2023-02-19 20:36:23 +08:00
William Cheng
93df0ff444
Prepare 6.4.0 release (#14748)
* prepare 6.4.0 release

* update samples
2023-02-19 18:53:20 +08:00
Beppe Catanese
68b944e6e6
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
2023-02-10 22:20:19 +08:00
Beppe Catanese
515abf8c68
[Go] Export isNil function in utils.go (#14625)
* Rename isNil to IsNil

* Regenerate files
2023-02-07 22:15:30 +08:00
William Cheng
cda3517891
[Go] properly set header parameters on api clients (#14637)
* [Go] properly set header parameters on api clients

* update samples

* update samples

---------

Co-authored-by: Paul Sokolik <paul.sokolik@gmail.com>
2023-02-07 21:45:24 +08:00
Masato Yagi
d8f777d707
Fix the examples and import path in golang client documents (#14612)
* Correct import

* Fix generated client doc when there is no response body

* generate samples
2023-02-03 21:44:45 +08:00
Gonzalo Gomez
68b41eeeea
[GO][Client] Don't import io/ioutil package that has been deprecated as of Go 1.16 (#14476)
* io/ioutil has been deprecated ass of Go 1.16, the same functionality is now provided by package io or package os

* run pr checklist

* Bump go version to 1.16.

* Run pr checklist

* Bump version to 1.18

* Run pr check list
2023-02-03 15:50:12 +08:00
William Cheng
31a89e35cb
Prepare 6.4.0 (#14582)
* update to 6.4.0 snapshot

* update samples

* update doc
2023-02-01 22:44:40 +08:00
William Cheng
8f2676c5c2
Prepare v6.3.0 release (#14580)
* 6.3.0 release

* fix maven plugin test

* update samples

* update doc

* fix tests in windows
2023-02-01 20:52:29 +08:00
Ian Cubbon
6e780218ad
[Go] Client Models using AllOf, OneOf, or AnyOf Correctly Include time and os imports (Attempt 2) (#14459)
* Currently, if a Model is an allOf the time and os imports are not correctly added to the generated file. This was introduced recently with a fix to not include those imports when the model is a composedSchema #13833. The logic in that fix was just slightly off as an allOf should be treated the same as a standard model.

If a model is an AllOf or does not have any composed schemas at all, the sub-models are in-lined defined in the struct. In this case, the standard logic of including the time and os imports apply.

If a model is a OneOf or AnyOf, the sub-models are included as pointers to the defined model. In this case, do not include those items in the logic of including time and os imports.

* Update example to include a time in an allOf

* Add back the accidentally removed nil check
2023-01-20 01:53:19 +08:00
Vikrant Balyan
9f502930ea
[Go] Adds a sha256 configuration option to hs2019 (#14467)
* enables configuration of sha256 with hs2019

* committing generated examples

Co-authored-by: Aanisha Mishra <aanisha.mishra05@gmail.com>
Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2023-01-16 23:21:53 +08:00
Ian Cubbon
74073df27c
[GO][Client] Use a *os.File for the API Client when uploading and downloading (#14340)
* Change the return type of a file back to a pointer

* Change the api template to handle not double pointer-ing return types of os.File

* Fix unit tests

* Couple more unit test fixes
2023-01-16 16:51:04 +08:00
Ian Cubbon
92775ceffc
[Go] [Client] Don't Explode Query Params (#14447)
* If the collection type is csv, that means 'dont explode the query params'.

* Simplify the logic just a tad

* url.Values -> Has was added in go1.17 but there are CI tests running at 1.16
2023-01-14 00:48:27 +08:00
Beppe Catanese
d0800c46e1
12551 [Go] Skipping marshalling of readonly fields (#14335)
* Skip toSerialize for readOnly fields

* Commit regenerated files
2023-01-02 23:35:54 +08:00
Bill Collins
71a7a822f4
Nullable subschemas (#13850)
* Add failing example of nullable subschema

* Do not generate new subschemas when nullable

* Generate client

* Update go example schema/test
2022-12-22 20:44:05 +08:00