Skip to content

Commit

Permalink
disable schema extraction (#154)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillem <guillemus@proton.me>
Co-authored-by: Lovro Mažgon <lovro.mazgon@gmail.com>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent b9a64a4 commit 28a2196
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
9 changes: 6 additions & 3 deletions destination/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ type Destination struct {
}

func NewDestination() sdk.Destination {
return sdk.DestinationWithMiddleware(&Destination{
httpClient: &http.Client{},
}, sdk.DefaultDestinationMiddleware()...)
return sdk.DestinationWithMiddleware(
&Destination{
httpClient: &http.Client{},
},
sdk.DefaultDestinationMiddleware()...,
)
}

func (d *Destination) Parameters() config.Parameters {
Expand Down
16 changes: 13 additions & 3 deletions source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
"github.com/conduitio-labs/conduit-connector-sqs/common"
"github.com/conduitio/conduit-commons/config"
"github.com/conduitio/conduit-commons/lang"
"github.com/conduitio/conduit-commons/opencdc"
sdk "github.com/conduitio/conduit-connector-sdk"
)
Expand All @@ -39,9 +40,18 @@ type Source struct {
}

func NewSource() sdk.Source {
return sdk.SourceWithMiddleware(&Source{
httpClient: &http.Client{},
}, sdk.DefaultSourceMiddleware()...)
return sdk.SourceWithMiddleware(
&Source{
httpClient: &http.Client{},
},
sdk.DefaultSourceMiddleware(
// disable schema extraction by default, because the source produces raw data
sdk.SourceWithSchemaExtractionConfig{
PayloadEnabled: lang.Ptr(false),
KeyEnabled: lang.Ptr(false),
},
)...,
)
}

func (s *Source) Parameters() config.Parameters {
Expand Down

0 comments on commit 28a2196

Please sign in to comment.