{"id":15287547,"url":"https://github.com/rkonovalov/jfilter","last_synced_at":"2025-08-21T20:33:07.346Z","repository":{"id":33207576,"uuid":"152902358","full_name":"rkonovalov/jfilter","owner":"rkonovalov","description":"JFilter library for filtering REST Spring Web Service type application responses.","archived":false,"fork":false,"pushed_at":"2024-02-01T19:41:42.000Z","size":917,"stargazers_count":66,"open_issues_count":14,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-10T05:51:38.649Z","etag":null,"topics":["filter","jackson","java","json","spring","spring-boot","spring-mvc","springboot","springframework","xml"],"latest_commit_sha":null,"homepage":"https://rkonovalov.github.io/projects/jfilter/1.0.17/","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/rkonovalov.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":"2018-10-13T18:29:43.000Z","updated_at":"2024-12-03T07:17:21.000Z","dependencies_parsed_at":"2023-01-14T23:54:46.193Z","dependency_job_id":null,"html_url":"https://github.com/rkonovalov/jfilter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonovalov%2Fjfilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonovalov%2Fjfilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonovalov%2Fjfilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkonovalov%2Fjfilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkonovalov","download_url":"https://codeload.github.com/rkonovalov/jfilter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532448,"owners_count":18240792,"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":["filter","jackson","java","json","spring","spring-boot","spring-mvc","springboot","springframework","xml"],"created_at":"2024-09-30T15:30:45.997Z","updated_at":"2024-12-20T04:08:00.842Z","avatar_url":"https://github.com/rkonovalov.png","language":"Java","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://rkonovalov.github.io/projects/jfilter/1.0.18/\"\u003e\n    \u003cimg src=\"https://rkonovalov.github.io/assets/images/jfilter-logo.svg\" alt=\"JFilter Main page\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Build Status](https://travis-ci.org/rkonovalov/jfilter.svg?branch=master)](https://travis-ci.org/rkonovalov/jfilter)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.rkonovalov/jfilter/badge.svg?style=blue)](https://search.maven.org/search?q=g:com.github.rkonovalov%20a:jfilter)\n[![Javadocs](https://www.javadoc.io/badge/com.github.rkonovalov/jfilter.svg)](https://www.javadoc.io/doc/com.github.rkonovalov/jfilter)\n[![codecov](https://codecov.io/gh/rkonovalov/jfilter/branch/master/graph/badge.svg)](https://codecov.io/gh/rkonovalov/jfilter)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a0133be1929145eabe7d50217587b896)](https://www.codacy.com/app/rkonovalov/jfilter?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=rkonovalov/jfilter\u0026amp;utm_campaign=Badge_Grade)\n[![SonarCloud](https://sonarcloud.io/api/project_badges/measure?project=jfilter\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=jfilter)\n[![CircleCI](https://circleci.com/gh/rkonovalov/jfilter.svg?style=svg)](https://circleci.com/gh/rkonovalov/jfilter)\n\n# About\nJFilter library could be used in Spring Web Service project for the filter(exclude) of fields in Service response.\nWhen you used Jackson @JsonView interface and need more powerful and flexibility, this library could be useful.\nFor information please follow the links below.\n\n## Publications\nArticle in [medium.com](https://medium.com/spring-web-service-response-filtering/spring-web-service-response-filtering-5dcff6679327)\n\nArticle in [dzone.com](https://dzone.com/articles/spring-web-service-response-filtering)\n\n## Samples\nYou can view all samples in GitHub [Samples](https://github.com/rkonovalov/jfilter-samples)\n\n## Index\n* [Main page](https://rkonovalov.github.io/projects/jfilter/1.0.18/)\n* [Requirements](https://rkonovalov.github.io/projects/jfilter/1.0.18/requirements/)\n* [Diagram](https://rkonovalov.github.io/projects/jfilter/1.0.18/diagram/)\n* [Installation](https://rkonovalov.github.io/projects/jfilter/1.0.18/installation/)\n* [Getting started](https://rkonovalov.github.io/projects/jfilter/1.0.18/getting-started/)\n* [Configuration](https://rkonovalov.github.io/projects/jfilter/1.0.18/configuration/)\n* [Examples](https://rkonovalov.github.io/projects/jfilter/1.0.18/examples/)\n  * [Simple field filter](https://rkonovalov.github.io/projects/jfilter/1.0.18/examples/filter-field/)  \n  * [Session strategy filter](https://rkonovalov.github.io/projects/jfilter/1.0.18/examples/filter-strategy/) \n  * [XML Schema-based filter configuration](https://rkonovalov.github.io/projects/jfilter/1.0.18/examples/filter-file/)\n  * [Whole Spring Controller filtration](https://rkonovalov.github.io/projects/jfilter/1.0.18/examples/filter-controller/)\n  * [Dynamic Filter](https://rkonovalov.github.io/projects/jfilter/1.0.18/examples/filter-dynamic/)\n* [Release Notes](https://rkonovalov.github.io/projects/jfilter/1.0.18/release-notes/)\n\n\n# Diagram of library flowchart\n![Diagram](https://rkonovalov.github.io/assets/images/jfilter-diagram-1.0.18.svg)\n\n\n# Installation\nFor using this library you need to import dependency\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.rkonovalov\u003c/groupId\u003e\n    \u003cartifactId\u003ejfilter\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.18\u003c/version\u003e\n\u003c/dependency\u003e\n```\n* Attention: if you have used previous versions of library please rename artifactId from **json-ignore** to **jfilter**\n\nIf you need to add SOAP Web Services support you need to import SOAP dependency also\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.rkonovalov\u003c/groupId\u003e\n    \u003cartifactId\u003ejfilter-soap\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.18\u003c/version\u003e\n\u003c/dependency\u003e\n```\nLink to project [JFilter Soap](https://github.com/rkonovalov/jfilter-soap)\n\n# Getting started\nFor activation of JFilter library just add next annotation\n\n```java\n@EnableJsonFilter\n```\n\n# Example o usage\nThis example illustrates how easy you can configure Service Response.\nJust add FieldFilterSetting annotation with filterable fields and library will exclude them from response.\n\n```java\n    @FieldFilterSetting(className = User.class, fields = {\"id\", \"password\", \"secretKey\"})\n    \n    @RequestMapping(value = \"/users/signIn\",\n            params = {\"email\", \"password\"}, method = RequestMethod.POST,\n            consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE},\n            produces = {MediaType.APPLICATION_JSON_VALUE})            \n    public User signIn(@RequestParam(\"email\") String email, @RequestParam(\"password\") String password) {\n        return userController.signInUser(email, password);\n    }\n```\n\n* Service response **before** filtration\n\n```json\n{\n  \"id\": 10,\n  \"email\": \"janedoe@gmail.com\", \n  \"fullName\": \"Jane Doe\",\n  \"password\": \"12345\",\n  \"secretKey\": \"54321\",\n  \"address\": {\n    \"id\": 15,\n    \"apartmentNumber\": 22,\n    \"street\": {\n      \"id\": 155,\n      \"streetName\": \"Bourbon Street\",\n      \"streetNumber\": 15\n    }\n  }\n}\n```\n\n* Service response **after** filtration\n\n```json\n{ \n  \"email\": \"janedoe@gmail.com\", \n  \"fullName\": \"Jane Doe\",\n  \"address\": {\n    \"id\": 15,\n    \"apartmentNumber\": 22,\n    \"street\": {\n      \"id\": 155,\n      \"streetName\": \"Bourbon Street\",\n      \"streetNumber\": 15\n    }\n  }\n}\n```\n\n# Release notes\n\n## Version 1.0.18\n    * Added ability of using DynamicFilter along with FilterSettings, Case #16\n    * Added ability of using DynamicFilter on class level, Case #18\n    * Added support of SOAP Web Services (alpha version)\n\n## Version 1.0.17\n    * Added ability of using custom Message Converters, Case #11\n    * Added ability of change configuration of exist ObjectMappers, Case #11\n    * Removed of using ConverterMapperModifier, instead module uses MixinFilter for field filtering.\n      It's need for correct filtering of Java 8 types Case #12\n    \n## Version 1.0.16\n    * Simplified setting FilterFields into session or request attibutes for using DynamicSessionFilter\n    * Changed artifactId of project from json-ignore to jfilter\n\n## Version 1.0.15\n    * Added ability of using default Spring MessageConverters MappingJackson2HttpMessageConverter and MappingJackson2XmlHttpMessageConverter instead of FilterConverter\n    * Added FilterXmlMapper and FilterObjectMapper for overriding default ObjectMapper and XmlMapper when using default Spring MessageConverters\n    * Changed generic type from Serializable to Object in FilterConverter\n    \n## Version 1.0.14\n    * Refactored FilterConverter class for inheriting AbstractHttpMessageConverter instead of HttpMessageConverter\n    * Added Comparator class for simplify if...else branching. Including in dynamic filter components\n    * Refactored DynamicSessionFilter component\n    \n## Version 1.0.13\n    * Fixed bug with LocalDateTime serializing\n    \n## Version 1.0.12\n    * Added ObjectMapperCache for caching of ObjectMapper from each method in Spring controller\n    * Added FilterConfiguration for extending of exist list of ObjectMappers and enabling/disabling of module\n    * Refactored code mechanizm of serializing Spring http messages\n    \n## Version 1.0.11\n    * Added HttpServletRequest in RequestSession for using in DynamicFilterComponent Case #6 \n    * Added FilterBehaviour for keep/hide filtering fields Case #7 \n    \n## Version 1.0.10\n    * Fixed bug in integration with Swagger UI Case #3\n\n## Version 1.0.9\n    * Fixed bug \"No converter found for return value of type\" Case #1\n    * Added little features from Case #4, Case #5 \n\n## Version 1.0.8\n    * Added Dynamic Filter which allows to create own filters with custom behaviour\n    * Added DynamicSessionFilter for storing custom field filter in session\n    * Added feature for auto loading XML Schema-based configuration filter when it changed on runtime\n    * Changed package name from com.json.ignore to com.jfilter \n    * Changed package from advice to components\n    * Fixed bug in FileFilter which not allowed to load xml configuration from external source\n    \n## Version 1.0.7\n    * Added FileWatcher controller which auto reloads modified XML Schema based configurations\n    * Refactored Javadoc\n    * Fixed incorrect Jackson XML dependency importing\n\n## Version 1.0.6\n    * Added JSON/XML converters inherited from HttpMessageConverter\n    * Removed native reflection and added Jackson BeanSerializerModifier for field filtering\n    * Added EnableJsonFilter annotation for enabling/disabling filtration\n    * Added ability to apply filter annotations on whole Spring Rest controller\n    * Fixed bugs\n\n## Version 1.0.5\n    * Added Filter provider for improving execution speed\n    * Fixed bugs \n\n## Version 1.0.4\n    * Added xml Schema-based configuration\n    * Fixed bugs \n\n## Version 1.0.3\n    * Added session strategy filtering\n\n## Version 1.0.2\n    * Added additional constructors\n\n## Version 1.0.0\n    * Initial release\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkonovalov%2Fjfilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkonovalov%2Fjfilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkonovalov%2Fjfilter/lists"}