Skip to content

Commit

Permalink
fix: Enable format assertion for JSON schema (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
candiduslynx authored Sep 20, 2023
1 parent 7a6206c commit b53c5ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func NewPlugin(name string, version string, newClient NewClientFunc, options ...
if p.schema != "" {
c := jsonschema.NewCompiler()
c.Draft = jsonschema.Draft2020
c.AssertFormat = true
if err := c.AddResource("schema.json", strings.NewReader(p.schema)); err != nil {
panic(fmt.Errorf("failed add plugin JSONSchema: %w", err))
}
Expand Down

2 comments on commit b53c5ab

@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: 106.3

@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: 106.3

Please sign in to comment.