{"id":31646392,"url":"https://github.com/houllette/elixir-sdk-generator","last_synced_at":"2026-04-29T16:31:54.989Z","repository":{"id":318398035,"uuid":"1071105097","full_name":"houllette/elixir-sdk-generator","owner":"houllette","description":"Production-ready GitHub template for generating Elixir SDKs from OpenAPI specs with automated regeneration, connection pooling, retries, and   comprehensive testing.","archived":false,"fork":false,"pushed_at":"2025-10-06T23:02:15.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T22:00:05.195Z","etag":null,"topics":["elixir","openapi","openapi-generator","sdk","sdk-elixir"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/houllette.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T21:49:21.000Z","updated_at":"2025-10-06T23:02:18.000Z","dependencies_parsed_at":"2025-10-07T01:05:39.825Z","dependency_job_id":"dd15b8ca-8fd2-4c29-811f-e465acacd66e","html_url":"https://github.com/houllette/elixir-sdk-generator","commit_stats":null,"previous_names":["houllette/elixir-sdk-generator"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/houllette/elixir-sdk-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houllette%2Felixir-sdk-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houllette%2Felixir-sdk-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houllette%2Felixir-sdk-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houllette%2Felixir-sdk-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houllette","download_url":"https://codeload.github.com/houllette/elixir-sdk-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houllette%2Felixir-sdk-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32434664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"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":["elixir","openapi","openapi-generator","sdk","sdk-elixir"],"created_at":"2025-10-07T05:49:26.672Z","updated_at":"2026-04-29T16:31:54.966Z","avatar_url":"https://github.com/houllette.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elixir SDK Generator Template\n\nA production-ready GitHub template for generating Elixir SDKs from OpenAPI specifications using [openapi-generator](https://openapi-generator.tech/).\n\n## Features\n\n✨ **Automated Generation**: One-command SDK generation with zero manual intervention\n🔄 **Auto-Regeneration**: GitHub Actions automatically regenerate SDK when specs change\n🏊 **Connection Pooling**: Built-in Finch connection pooling for optimal performance\n♻️ **Retry Logic**: Automatic retries with exponential backoff for transient failures\n📊 **Telemetry**: Integrated telemetry for monitoring and observability\n🧪 **Test Infrastructure**: Comprehensive test helpers that survive regeneration\n📈 **Code Coverage**: Automatic coverage tracking with threshold enforcement\n🔍 **Breaking Changes**: Automatic detection of API breaking changes\n📦 **Hex.pm Ready**: Pre-configured publishing workflow\n\n## Quick Start\n\n\u003e **Prerequisites**: Elixir 1.18+, Erlang/OTP 26+, and OpenAPI Generator\n\u003e Install OpenAPI Generator via: `brew install openapi-generator` (macOS/Linux) or `npm install -g @openapitools/openapi-generator-cli`\n\n### 1. Use This Template\n\nClick the \"Use this template\" button on GitHub to create your own repository.\n\n### 2. Run Setup\n\n```bash\n./scripts/setup.sh\n```\n\nThis interactive script will prompt you for:\n- Package name (e.g., `my_api_client`)\n- Module name (e.g., `MyApiClient`)\n- Author information\n- GitHub repository details\n- OpenAPI specification location\n\n### 3. Generate SDK\n\n```bash\n./scripts/regenerate.sh\n```\n\nThis will:\n- Validate your OpenAPI spec\n- Generate the SDK code\n- Run post-processing\n- Format the code\n- Install dependencies\n- Run tests\n\n### 4. Review and Test\n\n```bash\nmix test\nmix credo\nmix dialyzer\n```\n\n## Project Structure\n\n```\nelixir-sdk-generator/\n├── .github/workflows/      # CI/CD pipelines\n│   ├── test.yml           # Test on every push\n│   ├── regenerate-sdk.yml # Auto-regenerate SDK\n│   ├── publish.yml        # Publish to Hex.pm\n│   └── breaking-changes.yml # Detect breaking changes\n├── .openapi-generator/\n│   └── templates/         # Custom Mustache templates\n├── config/                # Elixir configuration\n├── lib/                   # Generated SDK code (disposable)\n├── scripts/               # Automation scripts\n├── test/                  # Tests (persistent, never regenerated)\n│   ├── unit/\n│   ├── integration/\n│   └── support/\n├── generator-config.yaml  # OpenAPI Generator config\n└── openapi-spec.yaml     # Your OpenAPI specification\n```\n\n## Usage\n\n### Basic Example\n\n```elixir\n# Create a connection\nconn = MySDK.Connection.new()\n\n# Make API calls\n{:ok, response} = MySDK.Api.Users.get_user(conn, user_id)\n```\n\n### Custom Configuration\n\n```elixir\n# Custom base URL\nconn = MySDK.Connection.new(base_url: \"https://api.example.com\")\n\n# Custom timeout\nconn = MySDK.Connection.new(timeout: 60_000)\n\n# Custom retry configuration\nconn = MySDK.Connection.new(\n  retry: [\n    max_retries: 5,\n    delay: 200,\n    max_delay: 10_000\n  ]\n)\n```\n\n### Runtime Configuration\n\n```elixir\n# config/runtime.exs\nconfig :my_sdk,\n  base_url: System.get_env(\"API_BASE_URL\", \"https://api.example.com\"),\n  pool_size: String.to_integer(System.get_env(\"HTTP_POOL_SIZE\", \"25\"))\n```\n\n## Development Workflow\n\n### 1. Update OpenAPI Spec\n\nEdit `openapi-spec.yaml` with your API changes.\n\n### 2. Regenerate SDK\n\n```bash\n./scripts/regenerate.sh\n```\n\n### 3. Add Tests\n\nAdd tests for new endpoints in `test/unit/` or `test/integration/`:\n\n```elixir\ndefmodule MySDK.Api.UsersTest do\n  use TestCase\n\n  test \"creates a user\" do\n    conn = Connection.new(base_url: MockServer.url(bypass))\n    assert {:ok, response} = Users.create_user(conn, %{name: \"Test\"})\n  end\nend\n```\n\n### 4. Commit Changes\n\n```bash\ngit add .\ngit commit -m \"Add user creation endpoint\"\ngit push\n```\n\n## GitHub Actions Workflows\n\n### Continuous Integration (test.yml)\n\nRuns on every push and PR:\n- Tests across multiple Elixir/OTP versions\n- Code formatting checks\n- Credo linting\n- Dialyzer type checking\n- Code coverage with threshold enforcement\n\n### Auto-Regeneration (regenerate-sdk.yml)\n\nAutomatically triggered when:\n- `openapi-spec.yaml` changes\n- Manual workflow dispatch\n- Weekly schedule (configurable)\n\nCreates a PR with regenerated SDK code.\n\n### Publishing (publish.yml)\n\nTriggered on version tags (`v*.*.*`):\n- Runs all tests\n- Publishes to Hex.pm\n- Creates GitHub release\n\n```bash\n# Bump version in mix.exs, then:\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\n### Breaking Changes Detection (breaking-changes.yml)\n\nRuns on PRs that modify:\n- OpenAPI spec\n- API modules\n\nDetects and reports:\n- Breaking changes in API spec\n- Removed functions\n- Modified signatures\n\n## Advanced Features\n\n### Custom Templates\n\nModify templates in `.openapi-generator/templates/` to customize generated code:\n\n- `connection.ex.mustache` - HTTP client configuration\n- `mix.exs.mustache` - Mix project file\n- `application.ex.mustache` - Application supervisor\n- `README.md.mustache` - Generated README\n\n### Protected Files\n\nFiles listed in `.openapi-generator-ignore` are never overwritten:\n\n- All configuration files\n- All tests\n- All scripts\n- Custom documentation\n\n### Post-Generation Processing\n\nEdit `scripts/post-generate.sh` to add custom post-processing:\n\n- Code transformations\n- Additional file generation\n- Custom validation\n\n## Testing\n\n### Run All Tests\n\n```bash\nmix test\n```\n\n### Run with Coverage\n\n```bash\nmix coveralls\nmix coveralls.html  # Generate HTML report\n```\n\n### Run Integration Tests Only\n\n```bash\nmix test test/integration/\n```\n\n### Run Specific Test\n\n```bash\nmix test test/unit/connection_test.exs\n```\n\n## Code Quality\n\n### Format Code\n\n```bash\nmix format\n```\n\n### Run Linter\n\n```bash\nmix credo --strict\n```\n\n### Run Type Checker\n\n```bash\nmix dialyzer\n```\n\n## Publishing\n\n### Manual Publishing\n\n```bash\n./scripts/publish.sh\n```\n\nThis script will:\n- Run all tests\n- Check code formatting\n- Verify version\n- Build documentation\n- Publish to Hex.pm\n- Create git tag\n\n### Automatic Publishing\n\nPush a version tag to trigger automatic publishing:\n\n```bash\n# Update version in mix.exs\ngit add mix.exs\ngit commit -m \"Bump version to 1.0.0\"\ngit tag v1.0.0\ngit push origin main --tags\n```\n\n## Configuration\n\n### Generator Config\n\nEdit `generator-config.yaml` to customize SDK generation:\n\n```yaml\nadditionalProperties:\n  packageName: \"my_api_client\"\n  moduleName: \"MyApiClient\"\n  packageVersion: \"1.0.0\"\n```\n\n### GitHub Secrets\n\nRequired secrets for workflows:\n\n- `HEX_API_KEY` - For publishing to Hex.pm (get from `mix hex.user auth`)\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\n\n## Resources\n\n- [OpenAPI Generator](https://openapi-generator.tech/)\n- [Elixir Tesla](https://github.com/elixir-tesla/tesla)\n- [Finch](https://github.com/sneako/finch)\n- [Hex.pm](https://hex.pm/)\n\n## Support\n\n- Open an issue on GitHub\n- Check existing issues for solutions\n- Review the documentation\n\n---\n\n**Generated with ❤️ using the Elixir SDK Generator Template**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoullette%2Felixir-sdk-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoullette%2Felixir-sdk-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoullette%2Felixir-sdk-generator/lists"}