Last 12 weeks · 18 commits
5 of 6 standards met
Description This PR resolves the issue where was not supported as a direct field, query/request parameter, or getter/setter in the Java Business SDK. We have added full support for across the SDK in the same locations where is supported, allowing developers to target and manage placements on the Threads platform directly instead of relying on setting it as a miscellaneous/custom field. Key Changes SDK Models : Added field and member variable . Added and . Added to array in , , and . Added methods to , , and . : Added field and member variable . Added and . Added to array in . Added methods to . Assigned in the copy-constructor method. : Added field and member variable . Added and . Assigned in the copy-constructor method. : Added to array and added methods to . API & Endpoint Requests : Added to array and added methods in: Added to array and added to . : Added to array and added methods to . : Added to array and added methods to and . : Added to array and added methods to . Verification Done Verified that all 1,041 Java files compile successfully with after the additions. Resolves #497
Description This PR resolves the issue where integer values inside dynamic or untyped fields (such as containing ) were parsed by Gson as (e.g. ). When these models were serialized back to JSON for request parameters, the decimal suffix was preserved (e.g., sending instead of ), causing the Meta Graph/Ads API to reject the requests. We resolve this by setting Gson's strategy on all Gson instances. This ensures integers in untyped maps and lists are parsed as (retaining their integer representation upon serialization) while actual floating point numbers are parsed as . Changes 1. Updated APIRequest Parameter Serialization Modified in to set on the inline instances. This prevents integers inside raw Map/List parameter lists from receiving a decimal suffix. 2. SDK-wide Model GSON Updates (982 files) Since the SDK's model classes define their own decentralized static helper methods, we updated all 982 model classes' builders to use the same strategy. This comprehensively prevents the bug from occurring on any other dynamic field. 3. Added Regression Unit Test Added to verify that correctly deserializes and serializes untyped settings containing integers without decimal conversion. Verification & Test Results Test Execution We compiled the modified classes and ran the newly introduced verification suite: Output The output confirms that the integer value is successfully parsed as and serialized correctly as instead of .
Repository: facebook/facebook-java-business-sdk. Description: Java SDK for Meta Marketing APIs Stars: 463, Forks: 339. Primary language: Java. Languages: Java (100%), Kotlin (0%), Shell (0%). Homepage: https://developers.facebook.com/docs/business-sdk Latest release: v26.0.0 (2w ago). Open PRs: 23, open issues: 54. Last activity: 2w ago. Community health: 75%. Top contributors: jingping2015, JiamingFB, satwikareddy3, stcheng, marksliva, HeyMultiverse, vicdus, dependabot[bot], donglinw-fb, kongxinzhu and others.