From a8640bcb479d92fac182cc0a19162df5de591253 Mon Sep 17 00:00:00 2001 From: Kevin McDonald Date: Wed, 4 Sep 2024 19:57:11 +0200 Subject: [PATCH] declare editions support range --- internal/converter/converter.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/converter/converter.go b/internal/converter/converter.go index 8fbc389..1eba99a 100644 --- a/internal/converter/converter.go +++ b/internal/converter/converter.go @@ -10,6 +10,7 @@ import ( "path/filepath" "strings" + "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/lmittmann/tint" "github.com/pb33f/libopenapi" base "github.com/pb33f/libopenapi/datamodel/high/base" @@ -225,10 +226,12 @@ func Convert(req *pluginpb.CodeGeneratorRequest) (*pluginpb.CodeGeneratorRespons }) } - features := uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) + features := uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL | pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS) return &pluginpb.CodeGeneratorResponse{ - File: files, SupportedFeatures: &features, + MinimumEdition: proto.Int32(int32(descriptor.Edition_EDITION_PROTO2)), + MaximumEdition: proto.Int32(int32(descriptor.Edition_EDITION_2024)), + File: files, }, nil }