{"id":27634700,"url":"https://github.com/toshiemon18/schemar","last_synced_at":"2026-04-30T13:34:13.563Z","repository":{"id":288960094,"uuid":"969667202","full_name":"toshiemon18/schemar","owner":"toshiemon18","description":"Design and generate OpenAPI schema with Ruby models","archived":false,"fork":false,"pushed_at":"2025-04-21T12:35:51.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T19:23:28.230Z","etag":null,"topics":["openapi","openapi3","webapi"],"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/toshiemon18.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-04-20T17:07:05.000Z","updated_at":"2025-04-21T12:35:54.000Z","dependencies_parsed_at":"2025-04-23T19:22:08.678Z","dependency_job_id":"ec2e625f-fcba-42e6-bc8d-6a3742a34dcb","html_url":"https://github.com/toshiemon18/schemar","commit_stats":null,"previous_names":["toshiemon18/schemar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toshiemon18/schemar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshiemon18%2Fschemar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshiemon18%2Fschemar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshiemon18%2Fschemar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshiemon18%2Fschemar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toshiemon18","download_url":"https://codeload.github.com/toshiemon18/schemar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshiemon18%2Fschemar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["openapi","openapi3","webapi"],"created_at":"2025-04-23T19:20:16.466Z","updated_at":"2026-04-30T13:34:13.546Z","avatar_url":"https://github.com/toshiemon18.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Schemar\n\nA Ruby library for automatically generating OpenAPI JSON schemas from Ruby classes.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'schemar'\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\n## Usage\n\n### Basic Usage\n\n1. Create a model class and extend `SchemaDefinable`:\n\n```ruby\nclass User\n  extend Schemar::SchemaDefinable\n\n  # Define basic type attributes\n  attribute :id, type: Integer, required: true, description: \"User ID\"\n  attribute :name, type: String, required: true, description: \"User name\"\n  attribute :is_active, type: Boolean, required: true, description: \"Account status\"\n  attribute :birth_date, type: Date, description: \"Date of birth\"\n  attribute :created_at, type: DateTime, required: true, description: \"Creation timestamp\"\n\n  # Define array type attributes\n  attribute :tags, type: Array, item_type: String, description: \"User tags\"\n\n  # Define nested objects\n  attribute :address, type: Address, description: \"User address\"\nend\n```\n\n2. Generate the schema:\n\n```ruby\ngenerator = Schemar::SchemaGenerator.new([User])\ngenerator.write_json(\"openapi.json\", title: \"User API\", version: \"1.0.0\")\n```\n\n### Supported Types\n\nThe following types are supported:\n\n- `String`\n- `Integer`\n- `Float`\n- `BigDecimal`\n- `Boolean` (only available within classes that extend SchemaDefinable)\n- `Date`\n- `Time`\n- `DateTime`\n- `Array` (specify element type with item_type)\n- `Hash`\n\n### Enum Definition\n\n```ruby\nclass Post\n  extend Schemar::SchemaDefinable\n\n  attribute :status, type: String, required: true, description: \"Post status\"\n  enum :status, {\n    draft: \"draft\",\n    published: \"published\",\n    archived: \"archived\"\n  }\nend\n```\n\n## Development\n\nAfter checking out the repo, run:\n\n```bash\nbin/setup\n```\n\nTo run tests:\n\n```bash\nbundle exec rspec\n```\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\nEveryone interacting in the Schemar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoshiemon18%2Fschemar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoshiemon18%2Fschemar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoshiemon18%2Fschemar/lists"}