facebook / facebook-business-sdk-codegen

Codegen project for our business SDKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creation of AdSet suffers from breaking changes

kirsar opened this issue · comments

Checklist

Environment

  • Node Version: 16.15.0
  • NPM Version: 8.5.5

Goals

Be able to use strongly-typed programming without type casting when creating API resources, as it was possible before v13

Expected Results

I expect existing code using facebook-java-business-sdk which creates AdSet in particular to compile without errors
There are no breaking changes introduced in v13 changelog related to AdSet creation
https://developers.facebook.com/docs/graph-api/changelog/version13.0

Actual Results

Compilation error due to:

before commit

public static class APIRequestCreateAdSet extends APIRequest<AdSet>

after

public static class APIRequestCreateAdSet extends APIRequest<APINode>

before commit

public APIRequestCreateAdSet setBillingEvent (AdSet.EnumBillingEvent billingEvent)

after

public APIRequestCreateAdSet setBillingEvent (EnumBillingEvent billingEvent)

image

There are more enums which suffered from additional enum definition copies added
There are more entities which lost strongly-typed api
One can observe the same in node.js sdk returning Promise<AbstractObject>

Steps to Reproduce

Try to compile examples

Steps to Fix

Restore return type back to "AdSet" in spec

Restore "node" property on "adaccountadsets_billing_event_enum_param" back to "AdSet" in spec

I'd be happy to create PR, but commit tells the spec was "Automitically generate from our internal API framework." which I don't have access to.

I can confirm java sdk is fully compilable after mentioned changes

I might be missing something, since I just joined a java project and learning java for 5 days and fb business api for 1.5 days, but it'd be so nice to leave the code as is without typecasting.

Seeing the same issue. v12 gets deprecated around Aug 9th, so we'll have to roll out fix or do type casting 😮‍💨