Playback Structure and REST

Well, I love to play so far, and I was hoping to push the community to successes and failures, trying to develop a great REST application. I have a lot of experience with Django and thought about applying some methodologies from the http://django-tastypie.readthedocs.org/en/latest/?redir API creation package for playback.

You have found a good equivalent for exposing packages of models and APIs using flexible settings for throttling, whitelisting data output, formatting data output, automatic api url routes, etc.

+6
source share
2 answers

A few times ago there was a discussion about exhibiting models in google group. It was a pretty picky discussion because the audience was completely divided into two groups:
- those who really like this feature and it will be absolutely necessary.
- those who say that this is a really bad (even dangerous) way to expose your model directly at the presentation level, because it violates the MVC design and directly reveals your business data with potential violations of data security or integrity, etc. .

I'm not in a group, and I'm just considering the issue objectively ...
If you look at this Django API, I think this is not a problem if you can control how your model is exposed and what exactly is revealed. But I donโ€™t know how to do it out of the box on Play! ... I donโ€™t know if the guy who started the discussion, ever finished his module ... Anyway, the CRUD module is already doing something since it analyzes your model fields to open the CRUD interface ... so exposing it as REST would be just a matter of IMHO's presentation (and some work).

+8
source

Here you have a couple of modules that can help you create entertaining web services from the game! Applications

RESTEasy Playback Module

The RESTEasy Play module allows you to define JAX-RS RESTful web services on the Play platform using RESTEasy.

and

RESTEasy-CRUD Playback Module

The RESTEasy-CRUD Play module allows you to automatically generate a set of CRA JAX-RS RESTful web services in the Play platform using RESTEasy.

I hope this helps

+7
source

Source: https://habr.com/ru/post/887049/


All Articles