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

Move default serialize format to camelCase #126

Open
lewisf opened this issue Aug 8, 2019 · 2 comments
Open

Move default serialize format to camelCase #126

lewisf opened this issue Aug 8, 2019 · 2 comments

Comments

@lewisf
Copy link

lewisf commented Aug 8, 2019

In the README.md:

# By default, the type is the object's class name lowercased, pluralized, and dasherized,
# per the spec naming recommendations: http://jsonapi.org/recommendations/#naming

However JSONAPI seems to have changed their recommendations to camelCase.
https://jsonapi.org/recommendations/#naming

Would be a breaking change so posting an issue about how to approach this before attempting a PR

@nbw
Copy link

nbw commented Sep 15, 2020

also even if you override it, included associations are still dashed.

@fdreith
Copy link

fdreith commented Nov 23, 2020

I was also not able to get the unformat_name override to work.

Usage:

class UserSerializer
  include JSONAPI::Serializer

  def unformat_name(attribute_name)
    attribute_name.to_s.underscore
  end

  attribute :first_name
  attribute :last_name

end

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

3 participants