Skip to content

Conversation

@antharuu
Copy link
Contributor

Summary

This PR adds a new configuration option to control the automatic conversion of API keys from camelCase (or any other style) to snake_case in Python objects.

Details

  • New feature:

    • The Client class now accepts an auto_snake_case parameter (default: True).
    • When set to False, fields and keys from the API are kept as-is (e.g., camelCase).
    • When set to True, the SDK continues to convert keys to snake_case (default behavior).
  • Implementation:

    • The conversion logic in the SDK now respects the client’s auto_snake_case setting.
    • All relevant usages in models and services are updated for consistency.
    • Backward compatibility is preserved.
  • Documentation:

    • The README now documents the new option with a concise explanation and example.
  • Testing:

    • New unit tests verify both behaviors (conversion enabled/disabled).
    • All tests pass.

Motivation

Some users may need to keep the original key style from the API (e.g., for frontend integration or migrations). This option provides flexibility while maintaining Pythonic defaults.

Breaking changes

None. The default remains unchanged.

Copy link
Owner

@vaphes vaphes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vaphes vaphes merged commit 10e24f1 into vaphes:master Jun 30, 2025
0 of 4 checks passed
@antharuu
Copy link
Contributor Author

antharuu commented Jul 2, 2025

Problem with my code or just the pipeline?
Do I need to change something?

@vaphes
Copy link
Owner

vaphes commented Jul 2, 2025

Problem with my code or just the pipeline? Do I need to change something?

Looks Good To Me. :) PR merged.

Tests are broken due to other issues

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

Successfully merging this pull request may close these issues.

2 participants