0

I am looking for a Spring boot code generator, which receives RAML spec files as an input, and in turn, generate a basic Spring boot application covering the basic controllers, mapped with proper paths and examples in responses.

Do we have a plugin or code generator like that?

0

I was able to find some plugins. When using Maven, we can use the following plugin for RAML generation :

<plugin>
                <groupId>com.phoenixnap.oss</groupId>
                <artifactId>springmvc-raml-plugin</artifactId>
                <version>2.0.5</version>
                <configuration>
                    <ramlPath>src/main/resources/api.raml</ramlPath>
                    <schemaLocation>/types/</schemaLocation>
                    <outputRelativePath>/src/generated</outputRelativePath>
                    <addTimestampFolder>false</addTimestampFolder>
                    <basePackage>com.mk.raml</basePackage>
                    <baseUri>/api</baseUri>
                    <generateUnreferencedObjects>true</generateUnreferencedObjects>
                    <generationConfig>
                        <includeAdditionalProperties>false</includeAdditionalProperties>
                    </generationConfig>
                    <seperateMethodsByContentType>false</seperateMethodsByContentType>
                    <rule>com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerStubRule</rule>
                    <ruleConfiguration>
                    </ruleConfiguration>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-springmvc-endpoints</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate-springmvc-endpoints</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

The detailed documentation of the plugin can be found at : https://github.com/phoenixnap/springmvc-raml-plugin

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.