Skip to content

Commit

Permalink
rename flag field in generator Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gfelbing committed Jul 26, 2022
1 parent 56af0cd commit 395e74b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/protoc-gen-openapi/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Configuration struct {
EnumType *string
CircularDepth *int
DefaultResponse *bool
OutFiles *string
OutputMode *string
}

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/protoc-gen-openapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
EnumType: flags.String("enum_type", "integer", `type for enum serialization. Use "string" for string-based serialization`),
CircularDepth: flags.Int("depth", 2, "depth of recursion for circular messages"),
DefaultResponse: flags.Bool("default_response", true, `add default response. If "true", automatically adds a default response to operations which use the google.rpc.Status message. Useful if you use envoy or grpc-gateway to transcode as they use this type for their default error responses.`),
OutFiles: flags.String("output_mode", "merged", `output generation mode. By default, a single openapi.yaml is generated at the out folder. Use "source_relative' to generate a separate '[inputfile].openapi.yaml' next to each '[inputfile].proto'.`),
OutputMode: flags.String("output_mode", "merged", `output generation mode. By default, a single openapi.yaml is generated at the out folder. Use "source_relative' to generate a separate '[inputfile].openapi.yaml' next to each '[inputfile].proto'.`),
}

opts := protogen.Options{
Expand All @@ -47,7 +47,7 @@ func main() {
opts.Run(func(plugin *protogen.Plugin) error {
// Enable "optional" keyword in front of type (e.g. optional string label = 1;)
plugin.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
if *conf.OutFiles == "source_relative" {
if *conf.OutputMode == "source_relative" {
for _, file := range plugin.Files {
if !file.Generate {
continue
Expand Down

0 comments on commit 395e74b

Please sign in to comment.