We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af4a202 commit 1c97ff2Copy full SHA for 1c97ff2
internal/codegen/golang/opts/options.go
@@ -1,7 +1,6 @@
1
package opts
2
3
import (
4
- "bytes"
5
"encoding/json"
6
"fmt"
7
@@ -47,9 +46,7 @@ type Options struct {
47
46
48
func ParseOpts(req *plugin.CodeGenRequest) (*Options, error) {
49
var options *Options
50
- dec := json.NewDecoder(bytes.NewReader(req.PluginOptions))
51
- dec.DisallowUnknownFields()
52
- if err := dec.Decode(&options); err != nil {
+ if err := json.Unmarshal(req.PluginOptions, &options); err != nil {
53
return options, fmt.Errorf("unmarshalling options: %w", err)
54
}
55
0 commit comments