rest4j


REST framework for Java

A framework for creating JSON-based RESTful services using a service description in XML.

Features

  • Automatic generation of REST API documentation
  • Automatic generation of client libraries for Java, Python, .NET and PHP
  • Flexible mapping of Java objects to JSON representation allows to completely decouple internal Java representation from external JSON view
  • Request dispatcher for Spring MVC and plain servlet container
  • Cross-domain XHR requests
  • Etags, If-Modified and If-Not-Modified HTTP headers
  • Gzip compression
  • JSONP support
  • Can be used as a POJO-to-JSON serializer based on schema defined in XML
  • Support for plain text and binary resources

Documentation

QuickStart - the best place to start with.

ApiXmlSchema - the XML tags reference (for the API description XML).

Mappings - explore the mappers, converters, field-filters and object factories designed to map your internal Java objects to JSON and vice versa.

Roadmap for version 2.0:

  • Add multipart upload support to client libraries
  • WebSocket & STOMP support
  • Add type polymorphism using <union> instead of <model> and attribute extends="base model" inside <model>. When unmarshalling, choose the right type based on <constant> fields and input field names.
  • Support more then one field with the same name but different types
  • Support for scalable lists (Iterable<T> or ScrollableResults) in output.
  • Add support for external caching and an API for the cache-control: max-age, no-cache, private headers.
  • Add compression to the client libraries. Here is one example: http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientGZipContentCompression.java
  • Add specialized numeric types: int, long and double.
  • Add support for JSR 310
  • Remove empty models in errors in doc generator
  • Map errors in client libraries
  • Make path params mandatory

Roadmap for version 3.0:

  • Reload XML configuration in runtime whenever it changes
  • Add validation layer: maxSize, minSize, regexp, maxLength, minLength, max, min, custom field validators (lookup validators with ServiceProvider)
  • Export to Apache Thrift IDL
  • Export to http://apiary.io/
  • Export to http://mashape.com
  • Add API call example generator for client libs
  • Python client: add properties to model constructors

Project Information

The project was created on May 5, 2013.

Labels:
Java REST JSON