mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-28 19:50:49 +00:00
fix NPE in go generator (#3104)
This commit is contained in:
parent
6379022c42
commit
86e53d6f0b
@ -51,6 +51,7 @@ declare -a scripts=(
|
|||||||
"./bin/csharp-netcore-petstore-all.sh"
|
"./bin/csharp-netcore-petstore-all.sh"
|
||||||
"./bin/elixir-petstore.sh"
|
"./bin/elixir-petstore.sh"
|
||||||
"./bin/go-petstore.sh"
|
"./bin/go-petstore.sh"
|
||||||
|
"./bin/go-petstore-withxml.sh"
|
||||||
"./bin/go-gin-petstore-server.sh"
|
"./bin/go-gin-petstore-server.sh"
|
||||||
"./bin/groovy-petstore.sh"
|
"./bin/groovy-petstore.sh"
|
||||||
"./bin/apex-petstore.sh"
|
"./bin/apex-petstore.sh"
|
||||||
|
@ -114,7 +114,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalProperties.containsKey(WITH_GO_CODEGEN_COMMENT)) {
|
if (additionalProperties.containsKey(CodegenConstants.IS_GO_SUBMODULE)) {
|
||||||
setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString()));
|
setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString()));
|
||||||
if (isGoSubmodule) {
|
if (isGoSubmodule) {
|
||||||
additionalProperties.put(CodegenConstants.IS_GO_SUBMODULE, "true");
|
additionalProperties.put(CodegenConstants.IS_GO_SUBMODULE, "true");
|
||||||
|
@ -1 +1 @@
|
|||||||
4.0.1-SNAPSHOT
|
4.0.2-SNAPSHOT
|
@ -388,7 +388,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
|
|||||||
} else if jsonCheck.MatchString(contentType) {
|
} else if jsonCheck.MatchString(contentType) {
|
||||||
err = json.NewEncoder(bodyBuf).Encode(body)
|
err = json.NewEncoder(bodyBuf).Encode(body)
|
||||||
} else if xmlCheck.MatchString(contentType) {
|
} else if xmlCheck.MatchString(contentType) {
|
||||||
xml.NewEncoder(bodyBuf).Encode(body)
|
err = xml.NewEncoder(bodyBuf).Encode(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -59,7 +59,7 @@ Creates list of users with given input array
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
**body** | [**[]User**](array.md)| List of user object |
|
**body** | [**[]User**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ Creates list of users with given input array
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
**body** | [**[]User**](array.md)| List of user object |
|
**body** | [**[]User**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user