{"id":18310911,"url":"https://github.com/jimschubert/sbt-local-generator","last_synced_at":"2026-01-20T06:32:50.485Z","repository":{"id":139902406,"uuid":"271689039","full_name":"jimschubert/sbt-local-generator","owner":"jimschubert","description":"Example SBT project with custom generator local to the project (no need for SBT plugin)","archived":false,"fork":false,"pushed_at":"2020-06-12T02:20:41.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T12:11:12.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimschubert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-06-12T02:19:27.000Z","updated_at":"2020-06-12T02:20:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"358408ef-c91e-4bbe-8c07-3b1a3a3c7186","html_url":"https://github.com/jimschubert/sbt-local-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jimschubert/sbt-local-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fsbt-local-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fsbt-local-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fsbt-local-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fsbt-local-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimschubert","download_url":"https://codeload.github.com/jimschubert/sbt-local-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fsbt-local-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28597638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"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":[],"created_at":"2024-11-05T16:15:51.534Z","updated_at":"2026-01-20T06:32:50.470Z","avatar_url":"https://github.com/jimschubert.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbt-local-generator\n\nYou may not necessarily need the sbt-openapi-generator plugin to add code generation to your app. You may prefer to:\n\n* Include your custom code generator in the same repository as your application code\n* Have full control over configuration parsing and generation\n* Create your own configuration tasks and settings\n* Reduce the plugin lifecycle in your application\n\nThis example shows how to add a custom generator and custom templates to your Scala project without pulling in the SBT Plugin.\n\nThis _does_ still require openapi-generator. However, it demonstrates how to solve an issue where OpenAPI Generator expects to\nbe able to load your custom generator via SPI (via classpath). SBT makes this very difficult, and there's been an\n[issue open since 2017](https://github.com/sbt/sbt/issues/3498) regarding this.\n\nWe need to circumvent that funky SBT classpath behavior.\n\nThis example shows how to:\n\n* Load a YAML document from the repository root (following a spec-driven design approach)\n* Reference openapi-generator as a build-time dependency (see `project/build.sbt`) \n* Define a custom generator in the meta-build project at `project/CustomGenerator`\n  - This custom generator adds a Google Analytics key support to the static html generator built-in to OpenAPI Generator\n* Load your custom generator without the ability or need to modify classpath of the meta-build project\n* Load your custom templates using SBT's path resolution via the `baseDirectory` setting\n* Define a custom task called `codegen`, which could be chained to other tasks. Please refer to SBT's docs.\n\n## Build\n\nTo build, run:\n\n```\nsbt codegen\n```\n\nThis creates a `docs` directory in your project root.\n\nThe example codegen sets a Google Analytics key in the generated html of `GA-123456789`. Verify generation like so:\n\n```shell\n$ grep GA-123456789 docs/index.html\n      ga('create','GA-123456789','auto');ga('send','pageview');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fsbt-local-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimschubert%2Fsbt-local-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fsbt-local-generator/lists"}