Comments (5)
Hey @dynamodan ! Do you have some concrete examples where this is causing problems?
As mentioned in the README, the SDK is auto-generated and some of the controller functions did not have automatic model mapping - just return $response->body;
To work around this, CamelCaseHelper::keysToCamelCase($response->body)
was added to transform the response to at least identical format (keys in camelCase instead of snake_case as they appear in the raw response).
Indeed there is a difference in typing: model-specific objects (a la Pipedrive\Models\CreatorUserId Object
) vs stdClass Object
after CamelCaseHelper. Is this the blocker for you?
from client-php.
It's for a client so I can't be very specific. Is it concrete enough to say it made my javascript throw a "can't do this because object is null" when I tried to access something in the pipedrive response by its snake_case key?
I had been loading deal IDs by using an itemSearch
, then loading the deals one-by-one from the deal id using getDetailsOfADeal
. Not efficient, I admit. THEN I discovered I can get the same amount of detail by doing listDealsAssociatedWithAnOrganization
and that's when I got camelCased keys. The browser side javascripts were expecting the snake_cased keys as getDetailsOfADeal
provides, but got camelCased keys instead.
I really don't have a preference of snake_keys over camelCased. But it would be conventional, consistent, and follow the principles of least astonishment, etc for it to be all one or the other not a mixture.
from client-php.
For now, I've worked around it by implementing an unCamelCase
function in my own code.
from client-php.
Thank you for the additional details! I see now - the keys at the root level of the getDetailsOfADeal()
response are mapped to camelCase as expected but some of the sub-properties (like the nextActivity
object) contain snake cased keys. This definitely should not happen and we'll implement a fix to unify everything (to camel case)
from client-php.
@dynamodan would you be able to verify that #45 fixes the issue on your side?
from client-php.
Related Issues (20)
- Not returning custom fields in version 6 HOT 2
- No custom fields support for Deal, documentation lies HOT 10
- getAllProductFields gives Array to string conversion error HOT 1
- Uncaught Error: Call to undefined method Pipedrive\Configuration::setApiKey() HOT 2
- Fatal error in OrganizationFieldsApi->getOrganizationFields()
- PHP8.1 deprecation notices HOT 8
- WebhooksController -> createANewWebhook HOT 1
- Error: OAuth 2 provider says client authentication failed. - Refresh token quit updating HOT 1
- Instead of hardcoded error message using actual messages would be incredible HOT 2
- "getDetailsOfADeal" doesn't contain Deal Custom Fields in response HOT 1
- getAllPersonFields - does not have pagination param support HOT 1
- CamelCaseHelper - empty response body causes `invalid argument supplied for foreach()` HOT 2
- busyFlag is not supported for adding/updating activity HOT 1
- jsonSerialize method throughout the library is not consistent with JsonSerializable::jsonSerialize HOT 2
- missing 1 parameter lead_id on ActivitiesController HOT 1
- Invalid Request Body Parameter Type HOT 1
- DealFieldsApi->getDealFields() fails with error 'Class 'FieldTypeAsString' not found' HOT 5
- PHP 7.4: Return value of Pipedrive\Model\LeadResponse::jsonSerialize() must be an instance of Pipedrive\Model\mixed, i HOT 1
- FieldTypeAsString not accepted during deserialization HOT 2
- Configuration.php loading incompletely
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client-php.