Is there a solution for generating a JSON SMD for a Spring 3 REST Controller?
A colleague and I are setting up an architecture for rapid development of rich client-side apps using REST and JSON. Our server is using Spring 3's MVC and REST features to expose REST services as Spring controllers. For non-standard REST calls, we'd like to use Service Mapping Descriptors (SMD) to expose the contract of certain controllers:
http://grou开发者_运维百科ps.google.com/group/json-schema/web/service-mapping-description-proposal
SMD looks fairly new on the scene; is there any solution out there right now for generating an SMD JSON file from a Spring 3 REST controller?
You can define your own HttpMessageConverter:
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<bean class="my.package.CustomJsonHttpConverter" />
</list>
</property>
</bean>
where CustomJsonHttpConverter extends AbstractHttpMessageConverter, just like the MappingJacksonHttpMessageConverter.
精彩评论