From 59aef16ebe7553faba0dc87b3d81b567acbe77b4 Mon Sep 17 00:00:00 2001 From: Alex Shcherbakov Date: Wed, 20 Sep 2023 13:49:25 +0300 Subject: [PATCH] fix: Validate spec only when connection is established (#1223) Documentation generation will fail otherwise. Follow-up for #1214 --- plugin/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/plugin.go b/plugin/plugin.go index 20427bfff5..220d30c6d8 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -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)