{"id":19834446,"url":"https://github.com/guardrail-dev/guardrail-maven-plugin","last_synced_at":"2025-05-01T17:31:11.599Z","repository":{"id":38359687,"uuid":"128263179","full_name":"guardrail-dev/guardrail-maven-plugin","owner":"guardrail-dev","description":"Principled code generation from OpenAPI specifications","archived":false,"fork":false,"pushed_at":"2024-05-05T14:23:22.000Z","size":315,"stargazers_count":2,"open_issues_count":16,"forks_count":6,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-07T18:27:52.280Z","etag":null,"topics":["codegen","guardrail","maven-plugin","openapi","swagger"],"latest_commit_sha":null,"homepage":"https://guardrail.dev","language":"Scala","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/guardrail-dev.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}},"created_at":"2018-04-05T20:54:27.000Z","updated_at":"2024-05-07T18:27:52.280Z","dependencies_parsed_at":"2023-12-27T08:21:53.967Z","dependency_job_id":"9bccf7cd-b6c7-4ea0-a5c7-864cdaaeca0f","html_url":"https://github.com/guardrail-dev/guardrail-maven-plugin","commit_stats":null,"previous_names":["twilio/guardrail-maven-plugin"],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardrail-dev%2Fguardrail-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardrail-dev%2Fguardrail-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardrail-dev%2Fguardrail-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardrail-dev%2Fguardrail-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guardrail-dev","download_url":"https://codeload.github.com/guardrail-dev/guardrail-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224270309,"owners_count":17283649,"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":["codegen","guardrail","maven-plugin","openapi","swagger"],"created_at":"2024-11-12T12:04:46.669Z","updated_at":"2024-11-12T12:04:47.256Z","avatar_url":"https://github.com/guardrail-dev.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"guardrail-maven-plugin\n======================\n\nA maven plugin for adding clients and servers generated by [guardrail](https://github.com/guardrail-dev/guardrail) to your service.\n\nThis plugin also supports publishing OpenAPI spec files to a maven server, and also consuming files via maven rather than through a local file.\n\nUsage\n-----\n\nAdd to your `pom.xml`:\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    ...\n    \u003cplugin\u003e\n      \u003cgroupId\u003edev.guardrail\u003c/groupId\u003e\n      \u003cartifactId\u003eguardrail-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003ePlease use the latest available release!\u003c/version\u003e\n      \u003cdependencies\u003e\n        \u003c!-- List the guardrail modules you wish to use. For more, see the module lists here: https://guardrail.dev/ --\u003e\n        \u003cdependency\u003e\n          \u003cgroupId\u003edev.guardrail\u003c/groupId\u003e\n          \u003cartifactId\u003eguardrail-java-dropwizard_2.13\u003c/artifactId\u003e  \u003c!-- SpringMVC also available! --\u003e\n          \u003cversion\u003e...\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n          \u003cgroupId\u003edev.guardrail\u003c/groupId\u003e\n          \u003cartifactId\u003eguardrail-java-async-http_2.13\u003c/artifactId\u003e\n          \u003cversion\u003e...\u003c/version\u003e\n        \u003c/dependency\u003e\n      \u003c/dependencies\u003e\n      \u003cexecutions\u003e\n        \u003c!-- This execution generates an API client from an OpenAPI spec file --\u003e\n        \u003cexecution\u003e\n          \u003cid\u003egenerate-petstore-client\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003egenerate-sources\u003c/goal\u003e\n          \u003c/goals\u003e\n          \u003cconfiguration\u003e\n            \u003clanguage\u003escala\u003c/language\u003e\n            \u003c!-- Generate from a local spec file --\u003e\n            \u003cspecPath\u003e${project.basedir}/src/main/swagger/example-client.yaml\u003c/specPath\u003e\n            \u003c!-- Or, generate from a spec file stored in a maven repository --\u003e\n            \u003cspecArtifact\u003e\n                \u003cgroupId\u003ecom.example\u003c/groupId\u003e\n                \u003cartifactId\u003eexample-client\u003c/artifactId\u003e\n                \u003cversion\u003e1.2.3\u003c/version\u003e\n            \u003c/specArtifact\u003e\n            \u003cpackageName\u003ecom.example.client\u003c/packageName\u003e\n          \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003c!-- This execution generates server resources/routes from an OpenAPI spec file --\u003e\n        \u003cexecution\u003e\n          \u003cid\u003egenerate-myservice-server\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003egenerate-sources\u003c/goal\u003e\n          \u003c/goals\u003e\n          \u003cconfiguration\u003e\n            \u003clanguage\u003escala\u003c/language\u003e\n            \u003cspecPath\u003e${project.basedir}/src/main/swagger/my-service.yaml\u003c/specPath\u003e\n            \u003cpackageName\u003ecom.example.server\u003c/packageName\u003e\n          \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003c!-- This execution publishes the server spec file to the maven server specified in \u003cdistributionManagement\u003e --\u003e\n        \u003cexecution\u003e\n          \u003cid\u003epublish-myservice-server\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003edeploy-openapi-spec\u003c/goal\u003e\n          \u003c/goals\u003e\n          \u003cconfiguration\u003e\n            \u003cspecPath\u003e${project.basedir}/src/main/swagger/my-service.yaml\u003c/specPath\u003e\n            \u003cgroupId\u003ecom.example\u003c/groupId\u003e\n            \u003cartifactId\u003emy-service\u003c/artifactId\u003e\n          \u003c/configuration\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n    ...\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n## Configuration\n\nTo generate multiple clients, specify multiple `\u003cexecution\u003e` sections.\n\n### Code Generation\n\n| Parameter Name | Description |\n|:---------------|:------------|\n| outputPath | Location of generated classes (defaults to `${project.build.directory}/generated-sources/swagger-clients`) |\n| language | Which language to generate (defaults to `scala` currently, will change to `java` in the future. Valid values are: `java`, `scala`) |\n| kind | What kind of code should be generated (defaults to `client`. Valid values are: `client`, `server`, `models`) |\n| specPath | Location of the swagger specification file |\n| specArtifact | Sub-object used to specify the location of the swagger specification in a maven repository (see below) |\n| packageName | Package name to use for the generated classes |\n| dtoPackage | Package name for the data transfer objects (defaults to same as `packageName`) |\n| tracing | Whether or not to generate clients that accept a `TracingContext` which will send tracing headers to the remote service (defaults to `false`) |\n| modules | A list of `\u003cmodule\u003e`s that describe the set of functionality desired for an individual guardrail execution |\n| customImports | A list of `\u003ccustomImport\u003e`s that will be added to the top of all generated files. Useful for providing additional typeclass instances or domain-specific types |\n| framework | The framework to generate the code for (defaults to `akka-http`) |\n\nOnly one of `specPath` or `specArtifact` should be provided; if both are provided, `specPath` will be used.\n\n#### `specArtifact`\n\nThe `specArtifact` parameter is a sub-object that contains the following parameters:\n\n| Parameter Name | Description |\n|:---------------|:------------|\n| groupId | Maven group ID of the published artifact (defaults to project's groupID) |\n| artifactId | Maven artifact ID of the published artifact |\n| version | Version of the published artifact |\n| extension | File extension of the published artifact (default is to try, in order: 'yaml', 'yml', 'json') |\n| type | Maven artifact type of the published artifact (defaults to 'openapi-spec') |\n| classifier | Maven artifact classifier of the published artifact (defaults to 'openapi-spec') |\n\n### Spec Publishing\n\n| Parameter Name | Description |\n|:---------------|:------------|\n| specPath | Location of the swagger specification file |\n| groupId | Maven group ID used when publishing (defaults to the project POM group ID) |\n| artifactId | Maven artifact ID used when publishing (defaults to the project POM artifact ID) |\n| type | Maven artifact type used when publishing (defaults to 'openapi-spec') |\n| classifier | Maven artifact classifier used when publishing (defaults to 'openapi-spec') |\n\n### General\n\nThe plugin also interprets a single system property:\n\n| Property | Description |\n|:---------|:------------|\n| `guardrail.loglevel` | Changes Guardrail's log level.  Possible options are \"debug\", \"info\", \"warning\" (the default), \"error\", and \"silent\". |\n| `guardrail.codegen.skip` | When set to `true`, skips generating code. |\n| `guardrail.deploy.skip` | When set to `true`, skips deploying the OpenAPI spec file. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardrail-dev%2Fguardrail-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguardrail-dev%2Fguardrail-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardrail-dev%2Fguardrail-maven-plugin/lists"}