{"id":23175760,"url":"https://github.com/aj-foster/open-api-generator","last_synced_at":"2025-05-16T07:05:50.784Z","repository":{"id":65164709,"uuid":"532162560","full_name":"aj-foster/open-api-generator","owner":"aj-foster","description":"Open API code generator for Elixir","archived":false,"fork":false,"pushed_at":"2025-05-07T03:48:15.000Z","size":2011,"stargazers_count":132,"open_issues_count":12,"forks_count":19,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-07T04:18:39.951Z","etag":null,"topics":["elixir","openapi","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/aj-foster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["aj-foster"]}},"created_at":"2022-09-03T05:15:39.000Z","updated_at":"2025-04-30T12:46:20.000Z","dependencies_parsed_at":"2024-05-19T04:27:58.777Z","dependency_job_id":"76d911b7-4ccb-4be9-9ba9-e7d7d79a0825","html_url":"https://github.com/aj-foster/open-api-generator","commit_stats":{"total_commits":79,"total_committers":2,"mean_commits":39.5,"dds":0.03797468354430378,"last_synced_commit":"46ef2b71c61badbdce063c68ef487f64c11f43b5"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aj-foster%2Fopen-api-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aj-foster%2Fopen-api-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aj-foster%2Fopen-api-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aj-foster%2Fopen-api-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aj-foster","download_url":"https://codeload.github.com/aj-foster/open-api-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810353,"owners_count":21807772,"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":["elixir","openapi","rest-api"],"created_at":"2024-12-18T06:09:20.613Z","updated_at":"2025-05-16T07:05:46.418Z","avatar_url":"https://github.com/aj-foster.png","language":"Elixir","funding_links":["https://github.com/sponsors/aj-foster"],"categories":[],"sub_categories":[],"readme":"# OpenAPI Generator for Elixir\n\n[![Hex.pm](https://img.shields.io/hexpm/v/oapi_generator)](https://hex.pm/packages/oapi_generator)\n[![Documentation](https://img.shields.io/badge/hex-docs-blue)](https://hexdocs.pm/oapi_generator)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n\n_A highly-configurable code generator that combines ergonomics with maintainability._\n\n---\n\n[OpenAPI](https://swagger.io/specification/) is a standard way to describe REST APIs on the web.\nAnyone can create an OpenAPI description document that includes the available endpoints, expected request data, and possible responses.\nFor example, [GitHub](https://github.com/github/rest-api-description) maintains a comprehensive OpenAPI description for their services.\n\nGenerating code from an OpenAPI description can be relatively easy — this project [certainly isn't the first](https://openapi-generator.tech/docs/generators/elixir) — but there's a catch: API descriptions often don't translate into ergonomic code.\nMost users of an API client library don't want to think about the difference between a `NullableRepository` and `Repository`, as in the OpenAPI 3.0 GitHub API description.\n(They have the same fields, but one has `nullable: true`.)\nUsers just want to get back a `%Repository{}` or `nil`.\n\nThe goal of this library is to create **ergonomic** client libraries from OpenAPI descriptions.\nAt the same time, the changes made to the code are easily repeatable (fully automated) for the sake of maintainability.\nThink: the friendliness of your favorite hand-crafted client library applied to the scale of large APIs.\n\n\u003e _See an example client library [here](https://github.com/aj-foster/open-api-github)._\n\nFor more on how this is accomplished, see **Configuration** below and the [configuration guide](guides/configuration.md).\n\n\n## Installation\n\nThis library is available on Hex.pm.\nAdd the dependency in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:oapi_generator, \"~\u003e 0.2.0\", only: :dev, runtime: false}\n  ]\nend\n```\n\nThen install the dependency using `mix deps.get`.\nMost libraries only need access to the `mix api.gen` task in a development environment.\nIf your use case requires calling the generator in production or testing, be sure to modify or remove `only: :dev` and `runtime: false` as appropriate.\n\n\n## Configuration\n\nThe real power of this library is in the available configuration.\nAlthough the options are conceptually simple, they add up to a better user experience.\n\nThis project uses configuration profiles to allow multiple configurations with the same package.\nTo get started, create a profile called `default` in your configuration file:\n\n```elixir\n# config/config.exs\n\nimport Config\n\nconfig :oapi_generator, default: [\n  output: [\n    base_module: Example,\n    location: \"lib/example\"\n  ]\n]\n```\n\nThis is the minimum viable configuration for most client libraries.\nIt will create modules namespaced with `Example.` and save files in `lib/example`.\n\nSome the options supported by the generator out-of-the-box include:\n\n* Ignoring schemas and operations\n* Renaming schemas\n* Grouping schemas into module namespaces\n* Merging schemas to create a struct with multiple typespecs\n* Writing schemas and operation modules to different locations\n* Introducing additional schema fields\n* Adding custom `use` statements to generated modules\n* Overriding function return types\n\nFor more information, see the [configuration guide](guides/configuration.md).\n\n\n## Plugins\n\nIf the available configuration isn't enough, client library authors can also reimplement portions of the code generator using _plugins_.\nMost of the crucial parts of the processing and rendering of code are implemented as default callbacks for a behaviour.\nThese can be overridden for additional flexibility.\nSee the [plugins guide](guides/plugins.md) for additional information.\n\n\n## Usage\n\nOnce the library is installed and configured, use `mix api.gen` with the name of the configuration profile and the OpenAPI description file(s):\n\n```shell\nmix api.gen default path/to/rest-api-description/spec.yaml\n```\n\n## Further Reading\n\n* [Code of Conduct](CODE_OF_CONDUCT.md)\n* [Contribution Guidelines](CONTRIBUTING.md)\n* [License](LICENSE)\n* [OpenAPI Specification](https://spec.openapis.org/oas/latest.html)\n\n\n## Sponsorship\n\nIf you like this library or it makes you money, please consider [sponsoring](https://github.com/sponsors/aj-foster).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj-foster%2Fopen-api-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faj-foster%2Fopen-api-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj-foster%2Fopen-api-generator/lists"}