The Spring MVC-RAML Sychronizer parent project aims to provide a live representation of the endpoints exposed in a project by using the Spring MVC Annotation in that project as the single source of truth. This can be used to either:
- Generate RAML code from Spring annotations
- Keep hand-written RAML files in sync with the Spring MVC implementation by cross-checking the contract with the implementation
- Generate SpringMVC Rest Controller Endpoints from a RAML file
When generating RAML, the project will extract information using reflection and source inspection (for JavaDoc) so as to expose all information available to it.
The project provides three artifacts:
- springmvc-raml-plugin: A maven plugin designed to be run on Java 8 code which has been compiled with argument name information.
- springmvc-raml-parser: This is a seperate project that contains the parser which converts Spring MVC annotations to a RAML Model
- springmvc-raml-annotations: This project allows the use of custom annotations such as @Example which can be used to embed example inputs or outputs.
A sample project that includes a SpringMVC Server implementation using the Decorator pattern as well as a RestTemplate based REST client is available here: SpringMVC RAML Contract First Sample. This sample is based on the contract first scenario whereby the RAML document is authored and used as the basis for implementation
Usage and documentation are available in the Javadoc and README.md of the child projects. Kindly contact the developers via email (available in the pom files) if required or open an Issue in our tracking system.
The SpringMVC-RAML plugin uses a Maven-based build system.
Git and JDK 8 update 20 or later
Be sure that your JAVA_HOME
environment variable points to the jdk1.8.0
folder
extracted from the JDK download.
The SpringMVC-RAML plugin is released under version 2.0 of the Apache License.
Pull requests are welcome; Be a good citizen and create unit tests for any bugs squished or features added