forked from loafle/openapi-generator-original
[docs] Fix go-gin-server additional property docs. (#7188)
* [docs] Fix go-gin-server additional property docs. * add cli option for serverPort, apiPath Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
parent
c893b92775
commit
3e734a0b54
@ -5,9 +5,11 @@ sidebar_label: go-gin-server
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|apiPath|Name of the folder that contains the Go source code| |go|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|packageName|Go package name (convention: lowercase).| |openapi|
|
||||
|packageVersion|Go package version.| |1.0.0|
|
||||
|serverPort|The network port the generated server binds to| |8080|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenOperation;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
@ -107,6 +108,14 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
|
||||
"continue", "for", "import", "return", "var", "error", "nil")
|
||||
// Added "error" as it's used so frequently that it may as well be a keyword
|
||||
);
|
||||
|
||||
cliOptions.add(new CliOption("apiPath", "Name of the folder that contains the Go source code")
|
||||
.defaultValue(apiPath));
|
||||
|
||||
CliOption optServerPort = new CliOption("serverPort", "The network port the generated server binds to");
|
||||
optServerPort.setType("int");
|
||||
optServerPort.defaultValue(Integer.toString(serverPort));
|
||||
cliOptions.add(optServerPort);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user