spring_reference/IV. Spring Boot features/26.1.7. Spring HATEOAS.md

6 lines
689 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 26.1.7. Spring HATEOAS
如果你正在开发一个使用超媒体的RESTful APISpring Boot将为Spring HATEOAS提供自动配置这在多数应用中都工作良好。自动配置替换了对使用@EnableHypermediaSupport的需求并注册一定数量的beans来简化构建基于超媒体的应用这些beans包括一个LinkDiscoverer和配置好的用于将响应正确编排为想要的表示的ObjectMapper。ObjectMapper可以根据spring.jackson.*属性或一个存在的Jackson2ObjectMapperBuilder bean进行自定义。
通过使用@EnableHypermediaSupport你可以控制Spring HATEOAS的配置。注意这会禁用上述的对ObjectMapper的自定义。