Skip to content
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

fix: Salesforce consumer goods cloud schema helper picklist type #54

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading