{"id":26136202,"url":"https://github.com/i2bskn/schema_serializer","last_synced_at":"2025-07-11T18:05:37.690Z","repository":{"id":56894451,"uuid":"142046483","full_name":"i2bskn/schema_serializer","owner":"i2bskn","description":"SchemaSerializer is provide serialization from schema definition to JSON.","archived":false,"fork":false,"pushed_at":"2021-03-21T05:36:56.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T13:11:22.633Z","etag":null,"topics":["json","openapi","serializer"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i2bskn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-23T17:25:05.000Z","updated_at":"2024-01-25T08:28:26.000Z","dependencies_parsed_at":"2022-08-21T01:20:34.331Z","dependency_job_id":null,"html_url":"https://github.com/i2bskn/schema_serializer","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i2bskn%2Fschema_serializer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i2bskn%2Fschema_serializer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i2bskn%2Fschema_serializer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i2bskn%2Fschema_serializer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i2bskn","download_url":"https://codeload.github.com/i2bskn/schema_serializer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248591695,"owners_count":21130094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","openapi","serializer"],"created_at":"2025-03-11T00:56:49.813Z","updated_at":"2025-04-13T22:52:37.625Z","avatar_url":"https://github.com/i2bskn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SchemaSerializer\n\n[![Gem Version](https://badge.fury.io/rb/schema_serializer.svg)](https://badge.fury.io/rb/schema_serializer)\n[![CI](https://github.com/i2bskn/schema_serializer/workflows/CI/badge.svg?branch=master)](https://github.com/i2bskn/schema_serializer/actions?query=workflow%3ACI)\n\nSchemaSerializer is provide serialization from schema definition to JSON.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"schema_serializer\"\n```\n\nAnd then execute:\n\n```bash\n$ bundle install\n```\n\nCreate config file(Only Rails) with:\n\n```bash\n$ bundle exec rails generate schema_serializer:install\n```\n\nThe following file will be created.\n\n- `config/initializers/schema_serializer.rb`\n- `doc/schema.yml`\n\n## Usage\n\n### Create a serializer template with Rails Generator\n\nCreate a serializer template in `app/serializers/user_serializer.rb`.\n\n```bash\n$ bundle exec rails g schema_serializer:serializer User\n```\n\n### Serializer Definitions\n\nSerializer Definitions are describe in the `doc/schema.yml`.\n\n```yaml\nUser:\n  required:\n    - id\n    - name\n  properties:\n    id:\n      type: integer\n    name:\n      type: string\n    age:\n      type: integer\n      nullable: true\n```\n\n### Serialization\n\n```ruby\nuser = User.take\nSchemaSerializer.new(user).as_json.to_json\n\n# Only ActiveRecord Object\nuser.serializer.as_json.to_json\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/i2bskn/schema_serializer.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi2bskn%2Fschema_serializer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi2bskn%2Fschema_serializer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi2bskn%2Fschema_serializer/lists"}