New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

com.github.apavlidi:restfulQueries

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.apavlidi:restfulQueries

Develop true restful APIs by supporting pagination, filtering, selection, sorting and searching. This project helps you add these featrues to your REST Controller easily without developing custom solutions. The project is currently only compatible with Spring Boot + Spring Data MongoDB applications.

  • 0.0.1
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

RestfulQueries PRs Welcome Maven Central

Develop true restful APIs by supporting pagination, filtering, selection, sorting and filtering. This project helps you add these features to your REST Controller easily without developing custom solutions. The project is currently only compatible with Spring Data MongoDB applications. There is a blog post here, where I describe step-by-step the implementation of this library.

Getting Started

For Maven-based projects, add the following to your pom.xml file. This dependency is available from the Maven Central repository.

<dependency>
    <groupId>com.github.apavlidi</groupId>
    <artifactId>restfulQueries</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

  1. Add a RequestParam of type Map to your Rest Controller.
  @GetMapping("/profile")
   private List<Profile> getAllProfiles(@RequestParam Map <String, String> filters) {
       ....
   }
  1. Call the collectRestApiParams() inside your controller and pass the RequestParam map.
   Map<String, String> restApiQueries = collectRestApiParams(filters);
  1. Pass the filters to your service/repository and before calling the Spring Data MongoDB API, call applyRestApiQueries() and pass your query variable.
  @Override
  public List<Profile> getAllProfilesDemo(Map<String, String> filters) {
      Query query = new Query();
      applyRestApiQueries(query, restApiQueries);
      return mongoTemplate.find(query, Profile.class);
  }

Navigate to API Documentation for more

Documentation

RestfulQueries documentation is available here.

Contributing

The main purpose of this repository is provide an easy way of implementing truly restful apis by supporting the features of pagination, selection, filtering, and sorting to the developers. Development of RestfulQueries happens here on GitHub, and we are grateful to the community for contributing bugfixes and improvements.

Contributing Guide

Read the contributing guide to learn about the development process, how to propose bugfixes and improvements, and how to build and test your changes to RestfulQueries.

Good First Issues

To help you get your feet wet and get you familiar with the contribution process, check the issues for good first issues that contain bugs or enhancements with relatively limited scope. This is a great place to get started.

Feedback

Suggestions and/or improvements are welcome!

Licensing

This project is licensed under the MIT License

FAQs

Package last updated on 06 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc