facebook / facebook-business-sdk-codegen

Codegen project for our business SDKs
https://developers.facebook.com/docs/business-sdk
Other
87 stars 56 forks source link

targeting_optimization_types has wrong type #47

Open kromash opened 2 years ago

kromash commented 2 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

What do you want to achieve?

Get correct type for targeting_optimization_types

Expected Results

What do you expect to happen?

According to documentation, targeting_optimization_types has type list<KeyValue:string,int32>, so type in codegen specs should be list

There are 3 objects that uses this field:

  1. AdSet https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/
  2. AdAccountDeliveryEstimate (no documentation found)
  3. AdCampaignDeliveryEstimate https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-delivery-estimate/

Actual Results

What actually happened?

Current type for targeting_optimization_types is map<string, int>

Because of that, targeting_optimization_types could not be mapped properly. For example, one issue was reported in python sdk project link

Code Samples & Details

Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the fix.

        {
            "name": "targeting_optimization_types",
            "type": "map<string, int>"
        }

should be changed to:

        {
            "name": "targeting_optimization_types",
            "type": "list<map>"
        }
kromash commented 2 years ago

I see that API spec jsons are auto-generated. Should I create pull request with type fix or it should be fixed elsewhere?

stcheng commented 1 year ago

thanks for the pull request, we're aware of this issue. we'll try to address this asap.