Skip to content

Commit

Permalink
fix: Validate spec only when connection is established (#1223)
Browse files Browse the repository at this point in the history
Documentation generation will fail otherwise.
Follow-up for #1214
  • Loading branch information
candiduslynx authored Sep 20, 2023
1 parent 2725ed5 commit 59aef16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (p *Plugin) Init(ctx context.Context, spec []byte, options NewClientOptions
defer p.mu.Unlock()
var err error

if p.schemaValidator != nil {
if !options.NoConnection && p.schemaValidator != nil {
var v any
if err := json.Unmarshal(spec, &v); err != nil {
return fmt.Errorf("failed to unmarshal plugin spec: %w", err)
Expand Down

1 comment on commit 59aef16

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏱️ Benchmark results

  • Glob-8 ns/op: 99.57

Please sign in to comment.