Skip to content

Fix map fieldtype issue#33

Open
minsikzzang wants to merge 4 commits into
facebook:mainfrom
minsikzzang:fix-decode-map-string-int
Open

Fix map fieldtype issue#33
minsikzzang wants to merge 4 commits into
facebook:mainfrom
minsikzzang:fix-decode-map-string-int

Conversation

@minsikzzang

@minsikzzang minsikzzang commented Nov 22, 2017

Copy link
Copy Markdown
module FacebookAds
  module FieldTypes
    class Object < Base
...  
      def deserialize(value, session = nil)
        value.is_a?(String) ? JSON.parse(value) : value
      end		    
...

API response is JSON format data, and it's already decoded in APIResponse class, so value in deserialize method always should be hash format (decoded JSON object / hash). Somehow If it receives string value from API server, still needs to be parsed.

@minsikzzang

Copy link
Copy Markdown
Author

@alanho please let me know if you have any comment / feedback,
Thanks

@minsikzzang

Copy link
Copy Markdown
Author

any feedback or plan for merge @alanho ?

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanho has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@antonkey

Copy link
Copy Markdown

+1. I applied the patch in my project and waiting for this PR to be merged

@yokuba

yokuba commented Feb 9, 2018

Copy link
Copy Markdown

+1. Patch worked for me.

@nicolascochin

Copy link
Copy Markdown

+1 Also worked for me

@Micka33

Micka33 commented Feb 19, 2018

Copy link
Copy Markdown

+1 also worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants