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

Using expand produces incorrect deserialization #31

Open
stuarth opened this issue Feb 3, 2022 · 1 comment
Open

Using expand produces incorrect deserialization #31

stuarth opened this issue Feb 3, 2022 · 1 comment

Comments

@stuarth
Copy link

stuarth commented Feb 3, 2022

For instance, a query for Employments that includes expand: 'employee' will produce a result like (note: sample data!) because the type of employee goes from a string in normal usage to an object

{"id"=>"d58b163d-c780-47d9-b298-491adc416acc",
  "remote_id"=>nil,
  "employee"=>
   "{:id=>\"732acd07-8906-4649-85bc-5817d6654984\", :remote_id=>\"6FDGJ0000K0\", :employee_number=>\"001002093\", :company=>\"6c301b2c-0ed3-4521-9aa2-711c0fedff83\", :first_name=>\"Y\", :last_name=>\"X\", :display_full_name=>\"Ken Aarons\", :work_email=>\"[email protected]\", :personal_email=>nil, :mobile_phone_number=>\"+13368745233\", :employments=>[\"fe6fb406-abca-4f88-9374-bf02ad39c801\", \"f26364ed-3169-415a-b60f-e9ceb07a45c1\", \"f21a6e53-1926-4e1a-82f6-6ce2c36323c9\", \"ee98103a-6305-4f57-a1a2-fcd7e4391234\", \"d58b163d-c780-47d9-b298-491adc416acc\", \"aa8debff-4df9-4ec2-935d-0ffe24fa6369\", \"a5a5e528-e35d-4f54-a325-20e8ed2d8d48\", \"9e814840-7504-40a3-93a0-d03835ac6fc2\", \"8a290e96-0c6e-4496-8050-6a8063bc1a9a\", \"85a8d870-982a-4e3a-941c-7144efb4694b\", \"75567807-7ff1-4bbe-a0f1-c7a05a0cbb0a\", \"6f56fe26-8cb7-4a1d-a89b-4f344cd67f76\", \"5d1fc990-bfb7-43d5-b292-96b8f2e8b6a9\", \"3742ed31-92c2-499d-8066-460796eeadb6\", \"1b980ca9-cfc4-431c-9d1b-d4a1499eaff0\", \"09f1b346-2b6a-4e4e-8456-0ccaf19acc8c\"], :home_location=>\"eeb8b147-6d44-415e-bded-b6db80b098c5\", :work_location=>\"ff2b9754-2a75-46e0-ac18-9099f7c72226\", :manager=>\"7fc4ea9a-2532-4e45-b69f-0d887205c0f4\", :team=>\"f1c4c9e6-038e-47e4-b5fc-d8435b230aeb\", :pay_group=>\"ac362b36-5cac-4d1b-ba07-b7783d956d52\", :ssn=>nil, :gender=>\"MALE\", :ethnicity=>\"PREFER_NOT_TO_DISCLOSE\", :marital_status=>\"SINGLE\", :date_of_birth=>\"1982-01-27T00:00:00Z\", :hire_date=>\"2015-08-17T00:00:00Z\", :start_date=>\"2012-08-17T00:00:00Z\", :employment_status=>\"ACTIVE\", :termination_date=>nil, :avatar=>nil, :remote_data=>nil, :custom_fields=>{}}",
  "job_title"=>"Human Resource Admin",
  "pay_rate"=>280.88085,
  "pay_period"=>"EVERY_TWO_WEEKS",
  "pay_frequency"=>nil,
  "pay_currency"=>nil,
  "flsa_status"=>"F",
  "effective_date"=>"2022-01-01T00:00:00.000Z",
  "employment_type"=>"FULL_TIME",
  "remote_data"=>nil},

Note that employee is a string representation of a Ruby object. The issue is in _deserialize where the type of the employee field is a string. This leads to the hash being converted into a string.

@stuarth stuarth changed the title Using expand produces incorrect deserialization Using expand produces incorrect deserialization Feb 3, 2022
@stuarth stuarth changed the title Using expand produces incorrect deserialization Using expand produces incorrect deserialization Feb 3, 2022
@dan-merge
Copy link
Collaborator

Just pushed gem version 1.0.4 which should fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants