-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle lowerCamelCase naming strategy #139
Conversation
fixed https://github.com/jry25/JMSSerializerBundle/commit/261cb406f67f26c453f223f3e699c669a6345405 |
oops, sorry I didn't want to close this pull request. |
Do you use upper-case properties? |
No, I write the properties with lowerCamelCase |
This would be really useful for APIs that use lowerCamelCase JSON properties. |
Could you please add/update the tests, and squash your commits? |
@jry25 Cheers for generating this PR. How are you getting on with the changes @schmittjoh requested? If you need help let us know as I'm keen to get this patch in the core bundle |
Hi folks, |
Hi, I try to figure out where I should update the tests but can't succeed. |
A unit test is better suited here, I think. Let's create a |
Thanks. I'll try to write a unit test. I'll keep you up with CamelCaseNamingStrategyTest |
There are probably more elegant ways to squash, here is what I do:
Replace "4" with the number of commits that you have made so far, and do not add the |
Your help is very useful. I did well to ask you some details. |
I tried to squash the commits but I'm not sure if it properly worked. The log on my local repo doesn't show it and there's no change online |
git rebase -i 801132b That commit hash might have to change if there have been any upstream changes since I looked at your repo. Leave the top commit as
|
I just tried with the method given by @schmittjoh and @wedgybo but as soon as I sync github MacOS application the squash disappear. |
well, do the push with the command-line too. The github application may reject force pushes. |
@jry25 If you open up write access for my account I'm happy to sort the final squash to get this included if you are still having bother with it. Better than copying and generating a new pull request. |
When I try to push with command line I get this error : git push Do I need to do a git pull ? |
I'd guess that the squash has changed history so it's no longer a fast-forward commit. As @stof suggested you'll need to use |
Finally I did it. Thanks you very much for your help. Now everything is in the hands of @schmittjoh |
No problem :) Cheers for sorting it out. Will hopefully be able to avoid adding in 100s of SerializedName() annotations now. |
Any progress with issue? This option will be extremely useful, IMO. |
Any progress? It refers to this as well #49 doesn't it? It would be super to use lowerCamelCase strategy to deserialize data to Doctrine entity schemes |
There are still some CS issues, and it would need to be rebased on master. |
Hi, |
$translatedPropertyName = $camelCaseNamingStrategy->translateName($metadata->propertyMetadata['camelCaseProperty']); | ||
|
||
$this->assertEquals($translatedPropertyName, 'camel_case_property'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 4 spaces for the indentation, not tabs
Doesn't the term "camel case" generally imply that it starts with a lower-case letter in the first place? Pascal case, on the other hand, implies that it starts with an upper-case letter (see Capitalization Styles on MSDN). The name of this naming strategy is a bit misleading because it isn't ACTUALLY camel case. Not only that (and even more perplexing) is the fact that |
@iunruh no. camel case can be used for both, which is why we may talk about upper camel case (which is also known as Pascal case) and lower camel case. |
Any progress with issue? This option will be extremely useful, IMO. |
Apparently someone needs to replaces tabs by spaces... Things like this can take several months. |
Exactly what i need right now. Is the tab to spaces conversion everything left to succeed with this PR ? |
Hi guys I was totally busy since I created this PR. Hope the commit 93d6a57 will do the job you're looking for. cf https://github.com/jry25/JMSSerializerBundle/commit/93d6a570d18d851c62681fdc53d80f496be77222 |
@schmittjoh any comments on the new commit ? |
Any news? |
You'll probably need to open a PR on the https://github.com/schmittjoh/serializer as well, since the bulk of this component was moved there. |
I really need this, when will it be implemented? |
@schmittjoh there is something else that should be made before this PR get merged? |
This pull request might be what most of you are looking for: It has already been merged into the master for the actual serializer component. However, the actual configuration change for the bundle is being discussed in this pull request: |
Waiting for this to be merged. Its kind of sad you need 2+ hours of research for this bundle to just behave camel case (with a lower first letter). |
+100 year old issue... common |
+1 |
Ember expects the field names to be CamelCase. Change serializer naming strategy to reflect that. See schmittjoh/JMSSerializerBundle#270 and schmittjoh/JMSSerializerBundle#139
ping @schmittjoh |
Any news about this PR ? The solution I've found is to add the parameter in
It works with Symfony 3 Source: gbirke/nvcapp1@3890b28 |
Sorry for the terribly long feedback loop Closing the PR, since too many things changed on master in the last years. If you are still interested in working on this feel free to re-open a new PR based on the current master. |
Hi, camel case naming offers two ways to write camel case :
This pull request handle the use of lowerCamelCase naming, by adding a boolean configuration node "lower_camel_case". The use of UpperCamelCase is used by default or if the configuration node "lower_camel_case" is set to "false"