tnt-develop-team / tntserver

Tool Sharing App Server
0 stars 1 forks source link

Spring REST docs Spike #39

Closed jenac closed 7 years ago

jenac commented 7 years ago

Spike on how to use Spring REST docs. Try apply the Spring REST docs on the existing Neo4J spike code. Document/wiki and share with the team

xwowenzhao commented 7 years ago

If we apply HATEOAS, which makes restful API self-discoverale, to our restful API, we don't need documentation.

jenac commented 7 years ago

What is HATEOAS and how to apply it on SpringBoot?

xwowenzhao commented 7 years ago

What is HATEOAS? HATEOAS, an abbreviation for Hypermedia As The Engine Of Application State, is a constraint of the REST application architecture. A REST client needs no prior knowledge about how to interact with any particular application or server beyond a generic understanding of hypermedia. The HATEOAS constraint decouples client and server in a way that allows the server functionality to evolve independently.

By using HATEOAS, every API response will contain all URLs of resources at next lower level, so client can pick the one that it needs.

How use it? Include dependency of spring-hateoas, spring-data-rest-hal-browser (for debug). Use spring data rest.

More info? http://projects.spring.io/spring-hateoas/

jenac commented 7 years ago

Could you create a spike branch and demo to us next meeting?

xwowenzhao commented 7 years ago

sure will do.

jenac commented 7 years ago

Good demo!