Skip to content

Commit

Permalink
Inclusion of API documentation in CXF Server stub generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavoapaz committed Oct 16, 2017
1 parent 027fb2f commit 05eefe2
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ import javax.validation.constraints.*;
import javax.validation.Valid;
{{/useBeanValidation}}

{{#appName}}
/**
* {{{appName}}}
*
{{#appDescription}}
* <p>{{{appDescription}}}
*
{{/appDescription}}
*/
{{/appName}}
@Path("{{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}")
@Api(value = "/", description = "{{description}}")
{{#addConsumesProducesJson}}
Expand All @@ -32,6 +42,16 @@ public interface {{classname}} {
{{#operations}}
{{#operation}}

{{#summary}}
/**
* {{summary}}
*
{{#notes}}
* {{notes}}
*
{{/notes}}
*/
{{/summary}}
@{{httpMethod}}
{{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}}
{{#hasConsumes}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,29 @@ import org.springframework.stereotype.Service;
{{/useSpringAnnotationConfig}}
{{#description}}
{{/description}}
{{#appName}}
/**
* {{{appName}}}
*
{{#appDescription}}
* <p>{{{appDescription}}}
{{/appDescription}}
*
*/
{{/appName}}
public class {{classname}}ServiceImpl implements {{classname}} {
{{#operations}}
{{#operation}}
{{#summary}}
/**
* {{summary}}
*
{{#notes}}
* {{notes}}
*
{{/notes}}
*/
{{/summary}}
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
// TODO: Implement...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ import org.springframework.test.context.web.WebAppConfiguration;


/**
* API tests for {{classname}}
{{#appName}}
* {{{appName}}}
*
{{/appName}}
{{#appDescription}}
* <p>{{{appDescription}}}
*
{{/appDescription}}
* API tests for {{classname}}
*/
{{#generateSpringBootApplication}}
@RunWith(SpringJUnit4ClassRunner.class)
Expand Down Expand Up @@ -91,10 +99,14 @@ public class {{classname}}Test {

{{#operations}}{{#operation}}
/**
{{#summary}}
* {{summary}}
*
{{#notes}}
* {{notes}}
*
{{/notes}}
{{/summary}}
* @throws ApiException
* if the Api call fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
{{/withXml}}
{{#description}}
/**
* {{{description}}}
**/
@ApiModel(description="{{{description}}}")
{{/description}}
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
Expand All @@ -28,6 +31,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
{{/withXml}}
@ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
{{#description}}
/**
* {{{description}}}
**/
{{/description}}
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}

{{#vars}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<artifactId>{{artifactId}}</artifactId>
<packaging>war</packaging>
<name>{{artifactId}}</name>
{{#appDescription}}
<description>{{{appDescription}}}</description>
{{/appDescription}}
<version>{{artifactVersion}}</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down

0 comments on commit 05eefe2

Please sign in to comment.