{"id":15835144,"url":"https://github.com/kaelzhang/java-fastjson-protobuf","last_synced_at":"2026-05-05T07:32:37.733Z","repository":{"id":57714863,"uuid":"145851463","full_name":"kaelzhang/java-fastjson-protobuf","owner":"kaelzhang","description":"Spring `HttpMessageConverter` implementation with Alibaba FastJson and serializer/deserializer of Protobuf Messages.","archived":false,"fork":false,"pushed_at":"2019-04-12T11:00:32.000Z","size":98,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-07T21:38:56.842Z","etag":null,"topics":["fastjson","fastjson-android","grpc","java","protobuf"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaelzhang.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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":"2018-08-23T12:37:37.000Z","updated_at":"2024-12-09T19:53:02.000Z","dependencies_parsed_at":"2022-09-02T22:00:40.686Z","dependency_job_id":null,"html_url":"https://github.com/kaelzhang/java-fastjson-protobuf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kaelzhang/java-fastjson-protobuf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fjava-fastjson-protobuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fjava-fastjson-protobuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fjava-fastjson-protobuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fjava-fastjson-protobuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/java-fastjson-protobuf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fjava-fastjson-protobuf/sbom","scorecard":{"id":547110,"data":{"date":"2025-08-11","repo":{"name":"github.com/kaelzhang/java-fastjson-protobuf","commit":"cdec345c931cd3aad35956023854dd9f0fde26ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"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":"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":"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"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":-1,"reason":"no releases found","details":null,"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"}}]},"last_synced_at":"2025-08-20T09:49:15.549Z","repository_id":57714863,"created_at":"2025-08-20T09:49:15.549Z","updated_at":"2025-08-20T09:49:15.549Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["fastjson","fastjson-android","grpc","java","protobuf"],"created_at":"2024-10-05T14:21:00.619Z","updated_at":"2026-05-05T07:32:37.716Z","avatar_url":"https://github.com/kaelzhang.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/kaelzhang/java-fastjson-protobuf.svg?branch=master)](https://travis-ci.org/kaelzhang/java-fastjson-protobuf)\n[![Coverage](https://codecov.io/gh/kaelzhang/java-fastjson-protobuf/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/java-fastjson-protobuf)\n[![Maven Version](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/ai/ost/fastjson-protobuf/maven-metadata.xml.svg)](https://github.com/kaelzhang/java-fastjson-protobuf)\n\u003c!-- optional appveyor tst\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/java-fastjson-protobuf?branch=master\u0026svg=true)](https://ci.appveyor.com/project/kaelzhang/java-fastjson-protobuf)\n--\u003e\n\u003c!-- optional npm version\n[![NPM version](https://badge.fury.io/js/java-fastjson-protobuf.svg)](http://badge.fury.io/js/java-fastjson-protobuf)\n--\u003e\n\u003c!-- optional npm downloads\n[![npm module downloads per month](http://img.shields.io/npm/dm/java-fastjson-protobuf.svg)](https://www.npmjs.org/package/java-fastjson-protobuf)\n--\u003e\n\u003c!-- optional dependency status\n[![Dependency Status](https://david-dm.org/kaelzhang/java-fastjson-protobuf.svg)](https://david-dm.org/kaelzhang/java-fastjson-protobuf)\n--\u003e\n\n# fastjson-protobuf\n\nSpring `HttpMessageConverter` implementation with Alibaba FastJson and serializer/deserializer of Protobuf Messages.\n\nWith `fastjson-protobuf`, we can use protocol buffers to define both request and response entities.\n\nOnly **proto3** is supported for now.\n\n## Install\n\n### Gradle\n\n```gradle\ndependencies {\n  compile \"ai.ost:fastjson-protobuf:${VERSION}\"\n}\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eai.ost\u003c/groupId\u003e\n  \u003cartifactId\u003efastjson-protobuf\u003c/artifactId\u003e\n  \u003cversion\u003e${VERSION}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nFirst, define our own `HttpMessageConverter`\n\n```java\n@EnableWebMvc\n@Configuration\npublic class WebMvcConfig implements WebMvcConfigurer {\n  @Override\n  public void configureMessageConverters(\n    List\u003cHttpMessageConverter\u003c?\u003e\u003e converters\n  ) {\n\n    FastJsonProtobufHttpMessageConverter converter =\n      new FastJsonProtobufHttpMessageConverter();\n\n    converter.setSupportedMediaTypes(\n      Arrays.asList(\n        MediaType.APPLICATION_JSON,\n        MediaType.APPLICATION_JSON_UTF8\n      )\n    );\n\n    converters.add(converter);\n  }\n}\n```\n\nThen define Protocol Buffer messages:\n\n```protobuf\nmessage HelloRequest {\n  string name = 1;\n}\n\nmessage HelloResponse {\n  string msg = 1;\n}\n```\n\nIn order to use protobuf messages as entities, we can use gradle plugin `com.google.protobuf` together with [protoc](https://search.maven.org/artifact/com.google.protobuf/protoc) and protoc plugin [protoc-gen-grpc-java](https://search.maven.org/artifact/io.grpc/protoc-gen-grpc-java/).\n\n```java\n@RestController\npublic class APIController {\n  @RequestMapping(\n    value = \"/hello\",\n    method = RequestMethod.POST,\n    consumes = MediaType.APPLICATION_JSON_VALUE\n  )\n  @RequestBody\n  public HelloResponse hello(@RequestBody HelloRequest req) {\n    // We can use `HelloResponse` as the return value\n    return HelloResponse.newBuilder()\n      .setMsg(\"Hello \" + req.getName())\n      .build();\n  }\n}\n```\n\n```sh\n$ curl -X POST -d '{\"name\": \"World\"}' http://localhost:8080/hello\n{\"msg\": \"Hello World\"}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fjava-fastjson-protobuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Fjava-fastjson-protobuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fjava-fastjson-protobuf/lists"}