The main goal of the spike was investigation if the proposed plugin meets project initial requirements.
- for endpoints it has to generate interfaces or classes that could be extended to implement the necessary logic [MUST];
support !include directive in RAML files like below:
- support definition of a single element in collection as $ref
for endpoints it has to generate interfaces or classes that could be extended to implement the necessary logic [MUST];
The plugin provides several rules an ability to generate interfaces. To achiev this you have to specify the rule name in pom.xml file
Here is the raml file which were used to test:
this are the Controllers generated by plugin:
- Rules description can be found here https://github.com/phoenixnap/springmvc-raml-plugin#rule
- Sample module can be found here. The pom file which uses this rule can be found here
2. support !include directive in RAML files like below :
3. support definition of a single element in collection as $ref
Plugin is able to read
!include directive with
schema extension but the result of the parsing does not feet our expectations.
For instance we declared type in following
with next content inside
The module will create Controller for this
raml file with one "but"
As we can see the the particular type of the response was not defined and because of it models for "Drink" and "DrinkCollection" also were not created. The only model was created is general request, which fields do not satisfy our requirement.
Despite of the fact that currently correct type selection is not provided we can probably inject custom logic in the phase of distinguishing the type in ApiActionMetadata.parseResponse().
the following declaration
is already resolved as
JSONTypeDeclaration , so the logic inside
SchemaHelper.mapSchemaToPojo(...) can be modified to satisfy our needs.