开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜