diff --git a/pkg/plugin/processor/builtin/impl/avro/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/avro/z_examples_exporter_test.go index 666eda3ad..b818f9f0a 100644 --- a/pkg/plugin/processor/builtin/impl/avro/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/avro/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package avro @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/avro/z_examples_test.go b/pkg/plugin/processor/builtin/impl/avro/z_examples_test.go deleted file mode 100644 index f1e88c24e..000000000 --- a/pkg/plugin/processor/builtin/impl/avro/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package avro diff --git a/pkg/plugin/processor/builtin/impl/base64/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/base64/z_examples_exporter_test.go index 7d1b76e71..bc1db73c3 100644 --- a/pkg/plugin/processor/builtin/impl/base64/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/base64/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package base64 @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/base64/z_examples_test.go b/pkg/plugin/processor/builtin/impl/base64/z_examples_test.go deleted file mode 100644 index 60ba59aaa..000000000 --- a/pkg/plugin/processor/builtin/impl/base64/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package base64 diff --git a/pkg/plugin/processor/builtin/impl/custom/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/custom/z_examples_exporter_test.go index 13f0cc783..a8b42f236 100644 --- a/pkg/plugin/processor/builtin/impl/custom/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/custom/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package custom @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/custom/z_examples_test.go b/pkg/plugin/processor/builtin/impl/custom/z_examples_test.go deleted file mode 100644 index 356cc39d2..000000000 --- a/pkg/plugin/processor/builtin/impl/custom/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package custom diff --git a/pkg/plugin/processor/builtin/impl/error.go b/pkg/plugin/processor/builtin/impl/error.go index be3f49b5b..c6567c63f 100644 --- a/pkg/plugin/processor/builtin/impl/error.go +++ b/pkg/plugin/processor/builtin/impl/error.go @@ -23,6 +23,7 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/conduitio/conduit-commons/config" + "github.com/conduitio/conduit-commons/lang" "github.com/conduitio/conduit-commons/opencdc" sdk "github.com/conduitio/conduit-processor-sdk" "github.com/conduitio/conduit/pkg/foundation/cerrors" @@ -100,3 +101,17 @@ func (p *errorProcessor) errorMessage(record opencdc.Record) string { } return buf.String() } + +func (*errorProcessor) MiddlewareOptions() []sdk.ProcessorMiddlewareOption { + // disable schema middleware by default + return []sdk.ProcessorMiddlewareOption{ + sdk.ProcessorWithSchemaEncodeConfig{ + PayloadEnabled: lang.Ptr(false), + KeyEnabled: lang.Ptr(false), + }, + sdk.ProcessorWithSchemaDecodeConfig{ + PayloadEnabled: lang.Ptr(false), + KeyEnabled: lang.Ptr(false), + }, + } +} diff --git a/pkg/plugin/processor/builtin/impl/field/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/field/z_examples_exporter_test.go index fd2e894f5..1e2abed78 100644 --- a/pkg/plugin/processor/builtin/impl/field/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/field/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package field @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/field/z_examples_test.go b/pkg/plugin/processor/builtin/impl/field/z_examples_test.go deleted file mode 100644 index 98a932a63..000000000 --- a/pkg/plugin/processor/builtin/impl/field/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package field diff --git a/pkg/plugin/processor/builtin/impl/filter.go b/pkg/plugin/processor/builtin/impl/filter.go index a8c963cb3..f9b2a3a7d 100644 --- a/pkg/plugin/processor/builtin/impl/filter.go +++ b/pkg/plugin/processor/builtin/impl/filter.go @@ -18,6 +18,7 @@ import ( "context" "github.com/conduitio/conduit-commons/config" + "github.com/conduitio/conduit-commons/lang" "github.com/conduitio/conduit-commons/opencdc" sdk "github.com/conduitio/conduit-processor-sdk" "github.com/conduitio/conduit/pkg/foundation/log" @@ -54,3 +55,17 @@ func (p *filterProcessor) Process(_ context.Context, records []opencdc.Record) [ } return out } + +func (*filterProcessor) MiddlewareOptions() []sdk.ProcessorMiddlewareOption { + // disable schema middleware by default + return []sdk.ProcessorMiddlewareOption{ + sdk.ProcessorWithSchemaEncodeConfig{ + PayloadEnabled: lang.Ptr(false), + KeyEnabled: lang.Ptr(false), + }, + sdk.ProcessorWithSchemaDecodeConfig{ + PayloadEnabled: lang.Ptr(false), + KeyEnabled: lang.Ptr(false), + }, + } +} diff --git a/pkg/plugin/processor/builtin/impl/json/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/json/z_examples_exporter_test.go index 5675c505c..26d4c9a90 100644 --- a/pkg/plugin/processor/builtin/impl/json/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/json/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package json @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/json/z_examples_test.go b/pkg/plugin/processor/builtin/impl/json/z_examples_test.go deleted file mode 100644 index 1a5c8100b..000000000 --- a/pkg/plugin/processor/builtin/impl/json/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package json diff --git a/pkg/plugin/processor/builtin/impl/unwrap/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/unwrap/z_examples_exporter_test.go index 2342eb469..0950dcedb 100644 --- a/pkg/plugin/processor/builtin/impl/unwrap/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/unwrap/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package unwrap @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/unwrap/z_examples_test.go b/pkg/plugin/processor/builtin/impl/unwrap/z_examples_test.go deleted file mode 100644 index 2e54c6c06..000000000 --- a/pkg/plugin/processor/builtin/impl/unwrap/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package unwrap diff --git a/pkg/plugin/processor/builtin/impl/webhook/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/webhook/z_examples_exporter_test.go index 151f308e5..81ce3d38b 100644 --- a/pkg/plugin/processor/builtin/impl/webhook/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/webhook/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package webhook @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/webhook/z_examples_test.go b/pkg/plugin/processor/builtin/impl/webhook/z_examples_test.go deleted file mode 100644 index b55916996..000000000 --- a/pkg/plugin/processor/builtin/impl/webhook/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package webhook diff --git a/pkg/plugin/processor/builtin/impl/z_examples_exporter_test.go b/pkg/plugin/processor/builtin/impl/z_examples_exporter_test.go index 20eacdfa5..2293832c2 100644 --- a/pkg/plugin/processor/builtin/impl/z_examples_exporter_test.go +++ b/pkg/plugin/processor/builtin/impl/z_examples_exporter_test.go @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build export_processors +// This file is here to export processor specifications. It's named with a "z_" +// prefix to ensure it's processed last by go generate. + +//go:generate env EXPORT_PROCESSORS=true go test -count=1 -tags export_processors . package impl @@ -29,6 +32,8 @@ func TestMain(m *testing.M) { os.Exit(code) } - // tests passed, export the processors - exampleutil.ExportProcessors() + if os.Getenv("EXPORT_PROCESSORS") == "true" { + // tests passed and env var is included, export the processors + exampleutil.ExportProcessors() + } } diff --git a/pkg/plugin/processor/builtin/impl/z_examples_test.go b/pkg/plugin/processor/builtin/impl/z_examples_test.go deleted file mode 100644 index 6702f3b4c..000000000 --- a/pkg/plugin/processor/builtin/impl/z_examples_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2024 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file is here only to contain the go:generate statement. It's named with -// a "z_" prefix to ensure it's processed last by go generate. - -//go:generate go test -count=1 -tags export_processors . - -package impl diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/example.go b/pkg/plugin/processor/builtin/internal/exampleutil/example.go index b47477c23..ee4b21427 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/example.go +++ b/pkg/plugin/processor/builtin/internal/exampleutil/example.go @@ -54,6 +54,9 @@ type Example struct { // stores the processor specification and example in a global map so it can be // used to generate documentation. func RunExample(p sdk.Processor, e Example) { + // apply default middleware + p = sdk.ProcessorWithMiddleware(p, sdk.DefaultProcessorMiddleware(p.MiddlewareOptions()...)...) + spec, err := p.Specification() if err != nil { log.Fatalf("failed to fetch specification: %v", err) diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.decode.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.decode.json index 3af5a8533..4814953b5 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.decode.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.decode.json @@ -11,6 +11,30 @@ "description": "The field that will be decoded.\n\nFor more information about the format, see [Referencing fields](https://conduit.io/docs/processors/referencing-fields).", "type": "string", "validations": [] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.encode.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.encode.json index 61d851008..67833de4f 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.encode.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/avro.encode.json @@ -49,6 +49,30 @@ "value": "preRegistered,autoRegister" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.decode.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.decode.json index eeaee6e5b..b6e478c71 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.decode.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.decode.json @@ -20,6 +20,30 @@ "value": ".Position" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.encode.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.encode.json index e08a4726b..c525278a2 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.encode.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/base64.encode.json @@ -20,6 +20,30 @@ "value": ".Position" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/custom.javascript.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/custom.javascript.json index 099a141ed..a5ce7ed01 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/custom.javascript.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/custom.javascript.json @@ -17,6 +17,30 @@ "description": "The path to a .js file containing the processor code.", "type": "string", "validations": [] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/error.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/error.json index 179095137..958baf2b7 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/error.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/error.json @@ -11,6 +11,30 @@ "description": "Error message to be returned. This can be a Go [template](https://pkg.go.dev/text/template)\nexecuted on each [`Record`](https://pkg.go.dev/github.com/conduitio/conduit-commons/opencdc#Record)\nbeing processed.", "type": "string", "validations": [] + }, + "sdk.schema.decode.key.enabled": { + "default": "false", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "false", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "false", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "false", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.convert.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.convert.json index 7f28d60f3..be337276f 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.convert.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.convert.json @@ -21,6 +21,30 @@ } ] }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null + }, "type": { "default": "", "description": "Type is the target field type after conversion, available options are: `string`, `int`, `float`, `bool`, `time`.", diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.exclude.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.exclude.json index 1fdb6504c..85a8574af 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.exclude.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.exclude.json @@ -16,6 +16,30 @@ "value": "" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.rename.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.rename.json index de70b1467..a2fddc04e 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.rename.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.rename.json @@ -16,6 +16,30 @@ "value": "" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.set.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.set.json index 53f3e0670..db473ad60 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.set.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/field.set.json @@ -21,6 +21,30 @@ } ] }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null + }, "value": { "default": "", "description": "Value is a Go template expression which will be evaluated and stored in `field` (e.g. `{{ .Payload.After }}`).", diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/filter.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/filter.json index f3db98b12..abaf85a91 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/filter.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/filter.json @@ -5,7 +5,32 @@ "description": "Acknowledges all records that get passed to the filter, so\nthe records will be filtered out if the condition provided to the processor is\nevaluated to `true`.\n\n**Important:** Make sure to add a [condition](https://conduit.io/docs/processors/conditions)\nto this processor, otherwise all records will be filtered out.", "version": "v0.1.0", "author": "Meroxa, Inc.", - "parameters": {} + "parameters": { + "sdk.schema.decode.key.enabled": { + "default": "false", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "false", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "false", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "false", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null + } + } }, "examples": [ { diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.decode.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.decode.json index 995e2db44..000fcd889 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.decode.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.decode.json @@ -24,6 +24,30 @@ "value": ".Payload" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.encode.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.encode.json index 5ec4a94d9..2fb47fde6 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.encode.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/json.encode.json @@ -24,6 +24,30 @@ "value": ".Payload" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.debezium.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.debezium.json index 85da2cbd5..71d2d3a9a 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.debezium.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.debezium.json @@ -16,6 +16,30 @@ "value": "^.Payload" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.kafkaconnect.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.kafkaconnect.json index 5dbc09ef9..e7a05b31f 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.kafkaconnect.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.kafkaconnect.json @@ -16,6 +16,30 @@ "value": "^.Payload" } ] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.opencdc.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.opencdc.json index d9c39d9f9..1463b34de 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.opencdc.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/unwrap.opencdc.json @@ -11,6 +11,30 @@ "description": "Field is a reference to the field that contains the OpenCDC record.\n\nFor more information about the format, see [Referencing fields](https://conduit.io/docs/processors/referencing-fields).", "type": "string", "validations": [] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } }, diff --git a/pkg/plugin/processor/builtin/internal/exampleutil/specs/webhook.http.json b/pkg/plugin/processor/builtin/internal/exampleutil/specs/webhook.http.json index 0bcf6702e..3ea602b40 100644 --- a/pkg/plugin/processor/builtin/internal/exampleutil/specs/webhook.http.json +++ b/pkg/plugin/processor/builtin/internal/exampleutil/specs/webhook.http.json @@ -86,6 +86,30 @@ "description": "Specifies in which field should the response status be saved. If no value\nis set, then the response status will NOT be saved.\n\nFor more information about the format, see [Referencing fields](https://conduit.io/docs/processors/referencing-fields).", "type": "string", "validations": [] + }, + "sdk.schema.decode.key.enabled": { + "default": "true", + "description": "Whether to decode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.decode.payload.enabled": { + "default": "true", + "description": "Whether to decode the record payload with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.key.enabled": { + "default": "true", + "description": "Whether to encode the record key with a schema.", + "type": "bool", + "validations": null + }, + "sdk.schema.encode.payload.enabled": { + "default": "true", + "description": "Whether to encode the record payload with a schema.", + "type": "bool", + "validations": null } } },