{"id":20660914,"url":"https://github.com/openfeign/feign-form","last_synced_at":"2025-09-10T13:31:57.708Z","repository":{"id":8276304,"uuid":"57595846","full_name":"OpenFeign/feign-form","owner":"OpenFeign","description":"Open Feign form encoder","archived":true,"fork":false,"pushed_at":"2024-09-22T22:22:46.000Z","size":479,"stargazers_count":297,"open_issues_count":49,"forks_count":82,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-08T12:48:04.238Z","etag":null,"topics":["feign","http","java","rest"],"latest_commit_sha":null,"homepage":"","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/OpenFeign.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":"2016-05-01T11:28:03.000Z","updated_at":"2025-07-02T09:38:13.000Z","dependencies_parsed_at":"2024-06-21T02:13:53.890Z","dependency_job_id":"5080867c-bef3-440b-829e-3c71dc27b093","html_url":"https://github.com/OpenFeign/feign-form","commit_stats":{"total_commits":91,"total_committers":16,"mean_commits":5.6875,"dds":0.6263736263736264,"last_synced_commit":"4c5cfc7854a7bea13563c0dc951185983903fc4d"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/OpenFeign/feign-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenFeign%2Ffeign-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenFeign%2Ffeign-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenFeign%2Ffeign-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenFeign%2Ffeign-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenFeign","download_url":"https://codeload.github.com/OpenFeign/feign-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenFeign%2Ffeign-form/sbom","scorecard":{"id":105258,"data":{"date":"2025-08-11","repo":{"name":"github.com/OpenFeign/feign-form","commit":"4c5cfc7854a7bea13563c0dc951185983903fc4d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 3.8.0 not signed: https://api.github.com/repos/OpenFeign/feign-form/releases/16446999","Warn: release artifact 3.7.0 not signed: https://api.github.com/repos/OpenFeign/feign-form/releases/15882330","Warn: release artifact 3.5.0 not signed: https://api.github.com/repos/OpenFeign/feign-form/releases/14684057","Warn: release artifact 3.4.1 not signed: https://api.github.com/repos/OpenFeign/feign-form/releases/13705629","Warn: release artifact 3.8.0 does not have provenance: https://api.github.com/repos/OpenFeign/feign-form/releases/16446999","Warn: release artifact 3.7.0 does not have provenance: https://api.github.com/repos/OpenFeign/feign-form/releases/15882330","Warn: release artifact 3.5.0 does not have provenance: https://api.github.com/repos/OpenFeign/feign-form/releases/14684057","Warn: release artifact 3.4.1 does not have provenance: https://api.github.com/repos/OpenFeign/feign-form/releases/13705629"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T10:58:44.356Z","repository_id":8276304,"created_at":"2025-08-15T10:58:44.356Z","updated_at":"2025-08-15T10:58:44.356Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274470374,"owners_count":25291604,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["feign","http","java","rest"],"created_at":"2024-11-16T19:06:30.576Z","updated_at":"2025-09-10T13:31:57.353Z","avatar_url":"https://github.com/OpenFeign.png","language":"Java","readme":"# Form Encoder\n\n\u003e **IMPORTANT**: the repository is inactive and was merged with the main feign project.\n\n[![build_status](https://travis-ci.org/OpenFeign/feign-form.svg?branch=master)](https://travis-ci.org/OpenFeign/feign-form)\n[![maven_central](https://maven-badges.herokuapp.com/maven-central/io.github.openfeign.form/feign-form/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.openfeign.form/feign-form)\n[![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\nThis module adds support for encoding **application/x-www-form-urlencoded** and **multipart/form-data** forms.\n\n## Add dependency\n\nInclude the dependency to your app:\n\n**Maven**:\n\n```xml\n\u003cdependencies\u003e\n  ...\n  \u003cdependency\u003e\n    \u003cgroupId\u003eio.github.openfeign.form\u003c/groupId\u003e\n    \u003cartifactId\u003efeign-form\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.0\u003c/version\u003e\n  \u003c/dependency\u003e\n  ...\n\u003c/dependencies\u003e\n```\n\n**Gradle**:\n\n```groovy\ncompile 'io.github.openfeign.form:feign-form:4.0.0'\n```\n\n## Requirements\n\nThe `feign-form` extension depend on `OpenFeign` and its *concrete* versions:\n\n- all `feign-form` releases before **3.5.0** works with `OpenFeign` **9.\\*** versions;\n- starting from `feign-form`'s version **3.5.0**, the module works with `OpenFeign` **10.1.0** versions and greater.\n\n\u003e **IMPORTANT:** there is no backward compatibility and no any gurantee that the `feign-form`'s versions after **3.5.0** work with `OpenFeign` before **10.\\***. `OpenFeign` was refactored in 10th release, so the best approach - use the freshest `OpenFeign` and `feign-form` versions.\n\nNotes:\n\n- [spring-cloud-openfeign](https://github.com/spring-cloud/spring-cloud-openfeign) uses `OpenFeign` **9.\\*** till **v2.0.3.RELEASE** and uses **10.\\*** after. Anyway, the dependency already has suitable `feign-form` version, see [dependency pom](https://github.com/spring-cloud/spring-cloud-openfeign/blob/master/spring-cloud-openfeign-dependencies/pom.xml#L19), so you don't need to specify it separately;\n\n- `spring-cloud-starter-feign` is a **deprecated** dependency and it always uses the `OpenFeign`'s **9.\\*** versions.\n\n## Usage\n\nAdd `FormEncoder` to your `Feign.Builder` like so:\n\n```java\nSomeApi github = Feign.builder()\n                      .encoder(new FormEncoder())\n                      .target(SomeApi.class, \"http://api.some.org\");\n```\n\nMoreover, you can decorate the existing encoder, for example JsonEncoder like this:\n\n```java\nSomeApi github = Feign.builder()\n                      .encoder(new FormEncoder(new JacksonEncoder()))\n                      .target(SomeApi.class, \"http://api.some.org\");\n```\n\nAnd use them together:\n\n```java\ninterface SomeApi {\n\n  @RequestLine(\"POST /json\")\n  @Headers(\"Content-Type: application/json\")\n  void json (Dto dto);\n\n  @RequestLine(\"POST /form\")\n  @Headers(\"Content-Type: application/x-www-form-urlencoded\")\n  void from (@Param(\"field1\") String field1, @Param(\"field2\") String[] values);\n}\n```\n\nYou can specify two types of encoding forms by `Content-Type` header.\n\n### application/x-www-form-urlencoded\n\n```java\ninterface SomeApi {\n\n  @RequestLine(\"POST /authorization\")\n  @Headers(\"Content-Type: application/x-www-form-urlencoded\")\n  void authorization (@Param(\"email\") String email, @Param(\"password\") String password);\n\n  // Group all parameters within a POJO\n  @RequestLine(\"POST /user\")\n  @Headers(\"Content-Type: application/x-www-form-urlencoded\")\n  void addUser (User user);\n\n  class User {\n\n    Integer id;\n\n    String name;\n  }\n}\n```\n\n### multipart/form-data\n\n```java\ninterface SomeApi {\n\n  // File parameter\n  @RequestLine(\"POST /send_photo\")\n  @Headers(\"Content-Type: multipart/form-data\")\n  void sendPhoto (@Param(\"is_public\") Boolean isPublic, @Param(\"photo\") File photo);\n\n  // byte[] parameter\n  @RequestLine(\"POST /send_photo\")\n  @Headers(\"Content-Type: multipart/form-data\")\n  void sendPhoto (@Param(\"is_public\") Boolean isPublic, @Param(\"photo\") byte[] photo);\n\n  // FormData parameter\n  @RequestLine(\"POST /send_photo\")\n  @Headers(\"Content-Type: multipart/form-data\")\n  void sendPhoto (@Param(\"is_public\") Boolean isPublic, @Param(\"photo\") FormData photo);\n\n  // Group all parameters within a POJO\n  @RequestLine(\"POST /send_photo\")\n  @Headers(\"Content-Type: multipart/form-data\")\n  void sendPhoto (MyPojo pojo);\n\n  class MyPojo {\n\n    @FormProperty(\"is_public\")\n    Boolean isPublic;\n\n    File photo;\n  }\n}\n```\n\nIn the example above, the `sendPhoto` method uses the `photo` parameter using three different supported types.\n\n* `File` will use the File's extension to detect the `Content-Type`;\n* `byte[]` will use `application/octet-stream` as `Content-Type`;\n* `FormData` will use the `FormData`'s `Content-Type` and `fileName`;\n* Client's custom POJO for grouping parameters (including types above).\n\n`FormData` is custom object that wraps a `byte[]` and defines a `Content-Type` and `fileName` like this:\n\n```java\n  FormData formData = new FormData(\"image/png\", \"filename.png\", myDataAsByteArray);\n  someApi.sendPhoto(true, formData);\n```\n\n### Spring MultipartFile and Spring Cloud Netflix @FeignClient support\n\nYou can also use Form Encoder with Spring `MultipartFile` and `@FeignClient`.\n\nInclude the dependencies to your project's pom.xml file:\n\n```xml\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eio.github.openfeign.form\u003c/groupId\u003e\n    \u003cartifactId\u003efeign-form\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.0\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eio.github.openfeign.form\u003c/groupId\u003e\n    \u003cartifactId\u003efeign-form-spring\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.0\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n```java\n@FeignClient(\n    name = \"file-upload-service\",\n    configuration = FileUploadServiceClient.MultipartSupportConfig.class\n)\npublic interface FileUploadServiceClient extends IFileUploadServiceClient {\n\n  public class MultipartSupportConfig {\n\n    @Autowired\n    private ObjectFactory\u003cHttpMessageConverters\u003e messageConverters;\n\n    @Bean\n    public Encoder feignFormEncoder () {\n      return new SpringFormEncoder(new SpringEncoder(messageConverters));\n    }\n  }\n}\n```\n\nOr, if you don't need Spring's standard encoder:\n\n```java\n@FeignClient(\n    name = \"file-upload-service\",\n    configuration = FileUploadServiceClient.MultipartSupportConfig.class\n)\npublic interface FileUploadServiceClient extends IFileUploadServiceClient {\n\n  public class MultipartSupportConfig {\n\n    @Bean\n    public Encoder feignFormEncoder () {\n      return new SpringFormEncoder();\n    }\n  }\n}\n```\n\nThanks to [tf-haotri-pham](https://github.com/tf-haotri-pham) for his feature, which makes use of Apache commons-fileupload library, which handles the parsing of the multipart response. The body data parts are held as byte arrays in memory.\n\nTo use this feature, include SpringManyMultipartFilesReader in the list of message converters for the Decoder and have the Feign client return an array of MultipartFile:\n\n```java\n@FeignClient(\n    name = \"${feign.name}\",\n    url = \"${feign.url}\"\n    configuration = DownloadClient.ClientConfiguration.class\n)\npublic interface DownloadClient {\n\n  @RequestMapping(\"/multipart/download/{fileId}\")\n  MultipartFile[] download(@PathVariable(\"fileId\") String fileId);\n\n  class ClientConfiguration {\n\n    @Autowired\n    private ObjectFactory\u003cHttpMessageConverters\u003e messageConverters;\n\n    @Bean\n    public Decoder feignDecoder () {\n      List\u003cHttpMessageConverter\u003c?\u003e\u003e springConverters =\n            messageConverters.getObject().getConverters();\n\n      List\u003cHttpMessageConverter\u003c?\u003e\u003e decoderConverters =\n            new ArrayList\u003cHttpMessageConverter\u003c?\u003e\u003e(springConverters.size() + 1);\n\n      decoderConverters.addAll(springConverters);\n      decoderConverters.add(new SpringManyMultipartFilesReader(4096));\n\n      HttpMessageConverters httpMessageConverters = new HttpMessageConverters(decoderConverters);\n\n      return new SpringDecoder(new ObjectFactory\u003cHttpMessageConverters\u003e() {\n\n        @Override\n        public HttpMessageConverters getObject() {\n          return httpMessageConverters;\n        }\n      });\n    }\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfeign%2Ffeign-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfeign%2Ffeign-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfeign%2Ffeign-form/lists"}