{"id":18310942,"url":"https://github.com/jimschubert/pebble-template-engine-adapter","last_synced_at":"2025-04-09T12:10:37.393Z","repository":{"id":139902394,"uuid":"183856606","full_name":"jimschubert/pebble-template-engine-adapter","owner":"jimschubert","description":null,"archived":false,"fork":false,"pushed_at":"2020-06-17T17:46:30.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T05:46:38.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/jimschubert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2019-04-28T04:44:42.000Z","updated_at":"2020-06-17T17:46:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ee6f107-d54f-4426-b13a-6c97d6f6da25","html_url":"https://github.com/jimschubert/pebble-template-engine-adapter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fpebble-template-engine-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fpebble-template-engine-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fpebble-template-engine-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fpebble-template-engine-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimschubert","download_url":"https://codeload.github.com/jimschubert/pebble-template-engine-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036066,"owners_count":21037092,"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":[],"created_at":"2024-11-05T16:15:58.370Z","updated_at":"2025-04-09T12:10:37.374Z","avatar_url":"https://github.com/jimschubert.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pebble Template Engine Adapter\n\nThis project demonstrates how to use new experimental custom template engine support introduced in OpenAPI Generator 4.0.0.\n\nThe example templates provided here are minimal (as a full working template is irrelevant to the example) and do not result in functional code.\n\nFirst, compile a fatjar of this project.\n\n```\n./gradlew shadowJar\n```\n\nThen, create a template directory:\n\n```\nmkdir -p /tmp/pebble-example/templates\n```\n\nAnd put the following two templates in that directory:\n\napi.pebble\n```\npackage {{packageName}}\n\nimport (\n    \"net/http\"\n{% for item in imports %}\n    \"{{item.import}}\"\n{% endfor %}\n)\n\ntype Generated{{classname}}Servicer \n\n// etc\n\n```\n\nmodel.pebble\n```\npackage {{packageName}}\n{% for model in models %}\nDon't generate any model information :)\n{% endfor %}\n```\n\nYou'll need to reference the OpenAPI Generator CLI jar directly for the following. You can [download version 4.3.1 of the CLI directly](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar) or run the cli.sh script in this repository's root to cache locally (BONUS! you can later use this CLI script):\n\n```bash\nOPENAPI_GENERATOR_VERSION=4.3.1 ./cli.sh help\n```\n\nNext, compile a sample generator with the minimal templates from above:\n\n```\njava $JAVA_OPTS -cp \"${PWD}\"/build/libs/pebble-template-engine-adapter-1.0-SNAPSHOT-all.jar:\"${PWD}\"/openapi-generator-cli-4.3.1.jar \\\n    org.openapitools.codegen.OpenAPIGenerator \\\n    generate \\\n    -g go \\\n    -i ${YOUR_OPENAPI_DOC} \\\n    -e us.jimschubert.examples.engines.PebbleTemplateEngineAdapter \\\n    -o /tmp/pebble-example/out \\\n    -t /tmp/pebble-example/templates \\\n    -Dmodels -DmodelDocs=false -DmodelTests=false -Dapis -DapiTests=false -DapiDocs=false\n```\n\nFor reproducible command, you can evaluate the above with\n\n```bash\nexport YOUR_OPENAPI_DOC=https://raw.githubusercontent.com/OpenAPITools/openapi-generator/53eff431848291f294cdbd7941fe7ff8dedbaea2/modules/openapi-generator/src/test/resources/3_0/petstore.yaml\n```\n\nNow go check out your generated code at `/tmp/pebble-example/out/` which used your custom Pebble templates!\n\nRefer to https://pebbletemplates.io for more details about this templating syntax.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fpebble-template-engine-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimschubert%2Fpebble-template-engine-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fpebble-template-engine-adapter/lists"}