You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolve several issues in generated Go code (#8491)
* [go] use regular stdlib import names
* [go] support primitive oneOf types
See #8489
* [go] improve pbv/pbr handling
Improves the way pass-by-value and pass-by-reference variables are used.
Closes#8489
* [go] improve generated documentation
* [go] adopt pointer changes in interface
* [go] regenerate sample
* [go] resolve pointer issues
* [go] regenerate clients and avoid pointers on primitive return values
* [go] improve Exec() return value handling
* [go] regernate files
* [go] use go modules
* [go] properly handle polymorph decode
If polymorphism without discriminator was used, the previous code was unable to properly decode the vaules. By using a strict decoder, which rejects unknown fields, type guessing now works.
* [go] make GetActualInstance not panic on nil
* [go] return GenericOpenAPIError as pointer
* [go] clarify helper function godoc
* [go] address test regression error type
* [go] regenerate go samples
* [go] resolve go mod issues and test regressions
* [go] resolve merge conflicts and regenerate
* [go] resolve merge conflicts
* [go] Replace spaces with tabs
Co-authored-by: Jiri Kuncar <[email protected]>
* [go] Replace spaces with tabs
Co-authored-by: Jiri Kuncar <[email protected]>
Co-authored-by: Jiri Kuncar <[email protected]>
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.
@@ -70,10 +70,10 @@ An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
70
70
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/go/api.mustache
+28-25Lines changed: 28 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ package {{packageName}}
4
4
{{#operations}}
5
5
import (
6
6
"bytes"
7
-
_context "context"
8
-
_ioutil "io/ioutil"
9
-
_nethttp "net/http"
10
-
_neturl "net/url"
7
+
"context"
8
+
"io/ioutil"
9
+
"net/http"
10
+
"net/url"
11
11
{{#imports}} "{{import}}"
12
12
{{/imports}}
13
13
)
14
14
15
15
// Linger please
16
16
var (
17
-
_ _context.Context
17
+
_ context.Context
18
18
)
19
19
{{#generateInterfaces}}
20
20
@@ -28,22 +28,22 @@ type {{classname}} interface {
28
28
{{{unescapedNotes}}}
29
29
{{/notes}}
30
30
31
-
@param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}}
31
+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}}
@param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}}
88
+
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}}
0 commit comments