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

Answers


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.


Need Your Help

Java Casting Object into Object Array And Enriched For Loop

java arrays object foreach arguments

Lets say I pass my arguments into my function like this.

backBarButtonItem does not appear swift

ios swift segue

I know someone did the same question, but there's no answer there.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.