Skip to content

Commit

Permalink
fix: Salesforce consumer goods cloud schema helper picklist type
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik-sivadas committed Apr 16, 2024
1 parent 7885597 commit e6700c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion integrations/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GIT
PATH
remote: .
specs:
multiwoven-integrations (0.1.60)
multiwoven-integrations (0.1.61)
activesupport
async-websocket
csv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def salesforce_field_to_json_schema_type(sf_field) # rubocop:disable Metrics/Abc
when "picklist", "multipicklist", "Picklist (Multi-select)"
if sf_field[:picklistValues] && sf_field["nillable"]
enum_values = sf_field[:picklistValues].map { |val| val["value"] }
{ "type": %w[array null], "items": { "type": "string" }, "enum": enum_values }
{ "type": %w[string null], "items": { "type": "string" }, "enum": enum_values }
elsif sf_field[:picklistValues]
enum_values = sf_field[:picklistValues].map { |val| val["value"] }
{ "type": "array", "items": { "type": "string" }, "enum": enum_values }
{ "type": "string", "items": { "type": "string" }, "enum": enum_values }
else
{ "type": "array", "items": { "type": "string" } }
{ "type": "string", "items": { "type": "string" } }
end
when "reference", "Reference (Lookup & Master-Detail)"
if sf_field["nillable"]
Expand Down
2 changes: 1 addition & 1 deletion integrations/lib/multiwoven/integrations/rollout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Multiwoven
module Integrations
VERSION = "0.1.60"
VERSION = "0.1.61"

ENABLED_SOURCES = %w[
Snowflake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def salesforce_field_to_json_schema_type(sf_field) # rubocop:disable Metrics/Abc
when "picklist", "multipicklist", "Picklist (Multi-select)"
if sf_field[:picklistValues] && sf_field["nillable"]
enum_values = sf_field[:picklistValues].map { |val| val["value"] }
{ "type": %w[array null], "items": { "type": "string" }, "enum": enum_values }
{ "type": %w[string null], "items": { "type": "string" }, "enum": enum_values }
elsif sf_field[:picklistValues]
enum_values = sf_field[:picklistValues].map { |val| val["value"] }
{ "type": "array", "items": { "type": "string" }, "enum": enum_values }
{ "type": "string", "items": { "type": "string" }, "enum": enum_values }
else
{ "type": "array", "items": { "type": "string" } }
{ "type": "string", "items": { "type": "string" } }
end
when "reference", "Reference (Lookup & Master-Detail)"
if sf_field["nillable"]
Expand Down

0 comments on commit e6700c0

Please sign in to comment.