{"id":15561046,"url":"https://github.com/sanfrecce-osaka/katarina","last_synced_at":"2025-04-23T21:48:30.758Z","repository":{"id":56879930,"uuid":"281755122","full_name":"sanfrecce-osaka/katarina","owner":"sanfrecce-osaka","description":"This gem generates type definition files for TypeScript from a OpenAPI Documentation generated by rspec-openapi.","archived":false,"fork":false,"pushed_at":"2020-10-20T13:06:32.000Z","size":29,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T23:04:03.425Z","etag":null,"topics":["katarina","rspec-openapi","ruby","ruby-gem","typescript"],"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/sanfrecce-osaka.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}},"created_at":"2020-07-22T18:34:59.000Z","updated_at":"2023-02-10T22:51:05.000Z","dependencies_parsed_at":"2022-08-20T23:10:57.009Z","dependency_job_id":null,"html_url":"https://github.com/sanfrecce-osaka/katarina","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanfrecce-osaka%2Fkatarina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanfrecce-osaka%2Fkatarina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanfrecce-osaka%2Fkatarina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanfrecce-osaka%2Fkatarina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanfrecce-osaka","download_url":"https://codeload.github.com/sanfrecce-osaka/katarina/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522296,"owners_count":21444510,"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":["katarina","rspec-openapi","ruby","ruby-gem","typescript"],"created_at":"2024-10-02T16:05:02.235Z","updated_at":"2025-04-23T21:48:30.728Z","avatar_url":"https://github.com/sanfrecce-osaka.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Katarina\n\nThis gem generates type definition files for TypeScript from a OpenAPI Documentation generated by `rspec-openapi`.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'katarina', group: :development\n```\n\nAnd then execute:\n\n    $ bundle install\n\n## Usage\n\nExecute below command \n\n```shell script\n$ bin/rails katarina:generate\n```\n\n### Example\n\n`#{Katarina.config.input_path}` contents is below:\n\n```yaml\n---\nopenapi: 3.0.3\ninfo:\n  title: sample\npaths:\n  \"/v1/users/{user_id}/posts\":\n    get:\n      summary: 'api/v1/users/posts #index'\n      parameters:\n      - name: user_id\n        in: path\n        required: true\n        schema:\n          type: integer\n      responses:\n        '200':\n          description: HTTP status is 200\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  id:\n                    type: integer\n                  name:\n                    type: string\n                  comments:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        id:\n                          type: integer\n                        deleted:\n                          type: boolan\n                # ...\n```\n\nAnd then it will generate `#{Katarina.config.output_dir}/api/users/posts.d.ts` like the following contents:\n\n```ts\ntype TApiUsersPostsIndex200 = {\n  id: number\n  name: string\n  comments: {\n    id: number\n    deleted: boolean\n  }[]\n}\n```\n\n### Configuration\n\nThe following configurations are optional.\n\n```ruby\nKatarina.configure do |config|\n  # Change the input path to generate types from RSpec::OpenAPI.path\n  config.input_path = 'doc/schema.yaml'\n\n  # Change the output directory to generate types from #{RSpec::OpenAPI.path}/types\n  config.output_dir = 'doc/types'\n\n  # Sets the paths to be excluded from type naming and generating type definition file path\n  config.exclude_paths = %w[api v1]\n\n  # Disable type name prefix\n  config.prefix = false\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. If you want to check it with an old version of Ruby, run `bin/build` and transpile it.\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/sanfrecce-osaka/katarina. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/katarina/blob/master/CODE_OF_CONDUCT.md).\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 Katarina project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sanfrecce-osaka/katarina/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanfrecce-osaka%2Fkatarina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanfrecce-osaka%2Fkatarina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanfrecce-osaka%2Fkatarina/lists"}