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 method attributes #40

Closed
Chillwall opened this issue Apr 6, 2019 · 2 comments
Closed

camelCase method attributes #40

Chillwall opened this issue Apr 6, 2019 · 2 comments

Comments

@Chillwall
Copy link

Hello,

I need to use camelCase for my API, what's the best way using Panko?

Right now I uses aliases for most of my attributes and camelCased method names but that feels wrong.

class ObjectSerializer < Panko::Serializer
  attributes :title, :methodAttribute
  aliases first_attr: :firstAttr, second_attr: :secondAttr

  def methodAttribute
     compute(object)
  end
end
@dkobia
Copy link

dkobia commented Jun 4, 2019

You could also use something like https://github.com/vigetlabs/olive_branch

@yosiat
Copy link
Owner

yosiat commented Aug 10, 2019

Hi @Chillwall !

Sorry for not responding! closing in favour of #52 .

@yosiat yosiat closed this as completed Aug 10, 2019
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