3

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://groups.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?

Steffen Opel
  • 63,899
  • 11
  • 192
  • 211
Peter Bratton
  • 6,302
  • 6
  • 39
  • 61

1 Answers1

0

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.

Vincent Devillers
  • 1,628
  • 1
  • 11
  • 17
  • This is the standard approach. I was mostly curious if there was any existing implementations out there. Good opportunity for me to contribute something to the open source world. – Peter Bratton Jun 13 '11 at 18:11