Giter Club home page Giter Club logo

jsonhome4spring's Introduction

JSONHOME4SPRING

A json-home generator for RESTful web applications.

Json-Home?

Think of an machine-readable alternative to an index.html in json format, describing the REST resources of an application. If the caller knows the format, no URIs must be constructed using string-magic. The resources of the application will become navigable.

An example from the draft specification:

   GET / HTTP/1.1
   Host: example.org
   Accept: application/json-home

   HTTP/1.1 200 OK
   Content-Type: application/json-home
   Cache-Control: max-age=3600
   Connection: close

   {
     "resources": {
       "http://example.org/rel/widgets": {
         "href": "/widgets/"
       },
       "http://example.org/rel/widget": {
         "href-template": "/widgets/{widget_id}",
         "href-vars": {
           "widget_id": "http://example.org/param/widget"
         },
         "hints": {
           "allow": ["GET", "PUT", "DELETE", "PATCH"],
           "representations": ["application/json"],
           "accept-patch": ["application/json-patch"],
           "accept-post": ["application/xml"],
           "accept-ranges": ["bytes"]
         }
       }
     }
   }

More Features

The json-home format is nice for automatic discovery of RESTful services. Generating this format directly from source code is nice, because it will always be consistent with your application. Being consistent is also important for human-readable documentation - and the information needed to generate such kind of documentation is more or less available in your source code.

A more complete support of the json-home spec is already planned, please have a look at the GitHub Issues.

In order to consume json-home documents, a client-side library is needed. This will be implemented in the future.

Work in Progress!

  • The project is in a very early state. Many details will change in the next weeks, possibly in an incompatible way.
  • The json-home specification is still a draft, it might change itself in the next months.
  • This library does not yet fully support the current draft specification.
  • But: it is already working. You can use it to easily generate json-home documents for your RESTful Spring application. The library is actively used (and developed) at otto (http://www.otto.de).

Licensing

The project is released under version 2.0 of the Apache License. See LICENSE.txt for details.

Feedback + Help Wanted

Every kind of feedback - also negative - is appreciated. Even more appreciated are contributions to the code base.

Links and Documentation

You can find information about json-home in the draft specification: Json-Home: http://tools.ietf.org/html/draft-nottingham-json-home-02

The concept of URI Templates is defined here: http://tools.ietf.org/html/rfc6570

For information about the concept of link-relation types: http://tools.ietf.org/html/rfc5988

jsonhome4spring's People

Contributors

gunnarmorling avatar tunatom avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.