mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 18:45:23 +00:00
Swagr Codegen: Updates to generate comments properly for models
This commit is contained in:
parent
1f738486ee
commit
b61d3b2914
@ -16,16 +16,18 @@ import $import$;
|
||||
public class $className$ extends $extends$ {
|
||||
|
||||
$fields:{ field |
|
||||
//$field.description$
|
||||
private $field.fieldDefinition.returnType$ $field.fieldDefinition.name$ $field.fieldDefinition.initialization$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $field.description$
|
||||
*/
|
||||
private $field.fieldDefinition.returnType$ $field.fieldDefinition.name$ $field.fieldDefinition.initialization$;$\r$}$
|
||||
|
||||
$fields:{ field |
|
||||
//$field.description$
|
||||
$if(field.required)$
|
||||
@Required $endif$
|
||||
$if(field.allowableValues)$
|
||||
@AllowableValues(value="$field.allowableValues$")$endif$
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$@AllowableValues(value="$field.allowedValuesString$")$endif$
|
||||
*/
|
||||
public $field.fieldDefinition.returnType$ get$field.fieldDefinition.NameForMethod$() {
|
||||
return $field.fieldDefinition.name$;
|
||||
}
|
||||
@ -33,5 +35,6 @@ public class $className$ extends $extends$ {
|
||||
public void set$field.fieldDefinition.NameForMethod$($field.fieldDefinition.returnType$ $field.fieldDefinition.name$) {
|
||||
this.$field.fieldDefinition.name$ = $field.fieldDefinition.name$;
|
||||
}
|
||||
|
||||
}$
|
||||
}
|
@ -96,9 +96,11 @@ public class ModelField {
|
||||
|
||||
public String getAllowedValuesString() {
|
||||
String result = "";
|
||||
if (this.allowableValues != null) {
|
||||
for(String allowedValue: this.allowableValues){
|
||||
result += (allowedValue +",");
|
||||
}
|
||||
}
|
||||
if(result.length() == 0)
|
||||
return null;
|
||||
else
|
||||
|
@ -16,16 +16,18 @@ import $import$;
|
||||
public class $className$ extends $extends$ {
|
||||
|
||||
$fields:{ field |
|
||||
//$field.description$
|
||||
private $field.fieldDefinition.returnType$ $field.fieldDefinition.name$ $field.fieldDefinition.initialization$;
|
||||
/**
|
||||
* $field.description$
|
||||
*/
|
||||
private $field.fieldDefinition.returnType$ $field.fieldDefinition.name$ $field.fieldDefinition.initialization$;$\n$
|
||||
}$
|
||||
|
||||
$fields:{ field |
|
||||
//$field.description$
|
||||
$if(field.required)$
|
||||
@Required $endif$
|
||||
$if(field.allowableValues)$
|
||||
@AllowableValues(value="$field.allowableValues$")$endif$
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowedValuesString)$@AllowableValues(value="$field.allowableValues$")$endif$
|
||||
*/
|
||||
public $field.fieldDefinition.returnType$ get$field.fieldDefinition.NameForMethod$() {
|
||||
return $field.fieldDefinition.name$;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user