Skip to content

Commit 4228410

Browse files
Add supports
1 parent d7a7218 commit 4228410

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

internal/generator/generator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88

99
"github.com/getkin/kin-openapi/openapi3"
1010
"github.com/stretchr/objx"
11-
oapiv1 "github.com/technicallyjosh/protoc-gen-openapi/api/oapi/v1"
12-
"github.com/technicallyjosh/protoc-gen-openapi/internal/generator/util"
1311
"google.golang.org/protobuf/compiler/protogen"
1412
"google.golang.org/protobuf/proto"
1513
"gopkg.in/yaml.v3"
14+
15+
oapiv1 "github.com/technicallyjosh/protoc-gen-openapi/api/oapi/v1"
16+
"github.com/technicallyjosh/protoc-gen-openapi/internal/generator/util"
1617
)
1718

1819
// Config holds the configuration for the generator.

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ package main
33
import (
44
"flag"
55

6-
"github.com/technicallyjosh/protoc-gen-openapi/internal/generator"
76
"google.golang.org/protobuf/compiler/protogen"
7+
"google.golang.org/protobuf/types/pluginpb"
8+
9+
"github.com/technicallyjosh/protoc-gen-openapi/internal/generator"
810
)
911

1012
func main() {
@@ -29,6 +31,7 @@ func main() {
2931
}
3032

3133
opts.Run(func(plugin *protogen.Plugin) error {
34+
plugin.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) | uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS)
3235
return generator.New(plugin, conf).Run()
3336
})
3437
}

0 commit comments

Comments
 (0)