{"id":25720137,"url":"https://github.com/gregwhitaker/catnap","last_synced_at":"2025-05-06T19:45:35.810Z","repository":{"id":27988787,"uuid":"31482799","full_name":"gregwhitaker/catnap","owner":"gregwhitaker","description":"Partial JSON response framework for RESTful web services","archived":false,"fork":false,"pushed_at":"2021-11-06T06:13:33.000Z","size":747,"stargazers_count":54,"open_issues_count":16,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T02:21:32.207Z","etag":null,"topics":["api","jackson","jax-rs","json","partial-responses","rest","spring","springboot"],"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/gregwhitaker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-01T01:15:14.000Z","updated_at":"2025-02-15T19:55:47.000Z","dependencies_parsed_at":"2022-09-02T11:21:16.146Z","dependency_job_id":null,"html_url":"https://github.com/gregwhitaker/catnap","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcatnap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcatnap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcatnap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcatnap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregwhitaker","download_url":"https://codeload.github.com/gregwhitaker/catnap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252756679,"owners_count":21799531,"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":["api","jackson","jax-rs","json","partial-responses","rest","spring","springboot"],"created_at":"2025-02-25T17:36:39.823Z","updated_at":"2025-05-06T19:45:35.781Z","avatar_url":"https://github.com/gregwhitaker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# catnap\n[![Build Status](https://travis-ci.org/gregwhitaker/catnap.svg?branch=catnap2)](https://travis-ci.org/gregwhitaker/catnap)\n\nCatnap is a framework for supporting partial JSON and JSONP responses in RESTful web services by allowing users to supply arbitrary queries in the URL.\n\nCatnap supports partial responses in the following web frameworks:\n\n* \tSpring Boot\n* \tSpringMVC\n* \tRESTEasy\n* \tJersey\n\n## What is a partial response?\nBy default, the server will send back the full representation of a rest resource for every request.  Partial responses let you request only the elements you are interested in, instead of the full resource representation.  This allows your client application to avoid transferring, parsing, and storing unneeded fields, so you can utilize network and memory resources more efficiently.\n\nFor example, take the two responses below.  Both are requests for the same resource, but let's assume we are only interested in the following fields:\n\n*\tProduct Name\n*\tList Price\n*\tImage Url for Thumbnail Images\n\n### Full Resource Representation\n[https://www.catnap.it/products/12345/details](https://catnap-springboot-sample.herokuapp.com/products/12345/details)\n\n\t{\n\t  \"id\": \"12345\",\n\t  \"name\": \"Product 1\",\n\t  \"prices\": {\n\t    \"list\": \"$120.00\",\n\t    \"sale\": \"89.99\"\n\t  },\n\t  \"images\": [\n\t    {\n\t      \"sortOrder\": 1,\n\t      \"url\": \"https://catnap-springboot-sample.herokuapp.com\\/12345-primary.png\",\n\t      \"alt\": \"Product 1\",\n\t      \"size\": \"primary\"\n\t    },\n\t    {\n\t      \"sortOrder\": 2,\n\t      \"url\": \"https://catnap-springboot-sample.herokuapp.com\\/12345-thumbnail.png\",\n\t      \"alt\": \"Product 1\",\n\t      \"size\": \"thumbnail\"\n\t    }\n\t  ]\n\t}\n\t\n### Partial Resource Representation\n[https://www.catnap.it/products/12345/details?fields=name,prices(list),images(url)[size=thumbnail]](https://catnap-springboot-sample.herokuapp.com/products/12345/details?fields=name,prices(list),images(url)[size=thumbnail])\n\n\t{\n\t  \"name\" : \"Product 1\",\n\t  \"prices\" : {\n\t    \"list\" : \"$120.00\"\n\t  },\n\t  \"images\" : [ {\n\t    \"url\" : \"https://catnap-springboot-sample.herokuapp.com/12345-thumbnail.png\"\n\t  } ]\n\t}\n\t\nAs you can see, the partial response is a significant reduction in payload size and message complexity.  By allowing the consumer of the API to specify the fields they are interested in you can significantly reduce the complexity of response messages as well as improve performance over the wire.\n\n## Getting Catnap\nCatnap libraries are available from JCenter.\n\n* [catnap-spring](https://bintray.com/gregwhitaker/maven/catnap-spring) - Use this library if you are integrating Catnap with a SpringMVC application.\n* [catnap-springboot](https://bintray.com/gregwhitaker/maven/catnap-springboot) - Use this library if you are integrating Catnap with a Spring Boot application.\n* [catnap-jaxrs](https://bintray.com/gregwhitaker/maven/catnap-jaxrs) - Use this library if you are integrating Catnap with a Jersey or RESTEasy application.\n\n## Getting Started with Catnap\n\nPlease see the [wiki](https://github.com/gregwhitaker/catnap/wiki) for detailed documentation on how to get started using Catnap.\n\nFor documentation on the Catnap Query Language, please consult the [Catnap Query Language Reference](https://github.com/gregwhitaker/catnap/wiki/Catnap-Query-Language-Reference).\n\n## Examples\n\nPlease see the included [example projects](catnap-examples) for demonstrations on how to configure and use Catnap with your favorite web framework.\n\n## Bugs and Feedback\n\nFor bugs, questions and discussions please use the [Github Issues](https://github.com/gregwhitaker/catnap/issues).\n\n## License\nCopyright 2016-2019 Greg Whitaker\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fcatnap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregwhitaker%2Fcatnap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fcatnap/lists"}