Thanks to visit codestin.com
Credit goes to github.com

Skip to content

abhishekshah2905/spring-filter-custom-fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Filter Custom Fields Application

This Spring Boot application demonstrates how to filter custom fields from a User object based on user input.

Overview

The application includes a UserController that exposes an endpoint to retrieve a User object with specified fields. The filterFields method in the controller filters out fields that are not included in the request parameter.

Getting Started

Prerequisites

  • Java JDK 8 or higher
  • Maven

Installation

  1. Clone the repository:
  git clone https://github.com/abhishekshah2905/spring-filter-custom-fields.git
  1. Navigate to the project directory:
  cd spring-filter-custom-fields
  1. Build the project:
  mvn clean install
  1. Run the application:
  mvn spring-boot:run
  1. Access the application at http://localhost:8089

Usage

  • Use the / endpoint with a query parameter fields to specify which fields to include in the response. For example, /users?fields=name,age will return a User object with only the name and age fields.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages