Closed
Description
What happened?
Setting notification_types
as a float number throws an error from CloudFlare:
Field notification_types was expecting value of type 'int32', received value of type 'number 1.0' instead
But setting it to an integer value throws an error from OneSignal api:
onesignal.exceptions.ApiTypeError: Invalid type for variable 'notification_types'. Required value type is float and passed type was int at ['notification_types']
Steps to reproduce?
with onesignal.ApiClient(configuration) as api_client:
enabled = True
update_subscription_request_body = UpdateSubscriptionRequestBody(
subscription=SubscriptionObject(
id=sub_id,
enabled=enabled,
notification_types=1 if enabled else -31,
),
)
api_instance.update_subscription(app_id, sub_id, update_subscription_request_body)
What did you expect to happen?
API should accept float numbers (as stated in docs)
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct