Skip to content

Commit

Permalink
Merge pull request #368 from mshima/patch-1
Browse files Browse the repository at this point in the history
fix api documentation
  • Loading branch information
DanielFran authored Jul 25, 2024
2 parents a384a09 + 7cb8088 commit 1dd7555
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ import static org.springframework.data.couchbase.core.mapping.id.GenerationStrat
<%_ } else { _%>
<%- entityJavadoc %>
<%_ if (!dtoMapstruct) { _%>
@ApiModel(description = "<%- formatAsApiDescription(javadoc) %>")
@ApiModel(description = "<%- entityApiDescription %>")
<%_ }_%>
<%_ } _%>
<%_ if (databaseType === 'sql') { _%>
Expand Down Expand Up @@ -216,8 +216,8 @@ public class <%= persistClass %> extends <% if (databaseType === 'sql') { %>Pana
field,
}) -%>
<%_ } _%>
<%_ if (!dtoMapstruct && typeof field.documentation != 'undefined') { _%>
@ApiModelProperty(value = "<%- formatAsApiDescription(field.documentation) %>"<% if (required) { %>, required = true<% } %>)
<%_ if (!dtoMapstruct && field.fieldApiDescription) { _%>
@ApiModelProperty(value = "<%- field.fieldApiDescription %>"<% if (required) { %>, required = true<% } %>)
<%_ } _%>
<%_ if (databaseType === 'sql') {
if (field.fieldIsEnum) { _%>
Expand Down Expand Up @@ -284,7 +284,7 @@ public class <%= persistClass %> extends <% if (databaseType === 'sql') { %>Pana
if (relationship.relationshipJavadoc) { _%>
<%- relationship.relationshipJavadoc %>
<%_ if (!dtoMapstruct) { _%>
@ApiModelProperty(value = "<%- formatAsApiDescription(relationships[idx].documentation) %>")
@ApiModelProperty(value = "<%- relationship.relationshipApiDescription %>")
<%_ } _%>
<%_ }
if (relationshipType === 'one-to-many') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,12 @@ import <%=packageName%>.domain.enumeration.<%= element %>;
/**
* A DTO for the {@link <%= packageName %>.domain.<%= persistClass %>} entity.
*/
<%_ if (typeof javadoc !== 'undefined') { _%>
@ApiModel(description = "<%- formatAsApiDescription(javadoc) %>")
<%_ if (entityApiDescription) { _%>
@ApiModel(description = "<%- entityApiDescription %>")
<%_ } _%>
@RegisterForReflection
public class <%= dtoClass %> implements Serializable {
<%_ for (idx in fields) { _%>
<%_ if (typeof fields[idx].documentation !== 'undefined') { _%>
<%- formatAsFieldJavadoc(fields[idx].documentation) %>
<%_ } _%>
<%_
const field = fields[idx];
const fieldValidate = fields[idx].fieldValidate;
Expand All @@ -109,11 +106,14 @@ public class <%= dtoClass %> implements Serializable {
const fieldName = fields[idx].fieldName;
let required = fieldValidate && fieldValidateRules.includes('required');
_%>
<%_ if (field.fieldJavadoc) { _%>
<%- field.fieldJavadoc %>
<%_ } _%>
<%_ if (fieldValidate === true) { _%>
<%- include('/_global_partials_entity_/field_validators', { field }) -%>
<%_ } _%>
<%_ if (typeof fields[idx].documentation != 'undefined') { _%>
@ApiModelProperty(value = "<%- formatAsApiDescription(fields[idx].documentation) %>"<% if (required) { %>, required = true<% } %>)
<%_ if (field.fieldApiDescription) { _%>
@ApiModelProperty(value = "<%- field.fieldApiDescription %>"<% if (required) { %>, required = true<% } %>)
<%_ } _%>
<%_ if (fieldType === 'byte[]' && databaseType === 'sql') { _%>
@Lob
Expand Down Expand Up @@ -144,9 +144,9 @@ public class <%= dtoClass %> implements Serializable {
const otherEntityIsEmbedded = relationships[idx].otherEntity.embedded;
const ownerSide = relationships[idx].ownerSide;
_%>
<%_ if (typeof relationships[idx].documentation != 'undefined') { _%>
<%- formatAsFieldJavadoc(relationships[idx].documentation) %>
@ApiModelProperty(value = "<%- formatAsApiDescription(relationships[idx].documentation) %>")
<%_ if (relationship.relationshipJavadoc) { _%>
<%- relationship.relationshipJavadoc %>
@ApiModelProperty(value = "<%- relationship.relationshipApiDescription %>")
<%_ } _%>
<%_ if ((relationshipType === 'many-to-many' && ownerSide === true) || (relationshipType === 'one-to-many' && otherEntityIsEmbedded)) { _%>
public Set<<%= otherEntity.dtoClass %>> <%= relationshipFieldNamePlural %> = new HashSet<>();
Expand Down

0 comments on commit 1dd7555

Please sign in to comment.