-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TT-13365] Create json schema script for Bento config validation #6690
base: master
Are you sure you want to change the base?
[TT-13365] Create json schema script for Bento config validation #6690
Conversation
💔 The detected issue is not in one of the allowed statuses 💔
Please ensure your jira story is in one of the allowed statuses |
…r-Bento-config-validation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
API Changes --- prev.txt 2024-11-05 12:21:25.142776900 +0000
+++ current.txt 2024-11-05 12:21:18.662744120 +0000
@@ -5519,6 +5519,9 @@
type ValidatorKind string
+# Package: ./apidef/streams/bento/schema
+
+
# Package: ./certs
package certs // import "github.com/TykTechnologies/tyk/certs" |
💔 The detected issue is not in one of the allowed statuses 💔
Please ensure your jira story is in one of the allowed statuses |
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
User description
PR for https://tyktech.atlassian.net/browse/TT-13365
generate_bento_config_schema.go
generates a JSON schema for the Input/Output resources we support.Simply,
It'll generate a
bento-config-schema.json
file in the current working folder. You can also set an output path via-output-path <string>
parameter.How to add a new Input/Output resource
1- Import the related component for its side effects, for example if you want to produce a JSON schema that supports redis component, you can import it like the following:
2- Add its name to
supportedItems
slice. You should know that some components exposes different input/output sources For example, components/kafka exposeskafka
andkafka_franz
. You need to dig into the Bento's codebase to understand which input/output is exposed by a component.Importing a small number of components was preferred instead of importing
components/all
because importing all components results in a hugedefinitions/processor
object and there is no way to know which processor are used by the components we support.This tool assumes that we support the exact same components in both input and output sections.
PR Type
enhancement
Description
generate_bento_config_schema.go
to generate a JSON schema for Bento configuration validation.supportedItems
slice.bento-config-schema.json
file, with an option to specify a custom output path.Changes walkthrough 📝
generate_bento_config_schema.go
Add Go script for generating Bento config JSON schema
apidef/streams/bento/schema/generate_bento_config_schema.go
validation.