{"id":17134126,"url":"https://github.com/fernandes/trailblazer-doc","last_synced_at":"2025-07-13T06:39:29.580Z","repository":{"id":80491850,"uuid":"172944555","full_name":"fernandes/trailblazer-doc","owner":"fernandes","description":null,"archived":false,"fork":false,"pushed_at":"2019-02-27T16:57:05.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T11:44:40.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fernandes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-27T15:51:53.000Z","updated_at":"2019-02-27T16:57:07.000Z","dependencies_parsed_at":"2023-07-06T18:17:23.689Z","dependency_job_id":null,"html_url":"https://github.com/fernandes/trailblazer-doc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Ftrailblazer-doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Ftrailblazer-doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Ftrailblazer-doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Ftrailblazer-doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fernandes","download_url":"https://codeload.github.com/fernandes/trailblazer-doc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217794,"owners_count":20579297,"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":[],"created_at":"2024-10-14T19:43:57.902Z","updated_at":"2025-03-24T05:45:43.518Z","avatar_url":"https://github.com/fernandes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trailblazer Doc\n\nThis gem provides an (ultra) this layer that wraps the forms and representable data into something ready to be consumed.\n\nWhat I mean? Imagine (yeah, this was the real case that inspired the gem) that you wanna document your API, you already has all your contracts and representers extremely defined, why do we need to redeclare everything on swagger.\n\nAnd worse, how to keep that in sync? This is completely insane!!1\n\nHow to use it?\n\nFor Reform, just require the reform (it's not autoloaded because you can use just for reform/representable)\n\n```ruby\nrequire 'trailblazer/doc/reform'\n\nclass AlbumForm \u003c Reform::Form\n  include Reform::Doc\n\n  property :title\n  validates :title, presence: true\nend\n```\n\n```ruby\nrequire 'trailblazer/doc/representable'\n\nclass AlbumRepresenter \u003c Representable::Decorator\n  include Representable::JSON\n  include Representable::Doc\n\n  property :id\n  property :title\nend\n```\n\nThen after that you can access some data like:\n\n```ruby\nAlbumForm.doc.properties\n# [:title]\n\nAlbumForm.doc.validations\n# {\n#   :title=\u003e[ {:presence=\u003etrue} ],\n#   :year=\u003e[ {:presence=\u003etrue, :numericality=\u003etrue} ]\n# }\n```\n\nThis is just the first step, the next (aka Roadmap) are:\n\n- [ ] Provide a configurator so we only allocate data in development / testing, never in production\n- [ ] Maybe provide some better API to access all the [Reform API](http://trailblazer.to/gems/reform/api.html) and [Representable API](http://trailblazer.to/gems/representable/3.0/api.html)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'trailblazer-doc'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install trailblazer-doc\n\n## Development\n\nThat usual red-green-refactor\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/fernandes/trailblazer-doc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nTL;DR As human beings, living in the same world, respect everyone that participates in this project, not in your own definition of respect, but in other's definition; If in doubt ask the other part. **Spread kindness.**\n\nEveryone interacting in the Trailblazer::Doc project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fernandes/trailblazer-doc/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandes%2Ftrailblazer-doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffernandes%2Ftrailblazer-doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandes%2Ftrailblazer-doc/lists"}