https://github.com/rails-api/active_model_serializers
ActiveModel::Serializer implementation and Rails hooks
https://github.com/rails-api/active_model_serializers
Keywords
json resource-serializer ruby
Keywords from Contributors
activerecord activejob mvc rubygems rspec rack rubocop crash-reporting sinatra multithreading
Last synced: about 13 hours ago
JSON representation
Repository metadata
ActiveModel::Serializer implementation and Rails hooks
- Host: GitHub
- URL: https://github.com/rails-api/active_model_serializers
- Owner: rails-api
- License: mit
- Created: 2011-12-01T06:39:26.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2025-11-11T16:18:28.000Z (about 1 month ago)
- Last Synced: 2025-12-08T10:29:40.532Z (9 days ago)
- Topics: json, resource-serializer, ruby
- Language: Ruby
- Homepage:
- Size: 4.29 MB
- Stars: 5,346
- Watchers: 73
- Forks: 1,386
- Open Issues: 188
- Releases: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG-0-08.md
- Contributing: CONTRIBUTING.md
- License: MIT-LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
README.md
ActiveModelSerializers
About
ActiveModelSerializers is undergoing some renovations. See Development Status.
Getting Help
If you find a bug, please report an Issue
and see our contributing guide.
If you have a question, please post to Stack Overflow.
If you'd like to chat, we have a community slack.
Thanks!
Documentation
If you're reading this at https://github.com/rails-api/active_model_serializers you are
reading documentation for our master, which is not yet released.
Status of AMS
Status:
- ❗️ All existing PRs against master will need to be closed and re-opened against 0-10-stable, if so desired
- ❗️ Master, for the moment, won't have any released version of AMS on it.
- 👀 See below for alternatives
Changes to 0.10.x maintenance:
- The 0.10.x version has become a huge maintenance version. We had hoped to get it in shape for a 1.0 release, but it is clear that isn't going to happen. Almost none of the maintainers from 0.8, 0.9, or earlier 0.10 are still working on AMS. We'll continue to maintain 0.10.x on the 0-10-stable branch, but maintainers won't otherwise be actively developing on it.
- We may choose to make a 0.11.x ( 0-11-stable) release based on 0-10-stable that just removes the deprecations.
What's happening to AMS:
- There's been a lot of churn around AMS since it began back in Rails 3.2 and a lot of new libraries are around and the JSON:API spec has reached 1.0.
- If there is to be a 1.0 release of AMS, it will need to address the general needs of serialization in much the way ActiveJob can be used with different workers.
- The next major release is in development. We're starting simple and avoiding, at least at the outset, all the complications in AMS version, especially all the implicit behavior from guessing the serializer, to the association's serializer, to the serialization type, etc.
- The basic idea is that models to serializers are a one to many relationship. Everything will need to be explicit. If you want to serialize a User with a UserSerializer, you'll need to call it directly. The serializer will essentially be for defining a basic JSON:API resource object: id, type, attributes, and relationships. The serializer will have an as_json method and can be told which fields (attributes/relationships) to serialize to JSON and will likely not know serialize any more than the relations id and type. Serializing anything more about the relations would require code that called a serializer. (This is still somewhat in discussion).
- If this works out, the idea is to get something into Rails that existing libraries can use.
See PR 2121 where these changes were introduced for more information and any discussion.
Alternatives
- jsonapi-rb is a highly performant and modular JSON:API-only implementation. There's a vibrant community around it that has produced projects such as JSON:API Suite.
- fast_jsonapi is a lightning fast JSON:API serializer for Ruby Objects.
- jsonapi-resources is a popular resource-focused framework for implementing JSON:API servers.
- blueprinter is a fast, declarative, and API spec agnostic serializer that uses composable views to reduce duplication. From your friends at Procore.
- Alba is fast and spec agnostic serialization solution. It has some unique features such as global or per-resource error handling.
- Transmutation is fast and lightweight JSON attribute serialization solution. It provides an intuitive serializer lookup, inspired from AMS.
For benchmarks against alternatives, see https://github.com/rails-api/active_model_serializers/tree/benchmarks
Semantic Versioning
This project adheres to semver
Contributing
See CONTRIBUTING.md
Owner metadata
- Name: rails-api
- Login: rails-api
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/2820360?v=4
- Repositories: 6
- Last ynced at: 2024-03-25T21:10:33.730Z
- Profile URL: https://github.com/rails-api
GitHub Events
Total
- Issues event: 10
- Watch event: 49
- Issue comment event: 25
- Push event: 3
- Pull request review comment event: 4
- Pull request review event: 4
- Pull request event: 10
- Fork event: 8
- Create event: 2
Last Year
- Issues event: 5
- Watch event: 37
- Issue comment event: 9
- Push event: 1
- Pull request event: 7
- Fork event: 2
- Create event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 994
Total Committers: 201
Avg Commits per committer: 4.945
Development Distribution Score (DDS): 0.648
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Benjamin Fleischer | g****b@b****m | 350 |
| Lucas Hosseini | l****i@g****m | 81 |
| João Moura | j****a@g****m | 37 |
| Tema Bolshakov | a****v@s****m | 26 |
| L. Preston Sego III | L****v@g****m | 25 |
| Steve Klabnik | s****e@s****m | 23 |
| Bruno Bacarini | b****o@g****m | 22 |
| Yohan Robert | y****t@o****r | 21 |
| Ben Mills | b****n@u****m | 21 |
| Mateo Murphy | m****y@g****m | 19 |
| Mauro George | m****t@g****m | 14 |
| Alexandre de Oliveira | c****o@g****m | 13 |
| Guillermo Iguaran | g****n@g****m | 12 |
| Alexey Dubovskoy | d****a@g****m | 11 |
| João M. D. Moura | j****o@r****m | 9 |
| Gary Gordon | g****n@g****m | 8 |
| Taylor Jones | t****e@g****m | 7 |
| Ryunosuke SATO | t****s@g****m | 6 |
| Josh Smith | j****h@c****m | 6 |
| Ben Woosley | b****y@g****m | 5 |
| CorainChicago | c****n@g****m | 5 |
| Eric Guo | e****o@s****m | 5 |
| Santiago Pastorino | s****o@w****m | 5 |
| bobba surendranath chowdary | b****a@g****m | 5 |
| Nicholas Shook | n****k@q****m | 5 |
| Aaron Renoir | a****n@f****m | 4 |
| Dave Gynn | d****n@g****m | 4 |
| Igor Zubkov | i****v@g****m | 4 |
| MSathieu | M****u | 4 |
| Rodrigo Ra | r****p@g****m | 4 |
| and 171 more... | ||
Committer domains:
- runtastic.com: 3
- outlook.jp: 2
- thoughtbot.com: 1
- chavard.net: 1
- hypothetical.com.au: 1
- codequest.eu: 1
- instanceinc.com: 1
- regonn.tokyo: 1
- code.org: 1
- digitalnatives.hu: 1
- lambdaweb.fr: 1
- onehouse.net: 1
- giveforward.com: 1
- csumb.edu: 1
- joshsoftware.com: 1
- saltpepper.ru: 1
- popularpays.com: 1
- livingsocial.com: 1
- motionmobs.com: 1
- coherentsolutions.com: 1
- benjaminfleischer.com: 1
- spbtv.com: 1
- steveklabnik.com: 1
- outlook.fr: 1
- unfiniti.com: 1
- ride.com: 1
- coderly.com: 1
- sandisk.com: 1
- wyeworks.com: 1
- q-centrix.com: 1
- fieldphone.com: 1
- academia.edu: 1
- engineyard.com: 1
- synatic.net: 1
- publicisfrontfoot.com.au: 1
- bloomberg.net: 1
- sweatypitts.com: 1
- fastmail.com: 1
- jaredbeck.com: 1
- cerner.com: 1
- sphericalcube.net: 1
- 4angle.com: 1
- aldreth.com: 1
- joyvuu.com: 1
- spellbook.tech: 1
- cerebris.com: 1
- imanel.org: 1
- bernardo.me: 1
- spike.net.nz: 1
- carlus.cat: 1
- spkdev.net: 1
- ledrumathe.com: 1
- osaaru.com: 1
- johnathanludwig.com: 1
- johnhamelink.com: 1
- aevy.com: 1
- thekompanee.com: 1
- ubuntu.com: 1
- iancanderson.com: 1
- hitabis.de: 1
- yahoo.es: 1
- brigade.com: 1
- cespi.unlp.edu.ar: 1
- metova.com: 1
- redhat.com: 1
- me.com: 1
- minimalorange.com: 1
- chobert.fr: 1
- tailorbrands.com: 1
- moritzlawitschka.de: 1
- crm-box.ru: 1
- mikekelly.io: 1
- filespanker.com: 1
- ouvrages-web.fr: 1
- enginearch.com: 1
- ssen.codes: 1
- tjschuck.com: 1
- munda.me: 1
- coding-robin.de: 1
- magnificent-tears.com: 1
- edwardloveall.com: 1
Issue and Pull Request metadata
Last synced: 6 days ago
Total issues: 83
Total pull requests: 101
Average time to close issues: 10 months
Average time to close pull requests: 8 months
Total issue authors: 81
Total pull request authors: 52
Average comments per issue: 5.27
Average comments per pull request: 2.54
Merged pull request: 46
Bot issues: 0
Bot pull requests: 0
Past year issues: 6
Past year pull requests: 7
Past year average time to close issues: about 3 hours
Past year average time to close pull requests: 3 days
Past year issue authors: 6
Past year pull request authors: 5
Past year average comments per issue: 2.17
Past year average comments per pull request: 1.43
Past year merged pull request: 3
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- NullVoxPopuli (2)
- exocode (2)
- chrismanderson (1)
- pavan-itd (1)
- alecvn (1)
- giorgenes (1)
- tygryszcz (1)
- zedtux (1)
- samsonjs (1)
- devonparsons (1)
- scottohara-frollo (1)
- hadiS (1)
- leoncruz (1)
- Roguelazer (1)
- Mhmonicox (1)
Top Pull Request Authors
- casperisfine (16)
- bf4 (8)
- saiqulhaq (8)
- wasifhossain (4)
- tashirosota (3)
- schinery (3)
- timrosenblatt (2)
- himynameisjonas (2)
- eugeneius (2)
- Mubramaj (2)
- stefansundin (2)
- vineelvineel (2)
- Roguelazer (2)
- Nitemaeric (2)
- RyanNielson (2)
Top Issue Labels
- V: 0.10.x (9)
- S: Ready for PR (3)
- S: Needs Bug Verification (3)
- S: Needs Submitter Response (3)
- S: Bug (2)
- C: JSON API (2)
- C: Feature (2)
- S: Needs Team Discussion (2)
- C: Performance (2)
- C: Documentation (2)
- C: Performance: Caching (2)
- C: Question (2)
- V: 0.8.x (1)
- C: Legacy Adapter (1)
- C: Upgrading (1)
- C: Keys and Transform (1)
Top Pull Request Labels
- V: 0.10.x (3)
- C: Feature (2)
- S: Needs Team Discussion (1)
Package metadata
- Total packages: 7
-
Total downloads:
- rubygems: 244,319,996 total
- Total docker downloads: 102,439,022
- Total dependent packages: 236 (may contain duplicates)
- Total dependent repositories: 30,778 (may contain duplicates)
- Total versions: 159
- Total maintainers: 11
gem.coop: active_model_serializers
ActiveModel::Serializers allows you to generate your JSON in an object-oriented and convention-driven manner.
- Homepage: https://github.com/rails-api/active_model_serializers
- Documentation: http://www.rubydoc.info/gems/active_model_serializers/
- Licenses: MIT
- Latest release: 0.10.16 (published 8 days ago)
- Last Synced: 2025-12-15T10:10:19.420Z (1 day ago)
- Versions: 47
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 122,127,851 Total
- Docker Downloads: 51,219,511
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.154%
- Downloads: 0.463%
- Maintainers (9)
rubygems.org: active_model_serializers
ActiveModel::Serializers allows you to generate your JSON in an object-oriented and convention-driven manner.
- Homepage: https://github.com/rails-api/active_model_serializers
- Documentation: http://www.rubydoc.info/gems/active_model_serializers/
- Licenses: MIT
- Latest release: 0.10.16 (published 8 days ago)
- Last Synced: 2025-12-15T10:10:20.102Z (1 day ago)
- Versions: 47
- Dependent Packages: 236
- Dependent Repositories: 30,777
- Downloads: 122,127,851 Total
- Docker Downloads: 51,219,511
-
Rankings:
- Dependent packages count: 0.164%
- Forks count: 0.164%
- Downloads: 0.19%
- Dependent repos count: 0.197%
- Stargazers count: 0.234%
- Average: 0.284%
- Docker downloads count: 0.752%
- Maintainers (9)
proxy.golang.org: github.com/rails-api/active_model_serializers
- Homepage:
- Documentation: https://pkg.go.dev/github.com/rails-api/active_model_serializers#section-documentation
- Licenses: mit
- Latest release: v0.10.16 (published 8 days ago)
- Last Synced: 2025-12-15T10:10:25.315Z (1 day ago)
- Versions: 41
- Dependent Packages: 0
- Dependent Repositories: 1
-
Rankings:
- Forks count: 0.655%
- Stargazers count: 0.914%
- Average: 3.96%
- Dependent repos count: 4.717%
- Dependent packages count: 9.553%
gem.coop: cheap_ams
ActiveModel::Serializers allows you to generate your JSON in an object-oriented and convention-driven manner.
- Homepage: https://github.com/rails-api/active_model_serializers
- Documentation: http://www.rubydoc.info/gems/cheap_ams/
- Licenses: MIT
- Latest release: 0.10.11 (published over 10 years ago)
- Last Synced: 2025-12-15T10:10:19.449Z (1 day ago)
- Versions: 11
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 29,280 Total
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 7.304%
- Downloads: 21.913%
- Maintainers (1)
rubygems.org: cheap_ams
ActiveModel::Serializers allows you to generate your JSON in an object-oriented and convention-driven manner.
- Homepage: https://github.com/rails-api/active_model_serializers
- Documentation: http://www.rubydoc.info/gems/cheap_ams/
- Licenses: MIT
- Latest release: 0.10.11 (published over 10 years ago)
- Last Synced: 2025-12-15T10:10:19.186Z (1 day ago)
- Versions: 11
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 29,280 Total
-
Rankings:
- Forks count: 0.127%
- Stargazers count: 0.193%
- Dependent packages count: 15.706%
- Average: 16.943%
- Downloads: 21.906%
- Dependent repos count: 46.782%
- Maintainers (1)
gem.coop: active_model_serializers_custom
ActiveModel::Serializers allows you to generate your JSON in an object-oriented and convention-driven manner.
- Homepage: https://github.com/rails-api/active_model_serializers
- Documentation: http://www.rubydoc.info/gems/active_model_serializers_custom/
- Licenses: MIT
- Latest release: 0.10.90 (published over 6 years ago)
- Last Synced: 2025-12-15T10:10:20.409Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 2,867 Total
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 29.28%
- Downloads: 87.84%
- Maintainers (1)
rubygems.org: active_model_serializers_custom
ActiveModel::Serializers allows you to generate your JSON in an object-oriented and convention-driven manner.
- Homepage: https://github.com/rails-api/active_model_serializers
- Documentation: http://www.rubydoc.info/gems/active_model_serializers_custom/
- Licenses: MIT
- Latest release: 0.10.90 (published over 6 years ago)
- Last Synced: 2025-12-15T10:10:18.902Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 2,867 Total
-
Rankings:
- Forks count: 0.127%
- Stargazers count: 0.193%
- Dependent packages count: 15.706%
- Average: 31.14%
- Dependent repos count: 46.782%
- Downloads: 92.893%
- Maintainers (1)
Dependencies
Score: 33.58620223248636