hateoas

HAL - is it a violation to the HAL format/standard if links are in the main body?

不羁的心 提交于 2019-11-26 17:22:11
问题 According to the HAL standard (see here and here) the links to other resources should be placed in a specific embedded section. So for instance this is not valid HAL, is my understanding correct? { "movies": [ { "id": "123", "title": "Movie title 1", "_links": { "subtitles": { "href": "/movies/123/subtitles" } } },{ "id": "456", "title": "Movie title 2", "_links": { "subtitles": { "href": "/movies/456/subtitles" } } } ], "_links": { "self": { "href": "/movies" } } } The reason for which the

REST API - DTOs or not? [closed]

与世无争的帅哥 提交于 2019-11-26 01:44:00
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . I am currently creating a REST-API for a project and have been reading article upon article about best practices. Many seem to be against DTOs and simply just expose the domain model, while others seem to think DTOs (or User Models or whatever you want to call it) are bad

REST API - DTOs or not? [closed]

风格不统一 提交于 2019-11-25 20:16:11
I am currently creating a REST-API for a project and have been reading article upon article about best practices. Many seem to be against DTOs and simply just expose the domain model, while others seem to think DTOs (or User Models or whatever you want to call it) are bad practice. Personally, I thought that this article made a lot of sense. However, I also understand the drawbacks of DTOs with all the extra mapping code, domain models that might be 100% identical to their DTO-counterpart and so on. Our API is mostly created so that other clients may consume data, however if we do it right we