Skip to content

Commit 1c97ff2

Browse files
committed
relax json unmarshal constraints in golang codegen
1 parent af4a202 commit 1c97ff2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/codegen/golang/opts/options.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package opts
22

33
import (
4-
"bytes"
54
"encoding/json"
65
"fmt"
76

@@ -47,9 +46,7 @@ type Options struct {
4746

4847
func ParseOpts(req *plugin.CodeGenRequest) (*Options, error) {
4948
var options *Options
50-
dec := json.NewDecoder(bytes.NewReader(req.PluginOptions))
51-
dec.DisallowUnknownFields()
52-
if err := dec.Decode(&options); err != nil {
49+
if err := json.Unmarshal(req.PluginOptions, &options); err != nil {
5350
return options, fmt.Errorf("unmarshalling options: %w", err)
5451
}
5552

0 commit comments

Comments
 (0)