{"id":20347237,"url":"https://github.com/1000kit/tkit-mp-restclient-plugin","last_synced_at":"2025-05-08T04:30:55.909Z","repository":{"id":59308697,"uuid":"536544598","full_name":"1000kit/tkit-mp-restclient-plugin","owner":"1000kit","description":"1000kit microprofile rest client generator plugin","archived":true,"fork":false,"pushed_at":"2023-03-20T19:12:09.000Z","size":94,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-04T16:12:26.946Z","etag":null,"topics":["maven-plugin","microprofile","quarkus"],"latest_commit_sha":null,"homepage":"https://github.com/1000kit/tkit-mp-restclient-plugin","language":"Java","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/1000kit.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}},"created_at":"2022-09-14T11:23:20.000Z","updated_at":"2024-06-10T09:07:54.000Z","dependencies_parsed_at":"2023-02-01T03:45:58.580Z","dependency_job_id":null,"html_url":"https://github.com/1000kit/tkit-mp-restclient-plugin","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000kit%2Ftkit-mp-restclient-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000kit%2Ftkit-mp-restclient-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000kit%2Ftkit-mp-restclient-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000kit%2Ftkit-mp-restclient-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1000kit","download_url":"https://codeload.github.com/1000kit/tkit-mp-restclient-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252999339,"owners_count":21838199,"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":["maven-plugin","microprofile","quarkus"],"created_at":"2024-11-14T22:15:48.200Z","updated_at":"2025-05-08T04:30:55.616Z","avatar_url":"https://github.com/1000kit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This plugin is **deprecated** please use [quarkus-openapi-generator](https://github.com/quarkiverse/quarkus-openapi-generator)\n\n# tkit-mp-rest-client-plugin\n\nTkit microprofile  rest client generator plugin\n\n[![License](https://img.shields.io/badge/license-Apache--2.0-green?style=for-the-badge\u0026logo=apache)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Maven Central](https://img.shields.io/maven-central/v/org.tkit.maven/tkit-mp-restclient-plugin?logo=java\u0026style=for-the-badge)](https://maven-badges.herokuapp.com/maven-central/org.tkit.maven/tkit-mp-restclient-plugin)\n[![GitHub Actions Status](\u003chttps://img.shields.io/github/workflow/status/1000kit/tkit-mp-restclient-plugin/build?logo=GitHub\u0026style=for-the-badge\u003e)](https://github.com/1000kit/tkit-mp-restclient-plugin/actions/workflows/build.yml)\n\n\u003e Version 0.15.0 new configuration preserveEnumCase. By default false, if set to true:\n  - Generated enum names are case-sensitive, not forced uppercase anymore\n  - Common prefix enum name removal is disabled https://github.com/swagger-api/swagger-codegen/issues/5932\n\n\u003e Version 0.14.0 fieldGen LOMBOK_GET_SET for @Getter@/Setter annotation only\n\n\u003e Version 0.12.0+ fix groupByTags feature\n\n\u003e Version 0.9.0+ add support for query params provided as a component ref.\n\n\u003e Version 0.8.0+ add support for `RestController` class and proxy implementation.\n\n\u003e Version 0.7.0+ contains check for generated files. If the generator generated more files with the same\n\u003e name the generator throws exception. The combination of the parameters `apiName`, `pathPrefix` or `groupByTags` is use to generate\n\u003e corresponding java classes for the openAPI schema.\n\nExample combination\n* default configuration generated file for each REST path. `/admin/name`, `/admin` and `/user/name` will generate\ntwo java classes `AdminRestClient` and `UserRestClient`\n* if you add only `apiName=User` generator creates one java class `UserRestClient` for all REST method in openAPI schema.  \n* `apiName=MyRest` and `pathPrefix=/admin` will generated one file `MyRestRestClient` for all REST method which start with `/admin` or `admin` path.\n* `apiName=MyRest` and `pathPrefix=/` will generated one file with all REST method. This is equals to setting only the `apiName` parameter. \n* if you set the `groupByTags` to `true` the generator will group the REST api by the tags in the openAPI schema. This \nis default swagger generator but it could generated wrong java classes; depend on your openAPI schema and the parameter \n`apiName` and `pathPrefix` will be ignored.\n\n\u003e Method of the java class are base on the `operationId`. If there are multiple `operationId` methods in the java class the tag \n\u003e of the operation is add as prefix to the method. If there are multiple `tag`+ `operationId` methods in the java class \n\u003e generator will add suffix `_\u003cnumber\u003e` to the method.\n \n## Goal: codegen - RestClient\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.tkit.maven\u003c/groupId\u003e\n    \u003cartifactId\u003etkit-mp-restclient-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.8.0\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003etest\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003ecodegen\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cinputSpec\u003esrc/main/resources/clients/openapi.yaml\u003c/inputSpec\u003e\n                \u003coutput\u003e${project.build.directory}/generated-sources/mprestclient\u003c/output\u003e\n                \u003capiPackage\u003egen.org.tkit.test\u003c/apiPackage\u003e\n                \u003cmodelPackage\u003egen.org.tkit.test.models\u003c/modelPackage\u003e\n                \u003cgenerateSupportingFiles\u003efalse\u003c/generateSupportingFiles\u003e\n                \u003capiInterfaceDoc\u003efalse\u003c/apiInterfaceDoc\u003e\n                \u003cfieldGen\u003eLOMBOK\u003c/fieldGen\u003e\n                \u003cjsonLib\u003eJACKSON\u003c/jsonLib\u003e                \n                \u003cannotations\u003e\n                    \u003cannotation\u003ejavax.inject.Singleton\u003c/annotation\u003e\n                    \u003cannotation\u003eorg.tkit.quarkus.log.interceptor.LoggerService\u003c/annotation\u003e\n                    \u003cannotation\u003eorg.eclipse.microprofile.rest.client.inject.RegisterRestClient(configKey=\"my-client-key\")\u003c/annotation\u003e\n                \u003c/annotations\u003e\n                \u003cmodelAnnotations\u003e\n                    \u003cmodelAnnotation\u003elombok.ToString\u003c/modelAnnotation\u003e\n                    \u003cmodelAnnotation\u003eio.quarkus.runtime.annotations.RegisterForReflection\u003c/modelAnnotation\u003e\n                \u003c/modelAnnotations\u003e\n                \u003cconfigOptions\u003e\n                    \u003csourceFolder\u003etest\u003c/sourceFolder\u003e\n                \u003c/configOptions\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n## Goal: codegen - RestController\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.tkit.maven\u003c/groupId\u003e\n    \u003cartifactId\u003etkit-mp-restclient-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.8.0\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003euser\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003ecodegen\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cinputSpec\u003esrc/main/resources/META-INF/openapi.yaml\u003c/inputSpec\u003e\n                \u003coutput\u003e${project.build.directory}/generated-sources/endpoints\u003c/output\u003e\n                \u003capiPackage\u003eorg.tkit.test.rs.internal\u003c/apiPackage\u003e\n                \u003cmodelPackage\u003eorg.tkit.test.rs.internal.models\u003c/modelPackage\u003e\n                \u003cgenerateSupportingFiles\u003efalse\u003c/generateSupportingFiles\u003e\n                \u003capiInterfaceDoc\u003efalse\u003c/apiInterfaceDoc\u003e\n                \u003cinterfaceOnly\u003efalse\u003c/interfaceOnly\u003e\n                \u003capiSuffix\u003eRestController\u003c/apiSuffix\u003e\n                \u003cfieldGen\u003eLOMBOK\u003c/fieldGen\u003e\n                \u003cjsonLib\u003eJACKSON\u003c/jsonLib\u003e                \n                \u003cannotations\u003e\n                    \u003cannotation\u003ejavax.enterprise.context.ApplicationScoped\u003c/annotation\u003e\n                \u003c/annotations\u003e\n                \u003cmodelAnnotations\u003e\n                    \u003cmodelAnnotation\u003elombok.ToString\u003c/modelAnnotation\u003e\n                    \u003cmodelAnnotation\u003eio.quarkus.runtime.annotations.RegisterForReflection\u003c/modelAnnotation\u003e\n                \u003c/modelAnnotations\u003e\n                \u003cconfigOptions\u003e\n                    \u003csourceFolder\u003euser\u003c/sourceFolder\u003e\n                \u003c/configOptions\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n## Goal: codegen - Proxy\n\n\u003e The `implType=PROXY` will generate the proxy REST endpoint. For this implementation you need\n\u003e to add the `proxyClientClass` which is the RestClient class and the `modelPackage` needs to have\n\u003e the same value like the `RestClient`.\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.tkit.maven\u003c/groupId\u003e\n    \u003cartifactId\u003etkit-mp-restclient-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.8.0\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003euser-client\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003ecodegen\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cinputSpec\u003esrc/main/resources/user/openapi.yaml\u003c/inputSpec\u003e\n                \u003coutput\u003e${project.build.directory}/generated-sources/restclients\u003c/output\u003e\n                \u003capiPackage\u003eorg.tkit.user.rs.proxy\u003c/apiPackage\u003e\n                \u003cmodelPackage\u003eorg.tkit.user.rs.proxy.models\u003c/modelPackage\u003e\n                \u003cgenerateSupportingFiles\u003efalse\u003c/generateSupportingFiles\u003e\n                \u003capiInterfaceDoc\u003efalse\u003c/apiInterfaceDoc\u003e\n                \u003cfieldGen\u003eLOMBOK\u003c/fieldGen\u003e\n                \u003cjsonLib\u003eJACKSON\u003c/jsonLib\u003e\n                \u003cannotations\u003e\n                    \u003cannotation\u003ejavax.inject.Singleton\u003c/annotation\u003e\n                    \u003cannotation\u003eorg.tkit.quarkus.log.interceptor.LoggerService\u003c/annotation\u003e\n                    \u003cannotation\u003eorg.eclipse.microprofile.rest.client.inject.RegisterRestClient(configKey=\"my-client-key\")\u003c/annotation\u003e\n                \u003c/annotations\u003e\n                \u003cmodelAnnotations\u003e\n                    \u003cmodelAnnotation\u003elombok.ToString\u003c/modelAnnotation\u003e\n                    \u003cmodelAnnotation\u003eio.quarkus.runtime.annotations.RegisterForReflection\u003c/modelAnnotation\u003e\n                \u003c/modelAnnotations\u003e\n                \u003cconfigOptions\u003e\n                    \u003csourceFolder\u003euser\u003c/sourceFolder\u003e\n                \u003c/configOptions\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n            \u003cid\u003euser-proxy\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003ecodegen\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cinputSpec\u003esrc/main/resources/user/openapi.yaml\u003c/inputSpec\u003e\n                \u003coutput\u003e${project.build.directory}/generated-sources/endpoints\u003c/output\u003e\n                \u003capiPackage\u003eorg.tkit.user.rs.proxy\u003c/apiPackage\u003e\n                \u003cmodelPackage\u003eorg.tkit.user.rs.proxy.models\u003c/modelPackage\u003e\n                \u003cgenerateSupportingFiles\u003efalse\u003c/generateSupportingFiles\u003e\n                \u003capiInterfaceDoc\u003efalse\u003c/apiInterfaceDoc\u003e\n                \u003cinterfaceOnly\u003efalse\u003c/interfaceOnly\u003e\n                \u003cimplType\u003ePROXY\u003c/implType\u003e\n                \u003cfieldGen\u003eLOMBOK\u003c/fieldGen\u003e\n                \u003cjsonLib\u003eJACKSON\u003c/jsonLib\u003e\n                \u003capiSuffix\u003eRestController\u003c/apiSuffix\u003e\n                \u003cproxyClientClass\u003eUsersRestClient\u003c/proxyClientClass\u003e\n                \u003cannotations\u003e\n                    \u003cannotation\u003ejavax.enterprise.context.ApplicationScoped\u003c/annotation\u003e\n                \u003c/annotations\u003e\n                \u003cmodelAnnotations\u003e\n                    \u003cmodelAnnotation\u003elombok.ToString\u003c/modelAnnotation\u003e\n                    \u003cmodelAnnotation\u003eio.quarkus.runtime.annotations.RegisterForReflection\u003c/modelAnnotation\u003e\n                \u003c/modelAnnotations\u003e\n                \u003cconfigOptions\u003e\n                    \u003csourceFolder\u003euser\u003c/sourceFolder\u003e\n                \u003c/configOptions\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n## Parameters\n\nThe plugin extends the parameter from: [Swagger maven plugin](https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin)\nExtended parameters:\n\n|  Name | Default    | Values | Description                                                                                                                                                                                                                                               |\n|---|------------|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| modelPackage |            | | The package name of the models                                                                                                                                                                                                                            |\n| apiPackage |            | | The package name of the `RestClient` or `RestController`                                                                                                                                                                                                  |\n| formatter | true       | | The google source code formatter                                                                                                                                                                                                                          |\n| apiName |            | | The api name if this is set the generator will generate one file for all REST method                                                                                                                                                                      |\n| interfaceOnly | true       | | Generate the interface only. If you need to generate `RestController` set this attribute to `false`                                                                                                                                                       |\n| implType | CLASS      | CLASS,INTERFACE,PROXY | This attribute is use only for `interfaceOnly=false`. The default implementation `CLASS` will generate the class with `Response 501` for each method. The `INTERFACE` value will generate the interface with default method implementation `Response 501` |\n| pathPrefix |            | | The path prefix for all interfaces. Example 'v2/' or '/'. REST method which starts not with this prefix will be ignored.                                                                                                                                  |\n| apiSuffix | RestClient | | The api interface suffix                                                                                                                                                                                                                                  |\n| annotations |            | | The list of custom annotations for the interface.                                                                                                                                                                                                         |\n| modelAnnotations |            | | The list of custom annotations for the model.                                                                                                                                                                                                             |\n| restClient | true       | | The flag to generate the micro-profile rest client for the interface.                                                                                                                                                                                     |\n| returnResponse | true       | | The return type will be the Response.                                                                                                                                                                                                                     |\n| beanParamSuffix | BeanParam  | | The bean parameter suffix.                                                                                                                                                                                                                                |\n| beanParamCount | 9          | | The number of the parameters to group by the bean parameter.                                                                                                                                                                                              |\n| jsonLib | JSONB      | JACKSON,JSONB | The JSON implementation.                                                                                                                                                                                                                                  |\n| fieldGen | PUBLIC     | LOMBOK,GET_SET,PUBLIC | The model field generator type.                                                                                                                                                                                                                           |\n| dateLibrary | java8      | | The date library.                                                                                                                                                                                                                                         |\n| useBeanValidation | true       | | Use the bean validation on the methods.                                                                                                                                                                                                                   |\n| apiInterfaceDoc | true       | | Generate the micro-profile annotation on the generated interface.                                                                                                                                                                                         |\n| groupByTags | false      | | Group the REST in the openAPI schema by tags (Default by swagger). Default is false to group the REST method by path                                                                                                                                      |\n| basePathPrefix |            | | Add in the case basePath defined in swagger contains additional part which is not included in context root. Example `basePath=/ms-rs/v2/` then add `v2/`                                                                                                  |\n| preserveEnumCase | false      | | Preserve enum case names. If false (default) enum names are always uppercase and common prefix names are removed.                                                                                                                                         |\n\n## Release\n\n### Create a release\n\n```bash\nmvn semver-release:release-create\n```\n\n### Create a patch branch\n```bash\nmvn semver-release:patch-create -DpatchVersion=x.x.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1000kit%2Ftkit-mp-restclient-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1000kit%2Ftkit-mp-restclient-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1000kit%2Ftkit-mp-restclient-plugin/lists"}