Skip to content
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

CAMELCASE #27

Open
victorgp89 opened this issue Jan 17, 2022 · 2 comments
Open

CAMELCASE #27

victorgp89 opened this issue Jan 17, 2022 · 2 comments

Comments

@victorgp89
Copy link

Hi,
Congrats for the project, is posible to avoid camelcase in metadata construction?
Thanks for advance

@dbu
Copy link
Member

dbu commented Jan 17, 2022

hi, thanks. i think you could use the @JMS\SerializedName annotation, but that would mean having to annotate every property of every model, so its more a hack than a proper solution.

i think the correct way would be to have a strategy pattern to change the serialized name on the property metadata. i don't have the time right now to look into it, but if you are interested in this, it should happen in https://github.com/liip/metadata-parser/ somewhere. i am not sure if we can reasonably do it while building the metadata tree, or if we should transform the final tree into a new tree with different serialized name properties. or if it would be correct to make the serialized name of PropertyMetadata mutable.

@dbu
Copy link
Member

dbu commented Dec 13, 2022

@Spea added identical naming in liip/metadata-parser#28 but with only a flag. to add camelCase support, we would need to refactor this to a proper naming strategy pattern. linking the pull request here as it indicates the places where the metadata parser needs to be adjusted to change naming strategies.

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

No branches or pull requests

2 participants