{"id":27699562,"url":"https://github.com/zkdlu/api-response-spring-boot-starter","last_synced_at":"2026-02-28T15:01:14.684Z","repository":{"id":37395844,"uuid":"348329516","full_name":"zkdlu/api-response-spring-boot-starter","owner":"zkdlu","description":"Spring api response provides a standard structure to response data and exception handling","archived":false,"fork":false,"pushed_at":"2023-01-04T16:40:01.000Z","size":89,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-02T07:47:08.565Z","etag":null,"topics":["exception-handler","library","restful","spring-boot"],"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/zkdlu.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":"2021-03-16T11:56:01.000Z","updated_at":"2025-01-26T20:26:49.000Z","dependencies_parsed_at":"2023-02-02T18:47:03.553Z","dependency_job_id":null,"html_url":"https://github.com/zkdlu/api-response-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/zkdlu/api-response-spring-boot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkdlu%2Fapi-response-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkdlu%2Fapi-response-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkdlu%2Fapi-response-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkdlu%2Fapi-response-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkdlu","download_url":"https://codeload.github.com/zkdlu/api-response-spring-boot-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkdlu%2Fapi-response-spring-boot-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29938962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["exception-handler","library","restful","spring-boot"],"created_at":"2025-04-25T17:24:31.175Z","updated_at":"2026-02-28T15:01:14.598Z","avatar_url":"https://github.com/zkdlu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Api Response\nThe rest api classifies the HttpMethod and structured the url mapped to the resource. and have standard structure to response data.\nSpring Api Response provides a standard structure to response data and exception handling \n\n## Maven configuration\nAdd the Maven dependency:\n```xml\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.zkdlu\u003c/groupId\u003e\n    \u003cartifactId\u003eapi-response-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Gradle configuration\nAdd the Gradle dependency:\n```groovy\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n\ndependencies {\n    implementation 'com.github:zkdlu:api-response-spring-boot-starter:Tag'\n}\n```\n\n## Getting Started\nHere is a quick teaser in Spring boot Application:\n\n```java\n// Add Enable Annotation\n@EnableResponse\n@SpringBootApplication\npublic class DemoApplication {\n    public static void main(String[] args) {\n        SpringApplication.run(DemoApplication.class, args);\n    }\n}\n\n// Defination Custom Exception\npublic class CustomException extends RuntimeException {\n}\n\n// application.yml\nspring:\n  response:\n    success:\n      code: 200\n      msg: SUCCESS\n    exceptions:\n      custom1:\n        code: 400\n        msg: 'Something went wrong'\n        type: com.example.demo.CustomException\n      ..\n      \n// Some Controller\npublic class DemoController {\n  @GetMapping(\"/\")\n  public String test() {\n    return \"demo\"\n  }\n  \n  @GetMapping(\"/model\")\n  public MyModel test2() {\n    return MyModel.prototype();\n  }\n  \n  @GetMapping(\"/exception\")\n  public String test3() {\n    throw new CustomException();\n  }\n  \n  @GetMapping(\"/list\")\n  public List\u003cMyModel\u003e test4() {\n    return Array.asList(MyModel.prototype()); \n  }\n}\n```\n\nThe response structure\n\n- Before\n```json\n{\n  \"msg\": \"hello\"\n}\n```\n\n- After\n```json\n# IF Sucess\n{\n  \"success\": true,\n  \"code\": 200,\n  \"msg\": \"\u003csuccess msg\u003e | SUCCESS\",\n  \"data\": {\n    \"msg\": \"hello\"\n  }\n}\n\n# IF Thrown Exception\n{\n  \"success\": false,\n  \"code\": 400,\n  \"msg\": \"\u003cfail msg by your exception\u003e\",\n  \"data\": \n}\n\n```\n\n## Build from Source\nYou don’t need to build from source (binaries in jitpack.io), but if you want to try out the latest, Use the built-in gradle wrapper. You don't need gradle, jdk, anything.\n\n```bash\n# macos\n$ chomod +x ./gradlew\n$ ./gradlew install\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkdlu%2Fapi-response-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkdlu%2Fapi-response-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkdlu%2Fapi-response-spring-boot-starter/lists"}