Skip to content

Conversation

@cchenggit
Copy link
Collaborator

@cchenggit cchenggit commented Sep 15, 2025

issue #227

@cchenggit cchenggit marked this pull request as draft September 15, 2025 13:44
@cchenggit cchenggit force-pushed the feat/plugin-jsonschema-validator branch from e24260e to e613d87 Compare September 15, 2025 13:54
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 85.34483% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
plugins/jsonschema_validator/plugin.go 81.48% 9 Missing and 6 partials ⚠️
...gins/jsonschema_validator/jsonschema/jsonschema.go 87.50% 1 Missing and 1 partial ⚠️
Flag Coverage Δ
integration 79.00% <85.34%> (+0.27%) ⬆️
unit 13.33% <14.65%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
plugins/plugins.go 100.00% <100.00%> (ø)
proxy/gateway.go 77.90% <ø> (ø)
utils/hash.go 100.00% <100.00%> (ø)
utils/validate.go 85.52% <100.00%> (+3.26%) ⬆️
...gins/jsonschema_validator/jsonschema/jsonschema.go 87.50% <87.50%> (ø)
plugins/jsonschema_validator/plugin.go 81.48% <81.48%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cchenggit cchenggit force-pushed the feat/plugin-jsonschema-validator branch from d4f58ec to 6166e8d Compare September 21, 2025 11:48
@cchenggit cchenggit marked this pull request as ready for review September 21, 2025 12:02
@cchenggit cchenggit requested a review from vm-001 September 21, 2025 12:02
Copy link
Collaborator

@vm-001 vm-001 left a comment

Choose a reason for hiding this comment

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

  • default_schema: to be used when event_type is not defined in the schemas
  • version: define the jsonschema dialect version

"time"
)

type Config struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Requires a version field. (enum: draft4/draft6/draft7/etc..)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

current jsonschema only support openapi3 schema, which based on the draft6

Copy link
Collaborator

@vm-001 vm-001 Oct 20, 2025

Choose a reason for hiding this comment

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

why not use string? (draft4, draft6, draft202012)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let's use string value but simplify the version number
draft: 4/6/7/2019-09/2020-12

@vm-001
Copy link
Collaborator

vm-001 commented Sep 22, 2025

I think we can design a feature to support loading values from external system(including file, env, and network), this would be a different topic. Let's remove the part of loading schema from the file and network to keep the plugin as simple as possible.

@cchenggit
Copy link
Collaborator Author

cchenggit commented Sep 22, 2025

I think we can design a feature to support loading values from external system(including file, env, and network), this would be a different topic. Let's remove the part of loading schema from the file and network to keep the plugin as simple as possible.

good idea, this should the common requirement of plugin

@vm-001
Copy link
Collaborator

vm-001 commented Sep 23, 2025

Please update the README.md to mention this cool plugin.

@cchenggit cchenggit force-pushed the feat/plugin-jsonschema-validator branch 5 times, most recently from 1129fe1 to a72086b Compare October 19, 2025 16:13
@cchenggit cchenggit requested a review from vm-001 October 19, 2025 16:16
resp, err := adminClient.R().
SetBody(string(yaml)).
Post("/workspaces/default/config/sync")
fmt.Print(string(resp.Body()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
fmt.Print(string(resp.Body()))

@vm-001
Copy link
Collaborator

vm-001 commented Oct 20, 2025

Don't forget the plugin documentation (see https://docs.webhookx.io/docs/plugin/function/).

It would be great if we had a blog post introducing this awesome plugin!

@cchenggit cchenggit force-pushed the feat/plugin-jsonschema-validator branch from fd73160 to b5a616b Compare October 21, 2025 14:33
@cchenggit cchenggit requested a review from vm-001 October 21, 2025 16:30
@cchenggit cchenggit force-pushed the feat/plugin-jsonschema-validator branch from ba635b2 to 442afd0 Compare October 30, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants