简体   繁体   中英

Is it possible to add the HATEOAS principles to an existing REST web service?

Is it possible to add the HATEOAS principles to an existing REST web service? Are there any issues with doing this after developing a REST web service?

I think it's certainly possible to adopt HATEOAS gradually. For example, your JSON document can later on get links with useful relationships, or encode descriptions for your actions.

One of the reasons the HAL format uses _links as it's main property for links and not links is so it's less likely to clash with existing properties.

However, I do believe that if an API is designed around resources and links first, the outcome can be of a higher quality. For example, you should probably encourage your users to not manually concatenate values to build URLs from ids, and you probably want to remove all id fields.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM